instruction stringlengths 34 19.9k |
|---|
I'm trying to implement the paper titled An Image Signature for any Kind of Image, but I'm having trouble understanding what they mean in this paragraph:
For each column of
the image, we compute the sum of absolute values of differences between adjacent pixels in that column. We compute
the total of all columns, a... |
i ve just tried to do coding bat exercise. There are posted solutions to the problem i tried to solve.
However, I was stubborn, i ignored them and tried to code it up my own way(basically reinventing my own wheel - square,bad working wheel).
After 4 hours it looks nasty and fails some tests.
Now i realize that my log... |
I have a large application in Java filled with independent classes which are unified in a PlayerCharacter class. The class is intended to hold a character's data for a game called the Burning Wheel, and as a result, is unusually complex. The data in the class needs to have computations controlled by the UI, but needs t... |
So far I've been using IPB and my custom scripts all coded in PHP but I am really disappointed of the long term performance of it.
I would like to move to native coding, the learning time to put into doesn't matter at all.
Ive found CppCMS and it seems to be the exact solution i was searching for.
I would like to know ... |
Sometimes action functions in the controller class can become huge and nasty, with many-many lines of code to simply control the flow of data from the Model to the View. At some point these huge functions completely lose track of the basic principles of good code, i.e. only doing one thing, being small, readable and ma... |
I'm a contractor at a large Telco where I'm usually working on several different projects at once.
The VCSs I use (mainly git and mercurial) tend to make me keep the code bases for unrelated projects in separate repositories, and I realise many benefits of this approach.
However, there are many little bits of utili... |
At our work place after hours of coding, testing and QA we have successfully added a couple of software tools in our product line. We specialize in web based software solutions so in order to tap on more users we are now considering putting our developed solutions online for hosting and providing online access to all o... |
We are working on scrum framework. Now a situation arise that we have to shuffle 2-3 scrum team members in between sprints.
Is it possible to shuffle sprint team members in between a sprint? What are the potential drawbacks of doing this?
|
I am working on developing range of web based software solutions. But the problem is that for some clients we need to deploy the applications in their local intranet. In such a situation I have to stick with Java as development language as I cannot give away the source code of the project.
Now in order to tap on more c... |
We got some code in a git repository that's used along different projects (with git different repositories), the problem is that we got now so many different projects that's difficult to track which projects will be affected and how when there is a change in the shared module.
Is there any way to find classes and meth... |
I am considering the options for designing a system in java which accepts data files from different systems applies some transformations to the data, concats data from multiple files to produce some output data files for the downstream systems. The data transformations are not per record transformation, e.g. I need to ... |
I've been working on writing .NET bindings for Rollbar, an error and message reporting service, like Airbrake. My library is working nicely and is published in the NuGet gallery.
So now I want to take it to the next level of usability and implement an NLog Extension for this. This entails writing one screen's-worth of ... |
I have been in an ongoing conversation concerning a project we are about to undertake at my place at work. The project concerns data integration. Our customers want to be able to integrate our data with theirs, either by sending data from their systems into ours, or by getting data from our system into theirs. I don... |
I am developing a graph-editor that uses drag and drop to build hierarchical graphs (containing nodes and links). Each node in the graph should be linked to a table in our database (SQL Server). I did a lot of research about libraries based on javascript or/and JSON specifications to draw nodes and links. There are a l... |
Someone proposed to me this pattern which I have never heard of before and can't find any information on it.
The basic idea is, when building a library for other developers to use; if the developer includes my library along with a 3rd party library the behavior of the API calls to my library changes.
An example:
I... |
I'm in the planning stage of making a code beautifier (similar to AStyle or Uncrustify) - originally I was going to just contribute to one of those projects,
but reviewing their source led me to the conclusion that I have different design goals and that their source is written in a way that makes it difficult for an ou... |
I have an idea in mind and would like to know if that's the way to go for my end application.
Think of my application as a social networking system in which I want to implement chat functionality. For that, I'd like to push data from the server to the client. I have heard I could use Node.js for that.
In the meanwhile... |
Eric Evan's DDD book, Cargo Shipping Example, pg. 168:
Location
Two places with the same name are not the same. Latitude and longitude
could provide a unique key, but probably not a very practical one,
since those measurements are not of interest to most purposes of this
system and they would be fairly complicat... |
At our company we typically make sure that we write an end-to-end test for our websites/web apps. That means we access a URL, fill in a form, submit the form to another URL and check the results of the page. We do this to test form validation, test that the HTML templates have the correct context variables, etc.
We als... |
Many languages like C++, C#, and Java allow you to create objects that represent simple types like integer or float. Using a class interface you can override operators and perform logic like checking if a value exceeds a business rule of 100.
I'm wondering if it's possible in some languages to define these rules as ann... |
I'm reading some Pascal code and everything is pretty straightforward except subranges. In the program I'm reading there's a variable d with the following type declaration:array[0..22] of 0..15; there's then the following procedure:
var a:integer;
begin
a:=0;
while k>0 do
begin
k:=k-1;
a:=(a+dig[k]... |
When I click on button, might be in windows apps, web apps, etc it has some animation to actually see it clicked and event is raised in background. I've knowledge of events and its attaching to button click events but I wanted to know how this mechanism works. I always assumed it is inbuilt in operating systems.
|
I'm putting much work in my program and after it's done I want to just setup a small website and sell each copy of the program but I don't want any legal issues.
Do I have to look for another library or can I "safely" link to it?
|
This question is asked in regards to gstreamer but it could apply to any add-on based architecture.
I have a Gstreamer based application that can ship as proprietary because I use unmodified Gstreamer in it with all LGPL parts. I may, however, also need to issue a version where one Gstreamer plugin is GPL. As far as ... |
I've been researching GDI a little and on some websites I'm lead to believe it can hardly draw a few boxes, while on others it can easily be used in an interactive charting application.
So I'm wondering what is used in applications like Excel where there can be a lot movement like scrolling through a large amount of da... |
Why is it that diff programs work on a line-by-line basis instead of a hierarchal one?
All code can be expressed in a hierarchy, even though it's not immediately apparent.
Most of the data we work with is hierarchal as well.
What are the potential issues with building a piece of software that can diff based on hiera... |
This is a generic question that I've always wondered.
In general, is it intensive for a CPU to create threads that perform "while not true ..." loops or similar?
For example, suppose I do:
// pseudo-code
new Thread(function() {
while (!useHasDoneSomething) {
// do nothing...
}
alert("you did somethi... |
I'm at the very start of a longtime running project with continual development. Because of that I'm hoping to make a good decision in which Framework will be right for this.
Previously I've worked with Codeigniter. A plusside is the huge community with a great User Guide. A few of the downsides are the backwards compat... |
I've taught myself a set of scripting and programming languages and right now I am very pleased with C#, I am the type of person that learns best by doing it and while I am able to create pretty much any kinda of application, my coding and skills are not as good as I wish.
How could I evaluate my skills and see what I ... |
Where is unsigned char used in C ( please tell about some real-world examples )? Why would we need both char and unsigned char?
Char ranges from -127 to 128 ( 8-bit integer )
Unsigned Char ranges from 0 to 255 ( 8-bit integer )
If the purpose is to store ASCII, why would we need both?
Another question.
Consider this:
c... |
Looking at some camera metadata on Windows File Properties there are (along with a few more) two Properties named Focal length and 35mm focal length.
I'm developing software that will make use of these two Properties. So far I have created a Property named FocalLength for the first, but I cannot seem to find a proper n... |
In several places Feature Driven Development (FDD) is called an Agile methodogoly - e.g. the Wikipedia entry on FDD.
Yet in general, to be considered FDD it seems the following requirements have to be satisfied:
Coloured UML has to be used (but documentation isn't necessary);
Instead of pair programming the team is d... |
If you are designing a function which should conver a string to an integer, how would you convert an empty string? The question is only about this one particular input value (empty string).
Between throwing an ExcStringIsEmpty exception and converting to 0 options I prefer the first. It seems more logical to me. Becaus... |
Let's say we have 3 cyclic sequences, each of them of length n and containing every number from the interval 1..n once.
The goal is to align the sequences in order to maximize the number of matches between the sequences. By a match I mean a column that contains 3 identical values. Since the sequences are cyclical, we ... |
I'm a beginning programmer, that for various reasons is using an existing Ruby codebase to learn to program. My goal is to be able to understand and eventually extend this codebase. However, I find it hard to understand what is a standard library function, a gem function, or a user-created function. Distinguishing betw... |
My intranet site uses LDAP and Active Directory to authenticate users. There are 2 kinds of Users: Managers and Employees. They are differentiated by having membership in a particular AD group.
In an effort to improve my code I'm trying to use (hopefully appropriately) formal design patterns. I think perhaps a Finite S... |
I'm in the process of developing a Rails app that I plan on subsequently deploying to Heroku. I've never run apps on Heroku (outside of the free simple app) so I have some questions on a few things on how I should architect some aspects of my app to run.
I want a service to run on a schedule to check for inactive users... |
I currently have an interface named InternalEntityIdTransformer, which has a getInternalId method, that given an external id returns the corresponding internal one.
Now I am working on functionality that will need to do the opposite transformation, and go from internal id to external id. Is adding an getExternalId meth... |
I have a web application developed using Spring and Hibernate, which uses a REST API and Javascript to display and update content. The project is nearly completed, but I want to enhance the look and feel. This will include better graphics and some extra behaviour.
I want to outsource this task to a freelancer over th... |
I'm a Python2 developer and I just ordered The C++ programming language, 4th edition, from Bjarne Stroustrup's, to learn C++11. But right after I ordered it, I started to wonder if I made a mistake. Are the changes made to C++ in C++11 analogous to how Python moved from 2 to 3 insofar as code significantly breaking an... |
I am a researcher, and in my research I do a lot of programming. I am a big fan of the open-source concept - especially in research, where transparency and reproducibility is already a big part of the culture. I gladly contribute as much as I can to the community, and releasing my code for anyone to use is part of that... |
I was thinking of an hypothetical programming language with a kleenean data type which would implement Kleene's three-valued logic. To sum up, it's an extension of the boolean data type with the three constants true, false and unknown where unknown means that the value is either true or false, but we don't know which.
... |
I am planning to start the public repository on github. In this repository I will be sharing code which I will be posting in my blog. I have seen lot of repositories without any license. Is it required to have a license file? Can't I just say "You're free to use this code in whatever way you need"? Please advise
|
I have a REST webservice that have a couple of resources, like Company and User. But now I need to make a modification to the API to return a special list combining company, user and maybe other type of resource. Like a list of recommendations with various type of resources.
Which is the best approach to solve this?
I ... |
I have a search function on my site and it is taking data from 6 different 3rd party resources. The problem is, it takes too long requesting the data over and over again on the results page.
I've read for questions like this on SO about session not being a good choice but for me 'memcache' is not an option, because the... |
I once heard that if you spend 90% of your time developing the design of your program the coding part will only take a trivial 10% of the time. I have found a lot more success in spending about 30% of my time designing the architecture than when I used to spend 0% in design. As a result my programs seem to avoid unne... |
Best practice question for error handling in C#?
In our system we will be writing out files, and with each file they will have a corresponding error file. The error file will get written every time even if there are not any errors.
I'm looking at the best way to handle the errors for this. Assuming when we go to write ... |
I have a debate with a programmer colleague about whether it is a good or bad practice to modify a working piece of code only to make it testable (via unit tests for example).
My opinion is that it is OK, within the limits of maintaining good object oriented and software engineering practices of course (not "making eve... |
I'm new Node.js development and I have a question about best practices when writing package.json files.
From my understanding, you have to list all devependences that you need to execute your app under "dependencies" in the package.json file. All your extra dependences that are required to run your test (or your build ... |
I have a web application that sends out transactional (triggered) emails to users. We've setup a message queue for the web application to write to when it needs to send out an email (best practices reasons etc.).
The question I'm struggling with is when to have the email template parsed into text:
Parse the template a... |
Should I obtain a licence from Oracle before developing Java software? I'm in the preliminary planning stages of developing a server on top of the the Hadoop/Java platforms.
I'm not much at all worried about the Hadoop side, but the "process" for developing on top of the Java VM is somewhat ambiguous. I was in the proc... |
I'm trying to figure out how an open socket or file handle should interact with continuations. Searching has revealed that dynamic-wind is probably part of the solution, but I'm more interested in the methodology rather than the implementation, and all I could find is how to implement it under various conditions.
Do p... |
My question is quite simple. How to handle a situation where the team is applying agile methodology in software projects and there so many iterations and change in requirements, that the schedule is highly affected? Plus you have your manager who is always wanting things to get done within schedule and it is something ... |
(This is a general question but I think is important.)
How do you quickly understand a huge piece of code, say, a project with tens of thousands of lines of code (written by other people)?
Are there any useful source analysis tools (for example, call graph visualizer) or IDEs that may be helpful? Any techniques are als... |
The book "Data Structures in C" (Horowitz and Sahni) suggests that in the following code the pointer pf is behaving as a dangling reference:
float f,*pf;
pf=(float*) malloc(sizeof(float));
*pf=2.6;
pf=(float*) malloc(sizeof(float));
The reasoning they give is that after the last line there is no way
to retrieve the st... |
I've been thinking about a side project that envolves web data scraping.
Ok, I read the Getting data from a webpage in a stable and efficient way question and the discussion gave me some insights.
In the discussion Joachim Sauer stated that you can contact the owners of the sites and architect some way to provide the d... |
I have two friends that have completely different schools of thought on how to lay out their code.
The first says that code should be well-indented and use lots of spaces and to name variables judiciously in order to organize things in a way so that you can immediately understand the hierarchy and semantics of the cod... |
The motivation for the content editable div would be to allow user input inside a normal div element. Why does it then behave so differently to input element? Mainly I am referring to the addition of a div or a br on line break.
Additionally it does not have a placeholder item. So my question is what is the point of co... |
I'm going to start an open source project from scratch, using git (via github) to manage the source. The project will be written in C# and will depend on at least two external libraries (more are likely to come). I wonder how I should reference the libraries, and the following ideas came to my mind:
A folder within th... |
I have a few questions about the Subversion open source project. I know that there are multiple versions of svndumpfilter (2,3). What are the tradeoffs and benefits of each version? In other words, what problems does each version seek to address?
There are known bugs in the original svndumpfilter that have not been re... |
Recently I have been working with a large set of talented programmers that lead to a discussion on when should we start building our own components (web js/css) vs downloading and modifying existing components that don't quite fit the needs of a project. Does anyone know or could suggest best practices for this type of... |
My lecturer mentioned today that it was possible to "label" loops in Java so that you could refer to them when dealing with nested loops. So I looked up the feature as I didn't know about it and many places where this feature was explained it was followed by a warning, discouraging nested loops.
I don't really understa... |
Recently I've been involved in an agile project (using scrum) where management came up with the idea that the team would nominate a developer 'MVP' as well as a QA 'MVP' at the end of each sprint, voted on by the team. The MVP then gets a small monetary reward and free lunch as well as a trophy to display on his desk.... |
I was wondering whether the community utilizes automation tests to the extent of UI? Is there some common best practices for testing UI?
Also - the product I'm working on is flex-based. I would love to get ideas how to test it.
Mainly I want to test:
Data appears on the screen as expected
Field validations (for exampl... |
For one of my apps, I want to make the source code “open source” so that others might adapt the code to their personal needs or even contribute improvements, but I don’t want anybody else to publish “my app”. Furthermore, I still want to be able to sell the app at some time in the future.
Is there a usual license for t... |
I have a picture that I elaborate with my program to obtain a list of coordinates.
There is a matrix represented in the image.
In an ideal test I would get only the sixteen central points of each square of the matrix.
But in actual tests I have some noise points.
I want to use an algorithm to extrapolate from the list ... |
What's the difference between a stream and a queue? They both have the concept of an ordered set of elements, but tend to have different implementations and a different vocabulary of 'insert'/'extract' (streams) vs. 'enqueue'/'dequeue' (queue). Are these interchangable? Do they suggest different concepts or patterns... |
In Rich Hickey's thought-provoking goto conference keynote "The Value of Values" at 29 minutes he's talking about the overhead of a language like Java and makes a statement like, "All those interfaces kill your reuse." What does he mean? Is that true?
In my search for answers, I have run across:
The Principle of Lea... |
I'm currently studying a course based on Software Design and I had a discussion in class with my professor and some classmates about a problem represented by the next scenario:
Scenario
Imagine we have a graphic application which lets us plan the interior design of our future house using a perspective from top. We are... |
In the last few weeks, I have been working on a Data Mapping Library, which has involved lots of research, experimentation, crying, blaming the whiteboard for not being big enough, and more research. But now I have a full idea of what I'm trying to do.
I have decided that before working on any data source adapters, I n... |
Thanks for looking!
Background
I have been tasked with writing a program to normalize and ingest data from various sources to a common database.
For the sake of simplicity, let's say that the program is for a public library system, and that they are wanting to maintain a database of all books currently lent out of thei... |
I want to compile custom functions during run time based on user written scripts. I'll give a hypothetical example that should demonstrate exactly what I need to do. This is the best way for me to describe the problem. I'd like a little input/ideas in how I can solve this. At the bottom I give you my ideas.
I have 2 cl... |
The CSS3 media query feature has led to many interesting possibilities in terms of developing websites which adjust to many different screen sizes and devices.
However, in practice, I'm starting to get the sense that the CSS3 media query feature, and the whole "Responsive Web Design" movement, may not live up to its pr... |
We have a web app where users can take online exams.
Exam admin will create a questionnaire. A questionnaire can have many Questions. Each question is a multiple choice question (MCQ).
Let's say an admin creates a questionnaire with 10 questions. Users attempt those questions. Now, unlike real exams users can attempt... |
I am not asking for someone to program this for me, I still would like to do all the programming, however I need some additional mathematical programming background for this kind of stuff because I haven't really dabbled into 3D spaces much and I am thinking lots of potential if-thens and switches could be simplified w... |
There is an application that involves billing enterprise customers for the services their customers utilize. The database schema does not properly reflect the business model. For instance, on a given account, services may become activated and deactivated. There is only a column to represent when the service was deactiv... |
In today's lecture about Modelling techniques with respect to MDD using UML the lecturer stated that it's absolutely necessary to give a (possibly) textual description about the semantics of each diagram you produce.
In my opinion it's not necessary to describe semantics of diagram elements which are already standardiz... |
Is it a good practice to implement useless exception handling, just in case another part of the code is not coded correctly?
Basic example
A simple one, so I don't loose everybody :).
Let's say I'm writing an app that will display a person's information (name, address, etc.), the data being extracted from a database. L... |
Binary Search, as we all know requires the elements to be sorted. But we have to take care of unsorted elements too, in the worst case. If the input size is very large, is it a good idea to sort the elements everytime? Can we not just check the elements that they are not sorted or not and proceed to sorting and proceed... |
At the risk of being downvoted, I really need the community's input - I am helping put together a post-secondary quality curriculum (vocational school, not university) around open-source languages, specifically JavaScript and maybe some Ruby or PHP. There are some great trade books out there, but things get a little mo... |
Was research on how (for convetion) define a Many Many where table where both fields are primary key and found this post.
So decide to install the Iesi.Collections in my library domain.
But there came a doubt. In the "Iesi.Collections" outperforms "System.Collections" Iesi.Collections?
Why should I use?
It is better in... |
I've taken a software development role in an engineering company(all software developed is for internal use only). The company has about 60 individual programs from past developers. The problem is that all past developers are gone and no one knows why about half of the software was built, who uses it, or even what som... |
I'm currently writing an API and its documentation. For example I have something like this:
public interface Event {
}
public interface Process {
}
public interface EventProcessor {
/**
* Starts to process the sepcified event asynchronously. The returned
* {@link Process} can be used to track progress o... |
I am a little confused at how best to visually model a space-based architecture (SBA) for presenting the system/software architecture design to a client.
The goal of this modelling is to show:
The major components of the system (e.g.: databases, server exposed API, client, server workers, client exposed API)
Interact... |
I've read a lot o blogs arguing about private methods and testing. Some people say you should not test private methods, they say you should make them public or put those methods in a new class.
But then, what about encapsulation? let's say:
I have this method which is simple enough for not being part of a new class, a... |
In languages that don't allow underscores in integer literals, is it a good idea to create a constant for 1 billion? e.g. in C++:
size_t ONE_BILLION = 1000000000;
Certainly, we shouldn't create constants for small numbers like 100. But with 9 zeros, it's arguably easy to leave off a zero or add an extra one in code ... |
In any given class definition, I've seen the method definitions ordered in various ways: alphabetical, chronological based on most common usage, alphabetical grouped by visibility, alphabetical with getters and setters grouped together, etc. When I start writing a new class, I tend to just type everything in, then reor... |
In the current company that I work for there is a very large Utilities library. It was written a few years back (long before I joined) and has grown ergonomically over time to now do everything:
Sending Emails
Exporting Files in different formats, i.e. CSV, tab delimited
Receiving data from 3rd party providers, i.e. B... |
I'm creating a data transfer object and can't decide whether it would be better to just give public access to the instance variables or if there would be a purpose to using getters and setters to access the data?
According to the Data transfer object Wikipedia Article:
A DTO does not have any behavior except for sto... |
A certain failure of OOP is shown with a class Square inheriting from Rectangle, where logically Square is a specialization of Rectangle and should therefore inherit from it, but everything falls apart when you attempt to change a Square's length or width.
Is there a specific term for describing what is going wrong wit... |
I a little while ago I joined a new development team and recently we had our first major release. We've used Git since the beginning of the project and by now are somewhat comfortable with it. However, now that the product is in the field, we are discovering new issues/processes that need to be established. Up to this ... |
In Scala 2.10 a new string interpolator feature has been added (see here).
For example
val name = "James"
println(s"Hello, $name") // Hello, James
What is not clear to me is whether this feature is an ad-hoc addition or whether it is syntactic sugar for some other, more general construct.
The only thing I can think of... |
This might seem like an odd question, but I'm worried that I'm putting too many things as constants/finals at the top of my java class. I've started to put every value that is in my program into a constant (At least the ones that influence it's overall effect). The reason I'm doing it is because then it's easy to find ... |
I have an algorithms library called NDex. I am in the process of upgrading it to a new version. Part of this upgrade involves providing two versions of many algorithms: an in-place version and a version that copies the results to a destination list.
I will be providing two sort variations: quick sort and merge sort. Th... |
This seems to happen every time I create any sort of GUI. I have trouble figuring out how child classes should communicate to their siblings.
It's a general problem, but it's probably easier to use a concrete example (hopefully that's still okay for this forum? I know it's different from StackOverflow): I have a window... |
I'm using git for an iOS project, and so far have the following branch model:
feature_brach(usually multiple) -> development -> testing -> master
Feature-branches are short-lived, just used to add a feature or bug, then merged back in to development and deleted. Development is fairly stable, but not ready for product... |
Should classes, that modify the state of the parent class, but not itself, be unit tested separately? And by separately, I mean putting the test in the corresponding unit test class, that tests that specific class.
I'm developing a library based on chained methods, that return a new instance of a new type in most cases... |
I was asked whether I've ever "deployed to a physical machine" and I'm seeing this terminology when googling, but not getting a definition. What does it mean? What other way could someone deploy an application if not to a physical machine?
|
I've learned PHP, Java, and C. Now I'm curious as to why there are so many types of numerical data types like bit, int, float, double, and long. Why not make only one type for numericals?
Is there any benefit to this? Maybe if we use integers to hold such small numbers we can save memory?
|
A profesional developer Zed Shaw says this:
Which programming language you learn and use doesn't matter. Do not
get sucked into the religion surrounding programming languages as that
will only blind you to their true purpose of being your tool for doing
interesting things.
So, being neutral to languages is a si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.