instruction stringlengths 34 19.9k |
|---|
I have started using BDD for a WordPress plugin i'm working on and i'm rewriting the js codebase to do tests. I've encountered a few problems but i'm going steady now, i was wondering if i had the right approach, because i'm writing test that should pass in a normal browser environment and not inside WordPress.
I choos... |
My company has a very broad range of products and there are a few that are not strategic to us so I wanted to open source them (so we can focus on what makes us unique and open source the products that every firm has).
Our industry(hedgefund) does not open source(we would be the first firm to try this) and the feedback... |
I find I tend to need intermediate variables. In Clojure that's in the form of let bindings, like cmp-result-1 and cmp-result-2 in the following function.
(defn str-cmp
"Takes two strings and compares them. Returns the string if a match; and nil if not."
[str-1 str-2 start-pos substr-len]
(let [cmp-result-... |
I am working on a project that has around a hundred different files (.cpp & .h), and it requires around an hour to build the entire project on MSVC 2008, suppose that I now make a change to any one file, do I need to build the entire project once again, right from the beginning, or is there a way out ?
I know it is ver... |
One of the advantages of older version control systems such as CVS and SVN in enterprise development is that anyone can connect to source control and see all the projects that the company has. This can make it easier to get a high level view of what kid of development is happening outside your sprint and also keeps eve... |
We're considering hiring a contractor or intern to work with us on our iOS project but this causes me to get really paranoid that we're giving somebody who doesn't work for the company access to our precious codebase. I mean, I could just give them access to the classes I'd like them to work on but that seems rude and... |
Hi I'm intrested in using the apparently now defunct app-mdi libray in a flex application for a paying customer. http://sourceforge.net/projects/appmdi/
It appears that the app-mdi project has been forked from flex-mdi and indeed the code has so much in common it would appear almost identical to the origional code.
Now... |
I've really fallen in love with unit testing and TDD - I am test infected.
However, unit testing is normally used for public methods. Sometimes though I do have to test some assumptions-assertions in private methods too, because some of them are "dangerous" and refactoring can't help further. (I know, testing framewor... |
I am designing a simple logic analyzer, I know that the best way to decode a protocol like I2C, SPI, UART is whit something like an FPGA but I want to do it by software by now :) I am running on an OMAP4460 ARM proccesor.
I would like to know if there is an special way of decoding protocols like I2C, SPI, UART or it is... |
These days many apps support asynchronous updates. For example, if you're looking at a list of widgets and you delete one of them then rather than wait for the roundtrip to the server, the app can hide the one you deleted, giving immediate feedback. The actual deletion on the server will happen in the background. This ... |
Recently there has been a lot of praise for Node.js. I am not a developer that has had much exposure to network application. From my bare understanding of Nodes.js, its strength is: we have only one thread handling multiple connections, providing an event-based architecture.
However, for example in Java, I can crea... |
I am trying to figure out the right way to encapsulate graphical information about mathematical objects. It is not simple. For example, a matrix can include square brackets around its entries, or not. Some things carry down to sub-objects -- for example, a matrix might track the font size to be used by its entries. ... |
I forgot to write return 'a'; in the show function and return 0; in main function but it works fine in Code::Blocks.
#include <iostream>
using namespace std;
char show()
{
cout<<"this is show function"<<endl;
}
int main()
{
show();
}
I am using Code::Blocks 10.05 in Ubuntu 12.04.
Why does this code work fi... |
It's undefined because the it modifies x twice between sequence points. The standard says it's undefined, therefore it's undefined.
That much I know.
But why?
My understanding is that forbidding this allows compilers to optimize better. This could have made sense when C was invented, but now seems like a weak argument.... |
Any one ever heard of the term collapsed Backbone? Could it be a virtual network that could be referred also to this term.
|
I've been thinking a lot about language design and what elements would be necessary for an "ideal" programming language, and studying Google's Go has led me to question a lot of otherwise common knowledge.
Specifically, Go seems to have all of the interesting benefits from object oriented programming without actually h... |
I have an Array with 1,000,000 unsorted elements. I need to calculate expected number of operations that needs to be performed to sort array using Quicksort algorithm in common situations (not the n^2 worst case).
I am not sure how (n log n) is calculated - does it even makes sense to calculate this?
If (n log n) = (n... |
Most of the projects that I work on consider development and unit testing in isolation which makes writing unit tests at a later instance a nightmare. My objective is to keep testing in mind during the high level and low level design phases itself.
I want to know if there are any well defined design principles that pr... |
Lets say i have an off the shelf eccomerce cart. I put all the code inside subversion. I start to make changes and check the code changes back in.
is it possible to then display each "check in" with the developer messages so that i can make release notes?
I would like to use this for actual quoted time.
|
I'm looking for some guidance on how to architect an app with regards to modularity, separation of concerns and re-usability.
I'm working on an application (ASP.Net, C#) that has distinctly generic chunks of functionality, that I'd love to be able to lift out, all layers, into re-usable components. This means the modul... |
Iteration has already started, new programmer joins the team, task X has already been estimated to be 30 hours by a different developer.
What is the best practice in this situation?
new developer runs with the given estimate (the idea being that any discrepancy will be corrected for when velocity is calculated?)
new d... |
How do I configure Ninject so it injects an instance in a view model?
PS. It is an abstracted service to help with validation, so I am not trying to burden the model with too much responsibilities.
|
I have a list of users, with minions, something like this:
User52:
minion10
minion12
User32:
minion13
minion11
I've been keeping in an array where the "location" is the id, like this:
Users:
[52]User
minions:
[10]minion
[12]m... |
We currently have an application framework in which we automatically cache both entities and collections of entities at the business layer (using .NET cache). So the method GetWidget(int id) checks the cache using a key Widget_Id_{0} before hitting the database, and the method GetWidgetsByStatusId(int statusId) checks ... |
I have an application who has text fields (not select, not checkbox or other types) where an user can enter some value, like this:
ISBN and E-Mail are the label of each input.
Now I have to automatically test these inputs according to their label. The question is: how to recognize that, for example, the first input re... |
I'm attempting to drive my user interface (heavy on javascript) through selenium. I've already tested the rest of my ajax interaction with selenium successfully. However, this one particular method seems to be eluding me because I can't seem to fake the correct click event. I could solve this problem by simply waiti... |
I need to write an algorithm in java (for an android app) to read a folder containing more folders and each of those containing images and audio files so the structure is this: mainDir/subfolders/myFile1.jpg
It must be in java, something like perl script is not an option. It would preferably be for the compressed arch... |
In my experience, most teams in the company review the code of team member with a small amount
of code, always less than hundreds of lines. Is it appropriate to review large amount of code, for example a module, when the code is complete and ready to get reviewed once for all?
|
I want to build a desktop application which has google maps embedded to it. This app should have a thread to read coordinate data online a usb microphone to use. This application will move the google map markers to their new locations based on the data retrieved from online connections on each refresh.
As far as I know... |
There is a project on Github that I mostly like and want to use. There are a few things I want to do differently/remove that doesn't make sense for what I want/need. Also I want to add a few things as well.
As I understand it, I should fork the project and I can make whatever changes I want and push back to my fork. Fr... |
I'm developing an application that has methods of this kind:
attackIfIsFar();
protectIfIsNear();
helpAfterDeadOf();
helpBeforeAttackOf();
etc.
The initialization of my application for n players is something like
player1.attackIfIsFar(player2);
player2.protectIfIsNear(player4);
player3.helpAfterDeadOf(player1);
player4... |
Even languages where you have explicit pointer manipulation like C it's always passed by value (you can pass them by reference but that's not the default behavior).
What is the benefit of this, why are so many languages passed by values and why are others passed by reference ? (I understand Haskell is passed by refere... |
The Apache License, v2.0
[..]
2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perf... |
I read this Gawker article about how a writer reused some of his older material for new assignments for different magazines.
Is there any similar ethical (societal?) dilemma when doing the same thing in the realm of Programming? Does reusing a shared library you've accumulated over the years amount to self-plagarizm?... |
Lets say you have a code promotion hierarchy consisting of several environments, (the polar end) two of which are development (dev) and production (prod).
Lets say you also have a web application where important (but not developer controlled) files are created (and perhaps altered) in the production environment.
Lets... |
I'm working on an application in which I'm looking to employ the MVC pattern, but I've come up against a design decision point I could use some help with.
My application is going to deal with the design of state-machines. Currently the MVC model holds information about the machine's states, inputs, outputs, etc. The vi... |
The reason for doing it is to solve the case when a newer API is no longer backwards compatible with an older API.
To explain, just say that there is an old API v1.0. The maker of this API decides it is broken and works on a new API v1.1 that intentionally breaks compatibility with the old API v1.0. Now, any programs w... |
So recently, we've just finished the first phase of our project.
We used agile with fortnightly sprints. And whilst the application turned out well, we're now turning our eyes on some of the maintenance tasks.
One maintenance task is that all of our documentation appears in the form of specs. These specs describe 1 or... |
Are there any standards for preparing a user manual of electronic device?
I am trying to prepare a manual for a device. However, I could not find any format. If I find, I will take this as guide for me.
If there is no standard, what should be in the manual or what should not be in?
|
I am looking at a new position with a new company. I have talked to some people in the past (in general, not at this company) that they had been given a yearly budget to buy new computer stuff to keep up to date.
Now why I feel this question is worth asking here is that Joel comes right out and says an employer should... |
I am developing software for communication with external device through serial port. To better understand the new functionality I am trying to display it in sequence diagram. Flow of events is as follows. I send to the device command to reset it. This is asynchronous operation so there is some delay between request and... |
I recently came across this question: "You are given a boolean expression consisting of a string of the symbols 'true', 'false', 'and', 'or', and 'xor'. Count the number of ways to parenthesize the expression such that it will evaluate to true. For example, there are two ways to parenthesize 'true and false xor true' s... |
A project has recently come to my attention, but I have no idea where to start or even if it's possible. The idea revolves around programming a clock that is displayed in a digital photo frame. The user would then be able to put different pictures corresponding to different times inside a USB pen, for example, which wo... |
Possible Duplicate:
What is REST (in simple English)
What does RESTful web applications mean?
A web service is a function that can be accessed by other programs over the web (Http). To clarify a bit, when you create a website in PHP that outputs HTML its target is the browser and by extension the human being reading... |
What is the difference between Object Oriented Design Patterns and Principles? Are they different things? As far as I understood both of them try to achieve some common goal (e,g. flexibility). So can I say a pattern is a principle and vice versa?
Design Principle = SOLID (i.e. Dependency Inversion Principle)
Design Pa... |
We currently store points as three floats (lat,lon,alt) and support only one type of query (points within a given radius) but look forward to support more queries. We are using PHP and MySQL.
What are the benefits of using geospatial types?
|
^ For actual questions, skip to the lists down below
I understand, that his is a vague topic, but please, before you turn the other way and disregard me, hear me out. I am currently doing research for a web application(I don't know if application is the correct word for it, but I will proceed w/ that for now), that one... |
I'm trying to figure out what the benefit to having a WYSIWYG HTML editor over hard coding, outside of, say, accessibility. It seems like a waste of time to learn how to use something like Dreamweaver over Notepad++. Am I missing something here? Every time I've ever used one, I end up going back into the code to fix... |
We are working with a group of developers on a project. The project is still in progress (not completed) and these developers charge us for time spent on fixing bugs on codes that were not written valid in the first place. I understand that we should pay for changes/new requests if any, but not bugs fixes for a work in... |
Possible Duplicate:
Should I use one database per application or share a single database amongst multiple applications
We have a bunch of small to medium sized apps, each of which has its own database (MSSQL Server). There was a suggestion that we consoldate the 'related' databases into a smaller set amount of large... |
I can list part of the problems that will show up when writing a moderately-sized concurrent application with shared memory:
Locking granularity
Choice of synchronization primitive
Number of threads
Method for decomposing into threads (data parallelism; task parallelism; how threads are organized, etc)
What are other... |
Lately I've been working a lot in PHP and have run into an abnormally large number of parsing errors. I realize these are my own fault and a result of sloppy initial coding on my part, but it's getting to the point that I'm spending more time resolving tags than developing. In the interest of not slamming my producti... |
I just wanted to ask for your opinion on a situation that occurs sometimes and which I don't know what would be the most elegant way to solve it.
Here it goes:
We have module A which reads an entry from a database and sends a request to module B containing ONLY the information from the entry module B would need to acco... |
All the languages I know of would execute something like:
i = 0
while i < 100000000
i += 1
..and you can see it take a noticeable amount of time to execute.
Why though, do languages do this? The only effect this code will have is taking time.
edit: I mean inside a function which is called
function main(){
us... |
My company is evaluating adopting off-the-shelf ALM products to aid in our development lifecycle; we currently use our own homegrown solutions to manage requirements gathering, specification documentation, testing, etc. One of the issues I am having is understanding how to move code between stages of development. We ha... |
Say I have a large function like the following:
function do_lots_of_stuff(){
{ //subpart 1
...
}
...
{ //subpart N
...
}
}
a common pattern is to decompose it into subfunctions
function do_lots_of_stuff(){
subpart_1(...)
subpart_2(...)
...
subpart_N(...)
}
I usually ... |
I am learning Objective-C and iOS development and not sure what proper naming convention should be used. I understand how to use the label aspect of Obj-C methods but not the proper way to name each label. What is the best practice for naming methods, properties, objects, outlets, and actions?
Also,
Should different na... |
William Cook in a tweet wrote that:
"UML is the worst thing to ever happen to MDD. Fortunately many people now realize this ..."
I would like to know the reasoning behind that claim (apparently, I'm not referring to his personal opinion).
I've noticed that many people out there don't like UML that much. Also it is wo... |
I have made a product which I have used the GPL licence, and am now getting pull requests from other authors.
The product also has a less restrictive commercial license available for purchase.
Can I include the submitted code with the commercial licensed product?
|
I am a front-end developer. For many experiements I do I need to have a server that talks JSON with my client side app. Normally that server is a simple server that response to my POSTs and GETs.
For example I need to setup a server that saves, modifies and read data from a "library" database like this:
POST /books c... |
I have a list of Students that I should display to user on a web page in tabular format.
The items are stored in DB along with SortOrder information.
On the web page, user can rearrange the list order by dragging and dropping the items to their desired sort order, similar to this post.
Below is a screenshot of my te... |
I have always applied constraints at the database level in addition to my (ActiveRecord) models. But I've been wondering if this is really required?
A little background
I recently had to unit test a basic automated timestamp generation method for a model. Normally, the test would create an instance of the model and sav... |
Can the Turing machine be classified e.g. as a Mealy machine? Why not? Can a Turing machine be input to another Turing machine without complication like halting problems?
Thanks
|
I'm lately working on a few mobile web apps for Android (2.3+) and iOS (4+). Their browsers support most of ECMAScript5, which is very powerful, and I wanted to use language features where possible, resorting to jQuery only when I had to.
Turns out the only thing I use jQuery for is to have a shorter alternative for do... |
A co-worker and I were looking at the behavior of the new keyword in C# as it applies to the concept of hiding. From the documentation:
Use the new modifier to explicitly hide a member inherited from a base
class. To hide an inherited member, declare it in the derived class
using the same name, and modify it with... |
So far I have been using either handmade or generated (e.g. JAXB) Java objects as 'carriers' for messages in message processing software such as protocol converters. This often leads to tedious programming, such as copying/converting data from one system's message object to an instance of another's system message objec... |
I'm currently trying to come up with a database migrations strategy for my organization. This includes getting the database scripts into source control, managing versioning, managing releases to QA / Production, managing branching and merging across different release branches, etc.
Ruby Migrations seems to offer solut... |
I've read about DDD for days now and need help with this sample design. All the rules of DDD make me very confused to how I'm supposed to build anything at all when domain objects are not allowed to show methods to the application layer; where else to orchestrate behaviour? Repositories are not allowed to be injected i... |
I'm thinking of applying Reflective Practice to improving my programming skills. To that end, I want to be able to watch myself writing code.
In general, what is a good method for applying Reflective Practice to the craft of programming?
In particular, if it's a good idea, is there an editor that records keystrokes t... |
I asked a question on SO, and found that there are no non-blocking ORMs for my favorite web framework. By non-blocking I mean an ORM with callback support for asynchronous retrieval. The ORM would be supplied with a callback or some such to execute when data has been received.
I want to create one, but I have some qu... |
I am preparing for a programming contest where we have to code in C++ and it is all about producing working code in a short time. An example would be to use a macro to get the minimum of two ints or using memsets to initialize arrays (but I was told that you shouldn't use either here).
This leads to the question, what ... |
Edit: Thanks for all of the answers, guys! I think I'm just going to include some kind of text on my webpage telling users to only download from the links provided. The thing is that there have been some legitimate and illegitimate websites that have picked up on my software, so it would be safer just to tell users to ... |
How do you manage two-way synchronization between a 'main' database server and many 'secondary' servers, in particular conflict resolution, assuming a connection is not always available?
For example, I have a mobile app that uses CoreData as the 'database' on the iOS and I'd like to allow users to edit the contents wit... |
Hi I am an intern working with ASP.NET.
My current task is to make a website which will incorporate some jquery viewing features. This project seems to me will be primarily dealing with reading data from a database and making graphs out of them. This will require me to make custom queries from whatever the client is lo... |
I'm curious if my current experiences as an intern are representative of actual industry.
As background, I'm through the better part of two computing majors and a math major at a major university; I've aced every class and adored all of them, so I'd like to think that I'm not terrible at programming. I got an internshi... |
There are a lot of manuals. I am trying to create an database to hold information of these documents. But, there is a small problem.
How can I give meaningful id to the manuals? Are there any standard or logic behind the giving meaningful id to the documents? If there is no standard, can you tell me how I should do tha... |
I was reading this question on SO which discusses some common undefined behavior in C++, and I wondered: does Java also have undefined behaviour?
If that is the case, then what are some common causes of undefined behaviour in Java?
If not, then which features of Java make it free from such behaviours and why haven't ... |
Good day folks.
I am very confused in this situation. I need to implement system which will be based on HP open view service desk 4.5 api. But this system are reached the end of supporting period. On oficial site no information available
I am looking an information about this API(articles, samples etc). Now i have only... |
Lately I've become more and more frustrated that in most modern programming languages I've worked with (C/C++, C#, F#, Ruby, Python, JS and more) there is very little, if any, language support for determining what a subroutine will actually do.
Consider the following simple pseudo-code:
var x = DoSomethingWith(y);
How... |
I was doing a presentation on F# and was discussing the Option type when someone in the audience asked me if the Option type is F#'s implementation of the maybe monad. I know that's not the case but I did want to ask how the two concepts are related. I mean it seems to me that an option type might be the result of th... |
I'm attempting to understand how "switch as a code smell" applies when the proper code path is determined by some observable piece of data.
My Webapp object sets an internal "host" object based on the hostname of the current request. Each Host subclass corresponds to one possible hostname and application configuration:... |
Yesterday, Twitter was hit with a "Cascading Bug" as described in this blog post:
A “cascading bug” is a bug with an effect that isn’t confined to a particular software element, but rather its effect “cascades” into other elements as well.
I've seen this kind of bug, on a smaller scale of course, on some projects I'... |
I'm learning how to build parsers using grammars, but I got stuck trying to express comments, because they can appear almost anywhere.
This indicates that comments can be stripped from the token stream before parsing takes place.
Is that the standard practice, or are comments ever/often specified in grammars?
|
Given an array of integers A[1...n-1] where 'N' is the length of
array A[ ]. Construct an array B such that B[i] = min(A[i], A[i+1],
..., A[i+K-1]), where K will be given.
Array B will have N-K+1 elements.
We can solve the problem using min-heaps
Construct min-heap for k elements - O(k)
For every next element de... |
I have been using SCRUM in three different projects over the last four years. One of SCRUM's advantages seems to be its flexibility and adaptability, e.g. wrt to changing customer requirements. Another advantage is that management can easily track the progress of a project.
SCRUM's flexibility can be an advantage e.g. ... |
We have REST webservices that can serve XML or JSON (WCF). I'm toying with idea of implementing Protobufs. Why?
PROS
Less load on servers.
Smaller message size - less traffic.
It is easier to switch now than later.
CONS
Need to be implemented
Going to be harder to troubleshoot/sniff messages for debugging.
I can en... |
I'm teaching CS2 (Java and data structures), and am having some difficulty coming up with good examples to use when teaching queues. The two major applications I use them for are multithreaded message passing (but MT programming is out of scope for the course), and BFS-style algorithms (and I won't be covering graphs u... |
What I have: 1 hypothetical object/class + other classes and related methods that gives me functionality.
What I want:
linking this object to 0 to N methods in realtime on request when an event is triggered
Each event is related to a single method or a class, so a single event does not necessarily mean "connect this 1... |
Is it acceptable to return a non-zero exit code if the program in question ran properly? For example, say I have a simple program that (only) does the following:
Program takes N arguments. It returns an exit code of min(N, 255). Note that any N is valid for the program.
A more realistic program might return different c... |
I spoke with a guy who claimed that he's working (programming) on a GPS-system that is going to be accurate to the centimeter.
Is this even possible?
What is the limiting factor, the big distance between the satellite and the GPS, or is it the software?
Can the software be improved to make a GPS accurate to centime... |
I have created a .net windows form application that I want to restrict from being duplicated. I want this application to be portable, so I would like to allow it to be moved. How would I be able to do this without managing it through a remote server?
|
I have a situation where objects are created at unpredictable times. Some of these objects are created before an important event, some after. If the event already happened, I make the object execute stuff right away. If the event is forthcoming, I make the object observe the event. When the event triggers, the object i... |
I was reading this excellent blog article regarding speeding up the badge page and in the last comment the author waffles (a.k.a Sam Saffron) mentions these tools:
dapper and a bunch of custom helpers like rainbow, sql builder etc
Dapper and sql builder was easy to look up but rainbow keeps pointing me to a CMS, can... |
Edit:
To avoid further confusion: I am not talking about web services and such. I am talking about structuring applications internally, it's not about how computers communicate. It's about programming languages, compilers and how the imperative programming paradigm is extended.
Original:
In the imperative programming f... |
I'm currently evaluating a potential new project that involves creating a DB for typical customer information (userid, pwd, first & last name, email, adress, telfnr ...). At this point, requirements are only roughly defined.
The customer DB is expected in the O(millions) of records. In order to calculate some back-of-t... |
I am in the process of working on a video on demand system part of it involves the management of a hierarchical tree structure (think windows explorer) which allows users to upload videos, move folders around, create new folders etc. User action will be allowed depending on which permissions they have.
In addition to m... |
The Golang "netchan" package seems to have been discontinued.
That makes me think that the concept of "networked channels" were not a good practice after all. (Why wouldn't them just "let it be" otherwise?)
Is this the case? And if it is, why is that?
|
Just a random question regarding switch case efficiency in case after case; is the following code (assume pseudo code):
function bool isValid(String myString){
switch(myString){
case "stringA":
case "stringB":
case "stringC":
return true;
default:
return false;
}
more efficient than this:
fu... |
I'm starting with a short introduction of what I know from the C language:
a pointer is a type that stores an adress or a NULL
the * operator reads the left value of the variable on its right and use this value as address and reads the value of the variable at that address
the & operator generate a pointer to the vari... |
I'm creating a Ruby game using the Gosu framework. All good.
Sometimes, when I run the game, it has some kind of slow startup, and probably it will be rather slow during the whole game. So I close it and... open it again. It is very likely that it will startup quickly and the whole game will run smoothly and fast.
Why ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.