instruction stringlengths 34 19.9k |
|---|
I am reading about common code smells in Martin Fowler's Refactoring book. In that context, I was wondering about a pattern I am seeing in a code base, and wether one could objectively consider it an anti-pattern.
The pattern is one where a object is passed as an argument to one or more methods, all of which change the... |
The frequency of commits depend on two factors:
the developer himself: some developers tend to commit often, others may spend hours without committing,
the current work: the same developer may have to commit very frequently when effectuating risky refactoring operations or similar tasks, and quite rarely when working ... |
I'm looking at my interface design and I am struggling to decide which is the most "correct" way to implement role-based access control, given a user and a subject that the user would like to access.
As far as I can see I have three core options (with a fourth being a bastardisation of the first three and a fifth bei... |
Where I work, using Properties are discouraged. We have code generation tools to "speed things up". All object data ends up being Public fields. If you request properties anyway, you get something like this:
Public sFoo as String
Public Property Foo as String
Get
Return sFoo
End Get
Set(ByVal value as String... |
I'm trying to understand how something like this works, but I'm inexperienced and I'm trying to understand how the process would work.
Say you have ten categories, a thousand zip codes, and ten thousand items listed in each category, each of which has a description.
When a user does a search for (e.g.) "guitar hero xbo... |
What is the real difference between component-based software engineering and Service Oriented Architecture?
Clemens Szyperski and David Messerschmitt present the following five principles that a software component should have:
Multiple-use
Non-context-specific
Composable with other components
Encapsulated
A unit of in... |
My company is going full steam with the agile process, with multiple agile projects in work. The first agile team, the proof of concept, carried the product through release and the first post production release.
After this successful effort, the team was quickly disbanded, sent off to help other projects on their agil... |
I was talking with a co-developer.
He has a client that wanted to make sure that he delivers on time. The client wants repercussions for missed deadlines.
While I do not do freelance work, I couldn't give an answer.
So, my question is:
What repercussions do you (freelancers) agree upon with your client if you miss dead... |
On reliable websites I always see claims such as "All data is encrypted" or "All passwords are encrypted using 128bit encryption" and etc. However I have never come across a claim such as "All passwords are hashed."
On my website, I will be storing all user passwords in a database after using SHA-512 (most likely) hash... |
I am learning Python currently which wasn't part of my college curriculum. I was asked in an interview why I chose Python and I replied that it is easy to learn and the documentation is very well written. The interviewer didn't reply whether it was a good enough reason. He looked convinced but I cannot be sure.
Is a we... |
How to build a common infrastructure for my web apps using asp.net mvc, and efficiently manage it?
The goal is to increase developer productivity. The common infrastructure stuff includes visual & interactive components like customizable menus, consistent web page layout, consistent navigation experience, breadcrumbs, ... |
I'm just curious if there are any programming languages that use the '=>' and '=<' operators for something.
I wonder why these are not commonly used when their variant '<=' and '>=' are so widely used by most languages.
Is there a reason why?
EDIT: I'm not asking why they aren't used for the same task as '<=', but why ... |
Like many, I'm developing a couple of applications on my own (not at the same time) to eventually sell. But I also have websites to run, college work and a social life etc., so often I can forgot what stage I am in programming, especially after holidays abroad.
Are there any techniques that I can use to help me keep tr... |
I've noticed that a lot of the packages I've been installing on my Ubuntu machine has this "d" at the end. Googling it doesn't give me any answers that I can find.
For example:
FTP server -
Package called: pure-ftpd
TFTP server -
Package called: atftpd
SSH server -
Package called: sshd
What's up with this "d"?
|
I have a customer that wants me to build a web portal (Asp.net 4.0) that will communicate with a desktop client, tablet and/or smart phone (e.g. iOS and/or Android).
I was thinking of using oAuth 2.0. But I'm not familiar with any potential cons to using OAuth. And I don't know how to compare OAuth to other Secure Aut... |
So I'm using Node and ExtJS server-side/client-side respectfully. By using ExtJS, I'm moving a lot of the presentation logic client-side. Thus, something like MVC wouldn't make sense server-side since the view-logic is all client-side.
At this point, my Node server's responsibilities are essentially:
Act as proxy to ... |
I am coming from .NET to PHP. I am playing around with a long file written by someone else (called "cryptographp.inc.php"). It builds and returns an image to the browser.
I want to show the image that the file returns on my Cryptocode/index.php page--like this:
<?php
include './cryptographp.inc.php';
?>
But when I lo... |
Suppose I have a Javascript based application written in iUI or Kendo UI. Can it be packaged in such a way they can run locally without a webserver?
I have a few web applications, that with some rework and HTML5 LocalStorage, can possibly work offline (in an airplane or subway).
My mobile development experience is l... |
I'm working on a website and I want to validate that an individual is an employee at one of a large number of companies (probably using their company's email address, which I don't know before hand). The idea being some users are the general public and others are from these companies. And I need some way to authenticat... |
For example, I have the function generate_salt() in encryption.file but the person may not know where generate_salt() is from. Using a namespace like encryption::generate_salt(), or encryption_generate_salt() for every function in the encryption.file. Or would it be a waste of space and typing because some IDEs can nav... |
It is always said that the include directives should be placed at the beginning of a script. The main reason is to make the functions available throughout the script. Regardless of this fact, is it bad to place an include directive within the main function where it is needed?
For example,
#include <stdio.h>
int main() ... |
Is there a way to prevent session id restore on startup/restart of user's system?
We are using a asp.net app and I am able to login and access the site. For the first time session id is created and stored in cookies.
Problem:
But if I restart my system without signing out, the session is still alive.
How can I prevent ... |
I'm interested in doing code obfuscation (native code, to make it clear what I mean by "native code": the actual machine code in x86/x64/arm executable files - PE, ELF, Macho and etc, not the sources) as a part of a build process. I can think of several ways of doing it:
Writing a compiler plugin, that would get inter... |
This is a question about the internal workings of Mercurial.
I vaguely remember a fellow programmer explaining to me how mercurial works out which changesets differ between two repositories and that it had a speedy solution to the problem.
Does anyone know how this works or can point me towards a document describing th... |
Our business is considering writing a line of business application for tablets to enable road warriors and executives access our data.
This will be primarily used for dashboards, reports and some form filling input: quite typical scenario.
Our other apps being built in .Net (WinForms) with lots of related class librari... |
I recently began work at a small company as a lone software developer. Before I came no true documentation/version control/etc. was in place. The best they have is Microsoft Word documents and Excel spreadsheets to keep track of everything the engineering team produces.
Personally, among other things, I'd like to insti... |
We have 10 distributed teams in our company and we are developing 3 huge web applications. A lot of time of our developers is spent with writing emails.
We are using scrum and for that we had a daily stand-up meeting, but other questions regarding product features, design issues are always communicated via email?
Is t... |
We're developing a total solution, and we've chosen service-oriented architecture to loosen subsystems. However, now we have a problem.
When customer orders something, Order Subsystem is responsible to get that order, and register it. However, there are some other modules which are responsible too, in order registratio... |
I'm learning Objective C (from a C# background) and am having difficulty understanding the unusual method signatures and am looking for a shortcut to make the learning curve less steep.
When reading Objective C code, what English words or phrases can I associate with the symbols?
For example, calling a method looks l... |
I have a requirement what seemingly looks very simple (and perhaps strange) but some minor details are giving me troubles. Perhaps I'm overthinking this.
I'm building a scheduler application (on WPF) for an embedded device that runs everyday. The scheduler controls when the device can be turned on and off. For example,... |
I have a MongoDB database with millions of users in collection. An aggregation function returns millions of results with the following format:
Array ( [_id] => Array ( [user] =>
MongoId Object ( [$id] => 52050d48e654f6342c002d42 )
[send] => 1
[open] => 1
[click] => 2 )
Now I need to update corresponding ... |
I try to explain better using an example:
I create the class Product with attibutes like that:
private string _ProductCode = "";
[DisplayName("ProductCode")]
public String ProductCode
{
get { return _ProductCode; }
set { _ProductCode = value; OnPropertyChanged("ProductCode"); }
}
the class Product implements th... |
Does an Open Source license exist that allows me to retain rights to revoke usage of software/source at any time, for any reason, and without warning?
I want to allow others to use my software and source code for free but at the same time, I want the ability to revoke rights to usage if I don't agree with the ways that... |
I'm trying to figure out how MVP should be implemented at the UserControl level. I thought I had it, but I ended up reading a blog post that pretty much shut me down. Now I'm back at the start and with no idea how to proceed.
Let's say my UserControl is something simple like two TextBoxes and a ComboBox. This gets invo... |
I'm trying to get to grips with agile project management (with Pivotal Tracker) but keep finding myself running into walls when trying to define the first few stories of a project. Take for example this very simple story:
"A user should be able to tag a product"
Assuming I've already defined "product" elsewhere, this s... |
I was reading Essential PHP Security and chapter 8 talks about problems with hosting your PHP app in a shared hosting environment.
Some of the problems he mentions are:
- Exposed source code and File system browsing.
a web server must be able to read the source code in order to execute it. Since the web server is shar... |
I have a Model Car in my iOS application where it's parameters like name, year, value etc are fetched from a web service in order to fill a list with cars data.
Where should I put the method that asynchronously goes to the server and returns an array of cars (this method already converts the JSON to a Car array)?
My cu... |
I am not able to understand one algorithm discussed in TAOCP Volume 1; Section 1.3.3 named as "Algorithm A" stated as "Multiply permutations in cycle form" while compared with the stated example in next page.
The step that is not clear is mentioned in 8th and 9th rows;i.e. how can be the "CURRENT" value becomes "g" af... |
I'm coding in a non-functional language with functional mechanisms (C# to be specific, but you could substitute, say C++ and use function pointers, or what have you) on a small team. It's my habit to use functional techniques -- passing delegates (objects representing functions) as arguments, using closures, occasiona... |
I want to make an open-source graph thing which looks and behaves very similarly to Google Visualization API, but it would be based on Flot. Is this legal, or must I not imitate Google Visualization API?
|
As part of my research, I write a lot of Python and MATLAB code that never needs to be distributed to anyone else. Even if I need to distribute my software, Python and MATLAB, both being interpreted, make sharing it relatively simple.
Now I am writing some software in C++ that I'd like to distribute. I have a handle on... |
When developing login module for a web application, do you suggest to keep the username and password in a keystore? Lets assume the keystore was kept in a very safe place in web server.
|
I need an algorithm for picking a user.
Users are identified by letter {A, B, C, ...} and are ranked by number {1, 2, 3, ...}. Rank is the degree of likelihood to be picked, so a rank 2 user is twice as likely to be picked over a rank 1 user, and rank 4 is four times as likely, etc.
So let's say four users are {A, B, ... |
I used to think that it's not, but yesterday I had to do it. It's an application that uses Akka (an actor system implementation for the JVM) to process asynchronous jobs. One of the actors performs some PDF manipulation, and because the library is buggy, it dies with a StackOverflowError every now and then.
The second ... |
I am studying Spring framework, in web.xml I added following which is a bootstrap listener. Can anyone give me a proper idea of what is a bootstrap listener?
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
You can see the doc here: ContextLoadListener
... |
CASE 1 (Definition and declaration in same source file)
Suppose both my prototype and definition of global function is in .cpp file. Where should I write inline keyword to make compiler know?
In the prototype
In the definition
Both
CASE 2 (Definition and declaration in same header file)
If I have declared prototype... |
If I write code with proprietary dependencies, can I release my own code under the Apache licence?
An example of this would be a plugin for a proprietary framework.
|
I was making a Python program to measure the growth of codereview.SE. My approach was to get the "Site stats" shown on the front page and store them on my hard drive. I plan to do this once every day. So far I have made enough to get the stats and append them to a text file. The python script can be viewed on github. T... |
A client asked us to automate his offline paper-based processes. He sent us a copy of the physical forms that he uses.
Our team met and discussed how the navigation should be, what major components would exist in the UI. That's it.
Problem is, we don't have actual "written" requirements. With a lack of an actual busine... |
I am not asking for code but rather design ideas. I am trying to develop a new system to learn more about client/server development.
I would have 3 systems:
Client 1 : Client
Server 1 : Server
DB Server 1: DB Server
I would develop a server application as well as a client application
What happens is that my idea woul... |
I'm in a job hunting. And in my CV I placed a skill list like:
Skills: C/C++/Java/...
The most common question I got is: "hem, since you are familiar with both C++ and Java, can you tell some similarities or difference between the two languages."
And I just don't know how to answer, what I said is basically some lang... |
Over the past years I learned about 14 programming languages
(assembler phyton delphi qbasic c++ c# ruby perl - etc etc etc). However this was all out of my own interest, I didn't went to school for it.
Now without real education I am into a team with other programmers.
We are into robotics with our work. In contr... |
Open the CMD, and I should type the password and usename?
In the GitShell opened by shortcut, I don't need to type the username and password.
Related is here:
https://softwareengineering.stackexchange.com/questions/209014/how-can-i-convert-gitshells-commands-into-an-bat-file
Is this useful, I cannot make it take effec... |
"Unhandled exception" term
In .NET Framework, unhandled exceptions are the exceptions which were not handled by the application itself, and result in a crash. In a case of a desktop application, it means that a window similar to this one is displayed:
For a web application, it mostly means an HTTP 500.
Under unhandled... |
I have to design and build an import script (in C#) that can handle the following:
read data from various sources (XML, XSLX, CSV)
verify data
write the data to various object types (customer, address)
The data will come from a number of sources but a source will always have one import format (either csv, xml, xslx).... |
Consider the following typical scenario:
if(myObject == null) {
myObject = new myClass();
}
I'm wondering what is thought of the following replacement using the null-coalescing operator:
myObject = myObject ?? new myClass();
I'm not sure whether I should be using the second form. It seems like a nice shorthand, b... |
I'm looking for a way to clearly diagram how multiple applications communicate via a service bus. The best I've come up with so far is a sequence diagram, but I really don't like that. Sequence diagrams necessarily relate some sort of sequence, and that's really not what I want. Furthermore, since every service communi... |
So basically, my company is looking to create an app that can be distributed on Linux, Mac OS X, and Windows. We are hoping for a cross platform solution. I have experience working with Java Swing years ago and thought it was reasonable, but not great. It assuredly did however work on all platforms just fine. Is Java a... |
I'm designing (not writing, yet) a task scheduler system for a complex video game. The rest of the program passes it objects containing a function and some metadata including an estimation of how much time is left before the data is needed (which can change, of course). The scheduler is responsible for prioritizing the... |
I'm currently writing unit tests to test behavior of a method and would like to partially mock the methods calling injected properties. For example:
public void doSomething() {
int complicatedInt = 1 + 1;
if(getProperty().someBooleanReturn()) {
... etc. ...
}
}
So obviously I want to mock the getProperty()... |
In the python datetime module, timedelta objects take weeks, days, hours, minutes, seconds, and microseconds as arguments upon instantiation. However, after the timedelta is created, the only two attributes it has of the former listed are days, seconds, and microseconds.
Why is this?
|
The context of this question is choosing tools for writing design specifications for software projects.
These documents will be written and maintained by architects and developers, I'm not talking about marketing requirements. Some of them may be shared outside the team, but only in a processed, non-editable form (PDF,... |
If it was a 2-point story for one person, would you double it if people are pairing?
Pairing isn't always necessarily done 100% of a dev task, so it seems that doubling the story points seems wrong. And it might not be obvious how much of the task will require pairing until the end, so you wouldn't know what the poi... |
I'm mostly thinking of PHP here, but if you want to refer to other languages that's fine.
An object has a method that requires data contained in another class of object.
Should I extract that data from the other object into a variable and then send just that data to the requesting object?
Or should I pass the entire da... |
The C++ language allows intermixing of both C++ and C in one source file. For example,
extern "C" {
struct bar { /* ... */ }
}
Does C++ or has it ever supported any other "linkage languages" other than C? e.g. extern "Pascal" or extern "Haskell"
|
I have done tasks based on Java, but my seniors assigned me to collect requirements for creating a globalized bug tracking tool.
I have read many types of requirements from Wikipedia
and the mindtools website, but it was very confusing.
What are the exact differences between functional requirements, operational require... |
In this talk: http://www.youtube.com/watch?v=hQVTIJBZook, Douglas Crockford claims that class-based object-orientation can be represented in terms of prototypal inheritance. The construction he gives is something like:
var theObject = function() {
var private1 = ...;
var private2 = ...;
...
return {
public1... |
As pointers in C require 2 bytes of memory size irrespective of the size of the data type they are pointing. So does the same thing applies to java references also ?
|
I'm working on a project to update our (out of support) middleware stack to a stable but supported version. There are several teams with applications running on the version we currently have in production and understandably nobody wants to carry the risk of being the first to run on the newer version.
What strategies ... |
The way it was
For years, I have organized my software solutions as such:
Data Access Layer (DAL) to abstract the business of accessing data
Business Logic Layer (BLL) to apply business rules to data sets, handle authentication, etc.
Utilities (Util) which is just a library of common utility methods I have built over ... |
Our manager wants us to do applicaiton qos which is quite different from the well-known system qos. We have many services of three types, they have priorites, the manager wants to suspend low priority services requests when there are not enough bandwidth for high priority services. But if the high priority services req... |
I need some help with regards to implement a pre-designed system that has 4 components and several constraints. I've spent approximately 50 hours trying to determine the best way to build this system; however, I do not think I have a strong enough solution as of right now.
~~~ The Background Information ~~~
The purpose... |
I am developing an open-source Java desktop application and I would like to use some icons in the GUI to indicate various settings, external links, etc. I found a set of free icons that are published under the Creative Commons Attribution-NoDerivs 3.0 Unported license that I would like to use.
My questions are:
Would ... |
Is state another name for field or is it something different?
For example:
private int telNumber;
can I say about telNumber that it is a state or it is a field?
|
How is a syntax checker for a programming language written? I am guessing a grammar has to be written first. How to then proceed?
Motivation
I'm using a programming language (Apex for Salesforce) that is compiled in the cloud and a list of errors is sent back to the basic Eclipse editor. I'd like to skip the process fo... |
The computer scientist Peter Norvig argued in his essay Teach Yourself To Program in 10 Years that you need about 10,000 hours of practice.
But Jeff Atwood argued in his post How To Become a Better Programmer by Not Programming that he believes the only way to become a better programmer is by not programming.
These ar... |
While using Linear probing method to implement hashing, when we delete and element, the position of the deleted element is declared as a tombstone/ mark it as deleted. Why can't we just shift all the elements from the current position until the next empty element is encountered? Won't this save the time when too many t... |
I am finishing up a decently sized Python/Shell project, and I'm wondering if there's a 'best practice' list of things to do when finishing up development.
So far I've done:
pylint
pycallgraph
grep'ed for :TODO: and :FIXME:
find orphan code
some more documentation
install scripts for client and server
make sure comm... |
I am a web and software developer involved in the creation of mobile apps. I am currently working on a project with a looming deadline. I am wondering if I should be committing code rapidly and large and testing later, or doing tiny commits and testing each one.
Thank you!
|
We know there are several moving parts to a system like the apple store or google play. At the very least;
The device has a unique hardware id or sim card
The user has a login/pass
The "store" site has some crypto
In what order and format (cypher/plaintext) is this data exchanged between the device and store software... |
I have developed a web site with a mysql backend, but am not satisfied with how I am getting one set of data and do not know how to get another dataset.
The page in question is at:
http://whistclub.org/test/ajax.php?vichill/results/1
The results are shown through October so there is some data to use.
I am pulling the r... |
I have a question regarding uploading an asp.net website to a real web sever. What type of files will be uploaded is it ASP.NET files or is it assemblies?
To be more clear if someone got an access to my ftp and downloaded all the files will he be able to edit those files?
|
I am having a design issue regarding .NET properties.
interface IX
{
Guid Id { get; }
bool IsInvalidated { get; }
void Invalidate();
}
Problem:
This interface has two read-only properties, Id and IsInvalidated. The fact that they are read-only, however, is by itself no guarantee that their values will rema... |
I'm aware that they both use different programming paradigms, but from a high level perspective apart from differing syntax it seems most basic tasks can be achieved in similar fashion.
I only say this because when I've previously touched functional programming languages such as Haskell, writing code for basics tasks ... |
I am making a website where in users would rate posts by other users, according to how useful they are.
The posts will be about products - mobiles, tablets, and other personal consumer electronics only.
I want to make sure no trolling or slandering goes on, so I'll need a system that will make sure the good ratings of ... |
I just subscribed to a facebook page which post links to different open source projects or code archives. I'll like to save those links and descriptions to a local db.
How can I do that? I heard something about the concept of web spiders and I know some php and java but I don't know how can I solve the problem from ab... |
I've become a project manager in my company and here is what I've experienced till now:
At first, I was trying to keep in shape technically with other developers of the team (about 15 developers) and read as much as I could so that I would know almost everything going on in the project, from architecture, up to syntax ... |
When we did web development in 1996 it was CGI, FCGI and Perl on the backend. Now why is Perl not that popular anymore and instead we use Java, Python, Go, PHP, C# and everything but Perl? To me it seems that Perl should be good since it has had long time to mature. What happened that causes Perl to lose its applicabil... |
Explaining the difference between strictness of languages and paradigms to a colleague of mine, I ended up asserting that:
Tolerant languages, such as dynamic and interpreted languages, are used best for prototypes and small projects or medium-size web applications. When choosing elegant dynamic languages such as Pyth... |
In programming languages, for represent numbers you have (mainly) two types: Int(s) and floats.
The us of Int is very easy. However floats cause a lot of unexpected surprises:
http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/float.html
I wonder why is not used a decimal-based type make more sense as the default fo... |
I work at a small development company as the lead developer. We have two other developers, as well as my boss who is a developer, but doesn't really do much of the actual coding anymore.
The problem I am trying to overcome is multifaceted. We have a tendency all to work on our own projects without much collaboration be... |
I have implemented an application protocol stack that moves an incoming stream of data upward through several layers, as follows:
copies a TCP segment from an OS buffer to my_buffer.
after identifying a record boundary, splits the record in my_buffer into tab-separated strings which are copied into deque<string> my_de... |
I'm a developer working on a Wordpress project. I work on this alone and I want to improve the way I use Git but I don't know where to start.
Currently, I'm using git to commit all of the work that I've done for the day as long as that specific work is done. Here are some instances where I commit a specific work:
A sp... |
Conceptually a "pointer" is just something that "points" to something else;Is this definition is sufficient to tell exactly what a pointer is in programing languages?
Does it need to have any other features?
Programmers who come from specific language may have pre-conceived ideas of what constitutes a 'pointer' based... |
Let's say we have some requirements
Req1: User name will accept 6-10 character alpha value.
Req2: On click of Submit button, application will show error message "Please enter value or character between 6 to 10 including" for invalid boundary value.
In this case if we are designing test cases for invalid boundary valu... |
Developing a web application which should allow User to schedule appointment based on their TimeZone. And I am storing the User scheduled datetime as server datetime into database field. While showing schedule information retrieved the value from Database and converted into user timzone. processing in Code base I am c... |
I am interested in decentralized systems, and am currently considering building one myself. I am considering using JavaScript and HTML5, simply because it makes it very easy to use the system (they just have to go to a website).
Some thoughts:
I may or may not use another decentralized network for storage, and even if... |
I am new to Hibernate so my question could be seen as a very straight forward one, also I will try not to be too generic (as I am always told off because of that), although as with all architectural question it is hard to avoid that... I never know where to ask these questions.
I have setup a webapp using Spring + Hibe... |
While searching through many javascript libraries/frameworks, I observed that the terms are sometimes used interchangeably.
So, conceptually is it important to distinguish between framework and library?
Do people seriously make their decisions based on whether it is a library or framework?
Would a user like to browse t... |
Suppose I have a class C with a method f() which is meant to be used only within C's implementation, but which should be overridden by C's subclasses.
Is it reasonable, or "pythonic", to consider it private, i.e. to name it _f() rather than f()?
In other words would you distinguish the interface provided to subclasses ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.