instruction stringlengths 34 36.1k |
|---|
How does one do unit testing for multiple environments that behave differently?
Here is my problem. I have a PHP class for which I'd like to create unit tests. The class provides shortcuts for manipulating folders. On Linux, you can set the folder permissions without a problem, on Windows, you can't at all.
Knowing th... |
As nowadays SAAS is becoming popular way of developing and deploying the applications, and I have just started working at a company providing SaaS solution for payment authorization services.
Since past few days, I have been thinking what would happen if some "unsatisfied / angry" developer write a malicious code (lets... |
First off, I'm not looking for this answer: "learn PHP/MySQL, JQuery, HTML/CSS...."
My background, I wear many hats, and do many things. Currently I manage investment accounts with a business partner who is also a friend. He happens to be attending business / law school perusing a joint JD and MBA. As a result, we're p... |
I know PHP and Ruby.
Using a PHP Rails clone (not out of choice), called Symfony, (which is apparently the best PHP framework), I notice that it's a clone of Rails. I think Symfony is stupid and that (SensioLabs is a clever business) because Rails already exists.
Apart from open-source projects gaining money, I don't... |
Javascript has a feature called Automatic Semicolon Insertion where basically if the parser encounters an invalid token, and the last token before that was a line break, then the parser will insert a semicolon where the linebreak is. This enables you to basically write all your javascript code without semicolons, but y... |
Do people still use Ada -- (it was mostly used in the Defense Department)
Are all applications written in Ada "Legacy"?
Does Ada knowledge still sell
|
I have a wording / precision question. Sometimes I write "object instance" sometimes "class instance".
Isn't it that an object is always an instance of a class? Therefore "object instance" is not the correct wording, right?
Is it common to say so anyway, or just a "mistake" of mine? I have the feeling "object instance"... |
Why does the Lisp community prefer to accumulate all the parentheses at the end of the function:
(defn defer-expensive [cheap expensive]
(if-let [good-enough (force cheap)]
good-enough
(force expensive)))
Why not employ a convention like C or Java?
Well ok, Lisp is much more older than those languages, but ... |
Object Literal has no doubt been established in recent years as one of the essential components to best JavaScript coding practices. However, I am not very sure about what is the best way to structure my codes using Object Literal.
It has been suggested earlier before that Module Pattern might be a good technique to st... |
Can someone explain the concrete reasons why BDFL choose to make Python lambdas single line?
This is good:
lambda x: x**x
This results in an error:
lambda x:
x**x
I understand that making lambda multi-line would somehow "disturb" the normal indentation rules and would require adding more exceptions, but isn't tha... |
Inheritance, Polymorphism, and Encapsulation are the three most distinct, important features of OOP, and from them, inheritance has a high usage statistics these days.
I'm learning JavaScript, and here, they all say that it has prototypal inheritance, and people everywhere say that it's something far different from cla... |
I want to make a thick-client, desktop, open source twitter client. I happen to be using .NET as my language and Twitterizer as my OAuth/Twitter wrapper, and my app will likely be released as open source.
To get an OAuth token, four pieces of information are required:
Access Token (twitter user name)
Access Secret (tw... |
Suppose you want to create a web page with some search capabilities over a database. Search has to be restricted both on some categorization of data and open text given by the users. Functional and non-functional requirements pose this constraints:
Search has to be fast
Data representation paradigm (i.e. Relational, O... |
I frequently see code like that:
$("#foo").live("mouseover mouseout", function(e) {
if (e.type == "mouseover") {
$("#foo").append("<div id='bar'>");
} else {
$("#bar").remove();
}
});
instead of more self-explanatory in my opinion:
$("#foo").live("mouseover", function(e) {
$("#foo").app... |
I have a BSc in Geology. Once I was half-way through my bachelors only, I found where my real talents are. Will my basic degree be a problem for me to progress in the Software field (I feel lot of leading companies are considering the basic degree)? Also what would you recommend to put my self in an equally competent p... |
When looking through job postings I noticed some employers listing MCSD or MCAD certifications. Are these certifications correct ones for web developers? Which track should one choose?. I also noticed looking at MCSD that most certifications are "retired". So how are suppose to take the exam it it's no longer offered??... |
I am working over a OCR Application where I need to select a option based on user text input.
Ex:
Available Options:
["python", "ruby", "java", "clojure", "haskell"]
Input: kava
Output: java
Input: ruby
Output: ruby
Input: clujuro
Output: clojure
etc..
my application is python based, is there a algorithm already ... |
I am building a website that will allow companies to sign up and post information and have an internal network, but what is the best way to verify that the person that is filling in the sign up form really belongs to the company they say they do, as I don't want Joe Bloggs signing up saying he works for company XYZ whe... |
I want to use design patterns for the following scenario. How to?
I have classes named Person, Employee and Customer and all of them have their own save, update, get and delete methods. Employee and Customer classes are derived from person.
What may be the best way to code?
|
Long time user of SO, and figured this is the best place to ask this question.
I am currently consolidating our eCommerce payment clearing systems into one Asp.Net MVC website that will work like PayPal but for our own websites.
The businesses within the group have different rules as to the payment provider that is to ... |
In a company I used to work for, executives insisted that the code coverage with unit tests must be 99% or more. This resulted in writing more tests than code. It took us literally 3 days to write tests for a single class that took a day to implement.
As a result, however, I learnt a lot about TDD, testing tools, pract... |
Big O notation provides an upper bound to a function whereas Big Theta provides a tight bound. However I find that Big O notation is typically (and informally) taught and used when they really mean Big Theta.
e.g. "Quicksort is O(N^2)" can turned into the much stronger statement "Quicksort is Θ(N^2)"
While usage of Big... |
My understanding of the duties of the scrum master are as follows:
Enforce the process
Remove impediments (that the developers cannot remove themselves)
Prevent interruption from outside
Facilitate scrum meetings (stand up, retrospective, etc.)
If the developers on the team are disciplined, they will follow the proce... |
We need to create an API to our system. How do I convince my boss that REST is a better option than SOAP (or XML-RPC)?
I say REST is...
easier to implement and maintain
not much new to learn -- plain old HTTP
lot of people have chosen it Yahoo ~ Facebook ~ Twitter
will be lot quicker to code
My boss says SOAP is...
... |
I have the following problem: I'm developing a software for data visualization where I get a graph structure and represent it in 3D space. So far, I've been using force-based algorithms to draw graphs and it worked well, until I got requirement that my software should represent very big number of vertices and edges (fe... |
When Microsoft presented .NET Framework and C# language in 2002, what was the first article to introduce C#?
I'm looking for some paper published on MSDN or Microsoft website that would explain the need for another language, talk some background and maybe have some code samples.
Also, I'm interested in the original C# ... |
I have a series of method calls that all share similar qualities. The basic layout is
public void CallDataBase()
{
Utility sqlHelper = new Utility();
StringBuilder query = new StringBuilder(200);
query.Append(@"update " + Environment.NewLine);//or insert, select
query.Append(@" table " + Environment.Ne... |
Can someone explain AOP concepts for dummies: join point, point cut, weaving etc.
For example: Aspect: a modularization of a concern that cuts across multiple classes. What does that mean?
|
I recently asked a question on Stack Overflow to find out why isset() was faster than strlen() in PHP. This raised questions around the importance of readable code and whether performance improvements of micro-seconds in code were worth even considering.
My father is a retired programmer, and I showed him the response... |
New to the site so sorry if this is the wrong section.
I'm starting app development and wondering what is the best practice when initially releasing my app. Do developers tend to keep some of the features for future updates to keep users active, or do they try to release the most complete app possible?
Basically, is it... |
Currently I'm trying to select the best DB paradigm to implement a web site with full-text search and faceted search capabilities. I have an important functional requirement:
The database paradigm should support strong conceptual schema modifications during every part of software lifetime.
As a example, our business c... |
At the end of the month, I have to give a presentation on a software project that I've been working on by myself that will basically decide whether or not I will get a full-time job at the company I'm a temporary hire for now. I will be giving my presentation to the president of our department, and two VP's. The presi... |
Possible Duplicate:
How do I adapt to pre-interview challenge questions?
InterviewStreet is a new company that essentially acts as a filter for companies to find programmers that can code. My problem is my math is fairly weak and I'd like to study it, even if it's from the ground up, to be able to solve questions su... |
As the title says, I am a recent graduate with a mathematics degree, looking to develop software as a career. The job hunting has not resulted in a job yet but over the past couple of months I have picked up quite a bit of Ruby/Rails and Objective-C, as well as learning git and deployed a simple web-app to Heroku.
I w... |
Question: For a public facing web API(send HTTP Get/Post requests, get JSON/XML data back), how should parameters be handled that are either misspelled or are extra.
It seems to me that if the incorrect parameters are ignored, an error in the caller's code may go unnoticed since they would be getting back a valid resul... |
I have read a bit about the actor model, but don't really understand how to use actors in a real world situation – how to model a problem with them.
Can someone please explain? A simple example or links to examples would be much appreciated.
|
If a client requests that a particular feature is added into their website software, who is responsible for searching and recognising that a patent royalty has to paid?
client
web developer
This question is aimed at freelance web developers.
When a client says (for example) add a shopping cart to my site. This is a r... |
I have read the Wikipedia article on Indent Styles, but I still don't understand. What is the difference between K&R and 1TBS?
|
I'm in the process of putting the final touches on an open-source framework that I hope to release in the next few months. It's something that I'd like to develop a community for and so I'm curious about what factors influence your decision to use a new framework or tool and why.
Some of the specific things I'd like t... |
I've been in my current position for a long time (10 years) and in that time, I feel like I've performed well as a designer, system architect, and programmer. However, all that work has been on internal projects that aren't accessible from the outside world.
I see a lot of advice like this that suggests 'If you can li... |
Can you explain to me why the friend keyword is preferred for giving access rights to private data of class?
|
I don't see much of a difference between the concerns of exception handling and logging in that both are cross cutting concerns. What do you think? Shouldn't it be handled separately on its own rather than interleaved with the core logic a method is implementing?
EDIT: What I am trying to say, is that in my opinion a m... |
I see constant references to the " Way," such as descriptions of a particular framework or application as "Pythonic," a certain person as a "Perl hacker," or "true Ruby code," but where are the "PHP hackers," the "PHP-ic" applications, the "true PHP style"?
This made me think - does PHP even have a definite style? Sayi... |
I've heard the person at the keyboard named the "driver", and the other person named the "navigator". I've imagined rally car racers, where the person at the wheel just cannot keep up with everything that's happening, and they must have the help of the "navigator", who's shouting volumes and volumes of directions at t... |
I wanted to learn object oriented programming language, I don't want it for any purpose just to know the whole concept of OOP.
So can anyone tell me which language I should start learning?
|
People say definition is used when the declared stuff has some memory allocated.
If I declare a class
class fish
{
char* name;
int type;
//someting i dont know about fish
};
int main()
{
fish a;
return 0;
}
Should it mean this is a declared fish or a defined fish ?
Let me try first!
it is called a define... |
Specifically what are some examples of where ideas of the masses where just wrong. Why did people latch onto the ideas in the first place? And why were the ideas dismissed? Or perhaps the ideas are still alive and well and if so why?
For example I might describe CORBA (and other similar technologies) as something that ... |
Can anyone point me to an article or an informed discussion about US software patents affecting a non-US company who is selling their products on an American app store/marketplace?
My company has several products on both Apple's App Store and Android's Marketplace, all of which are available for sale in the US. We are ... |
I like to keep my code testable and have decided to go with the Dependency-Injection strategy for my current MVC framework, which definitely has proven to be a great way to ensure loosely coupled code, testability and modularity.
But as being far from a master at Design patterns, I have a hard time of figuring out a g... |
As far as programming languages go, I love C#, and for that matter all the good that comes from the .net framework (LINQ, etc).
My main concern is I seem to be churning out too much code, and using OOP, I have a concern my code isn't always that easy to manage.
I want to continue using C# and .Net, but are there any ... |
I've seen projects that use N-tier with WCF. When creating a WCF project in the solution it is often named with the word "service?"
The main questions:
Why and what benefit do you have when using WCF in relation to N-tier?
Which situation should be used with WCF and N-tier?
|
I used to commit files which I want to group. But one of my colleague said that committing whole working project is better than committing files. I think it makes sense but if I commit like that sometimes I have to commit several different works at once.
What is the best practice to commit?
|
We are using Tornado for our system (behind nginx) -- and everything is working fine.
Now we need to integrate a client lib (for Neo4j Graph DB) into our system. The problem is that it is blocking.
My question is:
is it OK to use blocking libs in non-blocking environment
what are the possible ramifications if we do so... |
I'm working on an MVC application and am wondering about the best way to design one of my models.
I have a class called RightLeftPersonToggle which represents two select list boxes on the page. The user is able to move "persons" between the left and right box using buttons between them.
This class can represent both ... |
C\C++ specifications leave out a large number of behaviors open for compilers to implement in their own way. There are a number of questions that always keep getting asked here about the same and we have some excellent posts about it:
https://stackoverflow.com/questions/367633/what-are-all-the-common-undefined-behavio... |
I'm deciding which I need for my new LOB application. I will list PRO's of each and if I'm wrong - correct me please as this is how I see it.
In Browser
Users can navigate using URL's. I see it as a BIG thing. Users can share links like app.com/orders/12345
With elevated permissions I can do all the same stuff. Use C... |
I'm hosting a solution that serves as a web tier on a Ubuntu machine running Apache and Mono. I'm currently developing the project on OSX, using Mono. I understand there is no native support for Linq to SQL in Mono, so I've been going old school and developing stored procedures for my database interaction. I use ADO... |
Sometimes we change user story scope to complete it during the iteration. For example,
Original story (8 points): As a user i want to save my data as PDF.
De-Scoped story: As a user i want to save my text data as PDF.
Now do i need to decrease the size of the de-scoped story as well?
EDIT
What do you do in such cases ... |
We've had a long living product for about 8 years now. Over time, the names of concepts and entities change. Should we put the work in to rename all the code base and database tables and columns to match these new names?
Is there a study made on this or some best practices published?
Thanks
|
Do I understand it right that classical TDD is just about unit tests? Don't understand me wrong: I know the difference between TDD and just unit testing. I am asking whether it is correct to use integration test in TDD workflow.
Currently I work on the project where TDD is surely only about unit tests and there is at l... |
Git and Mercurial follow similar models and have similar terminology. Mercurial's initial release was was only 12 days after Git's. How did these two projects, in initial development at the same time, end up so similar? Does anyone know the history?
|
Recently, I was a part of a discussion about which criteria should be used when determining a salary for a programmer: arguments varied from "it is a matter of employer's choice" to other arguments that took into account one's education, experience, understanding of technologies, etc. Not so long ago, I read a great po... |
In a recent video on Java, Joshua Bloch states at 4 minutes 20 seconds into the video:
And then there's inheritance, and that was a marketing necessity. You know, we can argue whether you really need implementation inheritance or not.
So I wondered: how would Java look like without implementation inheritance? For exa... |
I work as a rental agent / manager for a car rental company that is running on a rental system that was written in 1972. I decided that maybe it was time for an update. For a bit of background, here is a short example of the madness that we have to deal with from this program daily:
A rental agent must remember that pr... |
Possible Duplicate:
Prototyping vs. Clean Code at the early stages
I'm right in front of a difficult decision.
I have a problem in my codebase (it's in C++), which I could solve in two ways:
A) Add one line of code
B) Rewrite ~7500 lines of code, adding roughly 1000 for an additional messaging switchboard class
No... |
Many times throughout writing larger programs I have questioned after how many copy and pastes does it make sense to put the code into a function or method and what is a good rule of thumb?
I have been using a rule of thumb of four lines or greater and appearing more then twice, then I make a simple function / method c... |
I'm working on an internal company application(not built on Wordpress) that needs to have shortcode functionality similar to Wordpress (http://codex.wordpress.org/Shortcode_API). Wordpress has a bunch of functions relating to handling short codes but the ones I was looking at were just the ones that handled the regex ... |
I'm interested in setting up Lazy Registration on my website.
Ideally, I'd like people to be able to fill out a record that might include their name, email, address, etc. and then record it to a user record later.
The problem is, sometimes the person filling out that form will already have a record on the site. At that... |
I am learning Java and I was wondering about when it would be best for me to try to develop something for Android? I have two specific concerns.
1.How is the Android API different from the main Java API? Are they similar or radically different?
2.I have heard that you need to make multiple versions of a given applicati... |
Long story short, I'm president of a programming club at my university. We're all 1st and 2nd year programming students. We have a project we're about to start working on (converting a console program to a gui program, in c#). Only two of us have any experience working with winforms and event driven programming in gene... |
I want to know, how important is it to program in your spare time? Is it necessary to work your 9-5 as a programmer and then get home and work on your hobby to become a better programmer?
This said, I know you only get better at programming by, well, programming.
Do prospective employers take hobby programming into ac... |
HTTP redirects are done via HTTP codes 301, and 302 (maybe other codes also) and a header field known as "Location" which has the address of the new place to go. However, browsers always send a "GET" request to that URL.
However, many times you need to redirect your user to another domain via POST (bank payments for e... |
I am looking for statistics concerning the distribution of programming languages in the embedded sector. Do you know any good websites, articles or books?
I found this as a first reference but am still looking for further information:
http://www.eetimes.com/electronics-blogs/industrial-control-designline-blog/4027479/R... |
We have to organize a very long list of manually running tests. Currently we use Word documents, print them out check them off etc. Ugh-ly but works, with problems.
Problems with the current solution
Requesting and executing subsets, depending on the actual changes. (i.e. tests 153, 155-157 and 24325 need to run only ... |
just because i think we are not using the full potential of all possibilites here yet:
What Pre/Post Commit Hooks (i.e. PHPUnit, PHPDoc) do you people use on your Team Git/SVN Servers?
By now we do use a minification script (sadly only removes unneccessary space and comments and merges files), PHPDoc, PHPUnit and that'... |
I'm writing unit tests for a steering system for a video game. The system has several behaviours (avoid this area because of reason A, avoid this area because of reason B, each adding a bit of context to a map of the region. A separate function then parses the map and produces a desired movement.
I'm having trouble dec... |
In a fairly complicated web application, there are almost hundreds of redirecting to another page, or linking to another page, etc. Imagine that you have a page called /services/users/register-new-user and in many places you want to redirect users to this page, or you want to provide links to this page. However, if for... |
Overheard at the watercooler yesterday: "Scrum has no place in defense contracting."
I tend to disagree in the sense that I believe Scrum can be tailored to work in many scenarios and I can see defense being one of them. This sparked a huge debate amongst my colleagues (many of us work in defense contracting) with a... |
Possible Duplicates:
MonoTouch vs Objective-C for iPhone/iPod/iPad development
As a C# developer, would you learn Java to develop for Android or use MonoDroid instead?
I'm very curious about the tools named MonoTouch and MonoDroid to create applications for Android, iPhone and iPod by using c# code.
Question:
Are th... |
For various reasons I need to supply "proof" my company's lawyer that I implemented a feature by a certain date. I have used source control since the late 90s and even the oldest databases are still working. I also have the all the old setups. Our release notes are not always as clear as they could be and most of them ... |
A week ago I asked the question; First big project, how to get started. Make menus, save to harddrive etc. I tried to do everything without doing a GUI with Swing but I realized that for every view I wanted to present to the user I had to make a new class. Right now I have 3 menu classes (the mainMenu, computerCategory... |
Since the beginning of the Javascript race -- which I would situate around Google Chrome launch in 2008 -- the improvement in the Javascript engine performances have been impressive.
The web is crowded with comparisons such as "Firefox V3.42.7 vs. Safari 3.0-prealpha2", and the winner of those comparisons changes every... |
In C and C++ (and I guess other languages that allow taking a "reference" to an array element or something similar), when you have an array like type, accessing individual elements of such an array can be done "directly" or via a temporary reference or pointer.
Example:
// Like this:
for(int i=0; i<n; ++i) {
theArra... |
Possible Duplicates:
Frankly, do you prefer Cowboy coding?
Prototyping vs. Clean Code at the early stages
Good design: How much hackyness is acceptable?
Does craftsmanship pay off?
Which is better:
Coding fast, not caring about possible errors and limits, maybe forgetting to check the input, NULL returns etc, just t... |
Wikipedia defines the termination point of a GA to this:
Commonly, the algorithm terminates when either a maximum number of
generations has been produced, or a satisfactory fitness level has
been reached for the population. If the algorithm has terminated due
to a maximum number of generations, a satisfactory so... |
I have been told its kind of a bad idea to use a key as an attribute of an xml tag. I find the very handy for ajax as i can just stick the key i need in what ever element is being clicked,changed, or whatever. I can see how this is a security risk but have only used the tactic in internal apps.
On external application/... |
I'm working on a internship project, but I have to leave before I can finish up everything.
I have 1 class that is not stable enough for production use. I want to mark/flag this class so that other people will not accidentally use it in production. I have already put the notice in Javadoc, but that doesn't seem enough.... |
I want to know your opinion. Do programmers (like me) need to know about design? For example drawing, web design, image manipulation etc.
Edited
Actually, I like web, enterprise and mobile programming.
Thanks :D
|
When you work across multiple programming languages, there is a problem you encounter...
A valid name (identifier) in one language is invalid in another. For example...
var new function this are a keywords in JavaScript, but you can use them freely in Python. Similarly list dict def can be used in JavaScript without pr... |
My boss is planning to use the metrics from our continuous build (builds and runs tests on every commit) as part of our performance reviews (in our 'quality' metric). This seems like a REALLY bad idea to me, but I'd like to know if anyone has studied this or seen this tried before.
My thought is that it's going to hav... |
I am studying operating systems and the x86 architecture, and while I was reading about segmentation and paging I naturally was curious how modern OSes handle memory management. From what I found Linux and most other operating systems essentially shun segmentation in favor of paging. A few of the reasons for this that ... |
I am implementing a model design where DB tables are 'resources', and a model can use many 'resources'. When I return a row from a table, it is represented by an 'item'. (This came from a book by Keith Pope, but I've seen it in several other places too).
So, my question is, who should be able to access the resources?... |
I am looking for advice on how to create my data schema for a public web site.
Currently, we have an Intranet website where our agents create the data needed for reservations. The data includes tables like Establishments, products, prices per periods, and a typical Users table.
This intranet is already in production.
I... |
I have a question which has been raised by my latest job (rather intern).
Just to put things into context - I'm 21 and I've finished my 2nd year of university before that I've had around 2 years of experience doing sys admin/QA jobs and basically I can say that I've seen how different IT sectors operated. Flash forwar... |
I'm currently working on a project that has both an open-source "community edition" and a set of closed-source features for paying clients. One of the pain-points right now is figuring out how to handle keeping the shared source in sync between projects.
We use Mercurial for source control, and the open-source piece is... |
I have a bunch of methods that are commonly used everywhere. Right now the codefile is named globals, to represent the fact that they are... in fact... global.
However, I do not like this.
I want to group these into a class and pass an interface around. I'll make only one instance, but I'm not falling into the singleto... |
Should organizations penalize developers for defect reports filed against their work products?
I was having a discussion with my friend where he asks if a manager taking the number of defects filed against a developer is justified. My take is no, because developers can introduce defects, but by holding those against hi... |
I have been studying Scala, but what I keep running into is the optimization of syntax. I'm sure that will be great when I am an expert, but until then.. Not so much.
Is there a command or a program that that would add back in all/most of the code that was optimized away? Then I would be able to read the examples, for... |
I've used several IDEs and created several default projects. Upon creation, I'll find folder structures created for me. Sometimes I'll see a Resources folder, sometimes an Assets folder, and sometimes both. Is there actually a (standard) difference?
|
I was just reviewing some code I wrote a while back, and can see that I have a couple of private methods that throw argumentnullexceptions and/or argumentexceptions if there are issues with the methods parameters.
I guess my rationale is that helps future proof the application if someone attempts to "misuse" the metho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.