instruction stringlengths 34 19.9k |
|---|
Say you had a live video stream of a popular boardwalk that had thousands of pedestrians walk down it each day. Could software be written to count the number of people that walk by a camera and collect data on things like how many of them were wearing red clothing or how many were over 6' tall?
I'm thinking the softwa... |
How can I match two strings, but at the same time allow for X number of characters to be incorrect in the match. The number of errors should be a controllable variable.
While X number of characters can not match in the string there should be a limit as to how many run in a sequence. Given two strings I might allow 5 ch... |
[Moved here at the suggestion of SO users (10k SO+)]
I'd like to develop a peer-to-peer application. While I have a lot of experience in LOB apps, I'm new to the P2P arena.
I've got a rough idea of how things should work but need some more details to fill out my understanding.
What I know (believe) I need to do:
A sig... |
As I can see, smart pointers are used extensively in many real-world C++ projects.
Though some kind of smart pointers are obviously beneficial to support RAII and ownership transfers, there is also a trend of using shared pointers by default, as a way of "garbage collection", so that the programmer do not have to think... |
I've recently joined a company where I'm working as the scrum master on an agile development project building a web app.
The team is just about to be the maximum size for an agile team (expecting 9 next week). We have talked about potentially splitting the team into two teams, not so much to shorten standups (which ar... |
I am working on an application which is completely written using server side method in asp.net web forms with c# .
Now my team lead wants to convert whole application to ajax , in that approach we need to do the following tasks one by one .
1- Change all page methods into web methods so all will be static methods
2- ... |
I'm writing a factory class for a Selenium Web Driver and I came across a choice that I couldn't figure out which is cleaner. Having two methods with the same parameter.
GetWebDriver(string browser)
GetRemoteWebDriver(string browser)
or adding a boolean parameter
GetWebDriver(string browser, bool isRemote)
I would th... |
At the moment, like a fair few of you I'd imagine, I spend at least 40 hours working on projects that use a specific set of technologies. Sometimes I'm doing maintenance, and have those technologies enforced, and sometimes I'm doing new builds.. but have the skillset of the team enforced due to maintenance reasons (qui... |
Nearly all open source software licenses require (or at least lawyers generally suggest they require) users to include the full license in the root of the project that they are protecting.
One lawyer I spoke to suggests this is a legacy of the CD age, when it was necessary that a full license be included in a jewel cas... |
I've been hearing a lot about the "new" MV* frameworks. I've tinkered with KnockoutJS (I created an invoicing application), but I much prefer to write clean, modular code in raw JavaScript - leveraging utility APIs and other libraries when necessary.
Given a methodical/structured/SOLID approach to writing a JavaScript ... |
I've got a nice, fairly popular JavaScript library that is following Semantic Versioning.
The current library has a few dependency libraries, which are available either as separate downloads or as part of a single bundled download. I see a need to head down this path further. I want to extract additional, smaller libr... |
I have the following lines of code in my application:
return "Service is alive since: " + TimeUnit.MILLISECONDS.toMinutes(mxBean.getUptime()) + " minutes";
It uses the following package:
import java.util.concurrent.TimeUnit;
My application is a web application. Does it means that I have something wrong logically if I... |
I have a console application that is run by taking the input parameters. It can be configured by passing report name parameter, for e.g. reportgen.exe sales.xml. It hits the database and retrieves the data into xml file and sends to sftp site.
Whole of this process is logged and the xml files are being saved in a dire... |
Is there a "scientific" method to determine how much resources/money should be spent on improving the security of a piece of software?
I work in a team where our work is prioritized by a product owner (ala Scrum). The product owner is kind of sales driven and focuses on new functionality requested by customers and less... |
I have been going through various system design examples to understand how we approach any system design question.
Here is what I have understood till now.
Know the system first and find out how it works.
Think of all use case.
Identify key components and their responsibilities.
Connect all the components so that they... |
Suppose a REST API, in response to a HTTP GET request, returns some additional data in a sub-object owner:
{
id: 'xyz',
... some other data ...
owner: {
name: 'Jo Bloggs',
role: 'Programmer'
}
}
Clearly, we don't want anyone to be able to PUT back
{
id: 'xyz',
... some other data ...
owner: {
... |
Is it better to do this
#define INT_TRUE 1
#define INT_FALSE 0
int someFunctionalityIsEnabled = INT_TRUE;
or this?
int someFunctionalityIsEnabled = 1;
It can be safely assumed that false will always be zero and true will be non-zero.
|
Folks, first time on CodeReview - just looking for some input in creating some automation in CakePHP, wondering if this is best used a component or a behavior. It's model driven but involves logic and processing. Here's the scoop:
The app I'm creating requires the user to be notified when a model meets certain conditi... |
My apologies if a variation of this question has been asked before, but due to its nature it is hard to search for.
I am having a discussion with a colleague about object-oriented design, and it basically comes down to a choice between two different paradigms. What I had been searching Google for was a discussion betw... |
I have a Java application that I need to support. I'd like it to collect user information, such as system information: OS and hardware for easier diagnostics and support.
Are there any security & privacy regulations I need to follow?
Do I specifically need consent from the user to do this?
|
I am an experienced C++ developer, I know the language in great details and have used some of its specific features intensively. Also, I know principles of OOD and design patterns. I am now learning C# but I cannot stop the feeling not being able to get rid of C++ mindset. I tied myself so hard to the strengths of C++ ... |
I was thinking of creating some login code (probably to work with BrowserID so users don't need to store their passwords with my site while also ensuring the supplied email account belongs to them) which required any user accounts to be an email address in the ".name" or possibly ".me" TLD (or in any other TLD that was... |
I have experience developing software and web applications and I have decided to do some freelance work on the side. Well, I met with my first client and they are requesting a relatively simple, custom system that (without being long winded) tracks client’s paperwork as it progresses through the business’s different ma... |
I have a Java web application that supports multi-tenancy to keep customer data
separate.
Connection pools to each customer database are created at runtime. The
details of each customer shard (jdbc url, credentials, etc) are stored in a shard
"control" database. When the application needs to access a customer shard... |
While working on a project I've come up with some design solution. I am having a hard time relating it to any general design pattern or analyzing this situation in details. This is also prohibiting me to find any better design for this.
This is a simple analogy of my solution -
Both Kangaroo and Tiger can walk but only... |
As an example I want to switch from C#/.NET to Scala/Jvm. I'm working as a self-employed and I'm free to choose my favorite language/platform. Having more than 8 years of experience in C#/.NET leads me to have lots of reusable codes, libraries and framework. I can work on my projects and ideas without thinking about la... |
Why do browsers use different rendering engines, this causes the problem I hate the most "make your HTML/CSS compatible with all major web browsers".
Why don't they use one rendering engine as a standard and this will save a lot of time and effort for all developpers. In fact this is what I hate about IT industry "C... |
I am trying to figure out the best way around a small problem i have with a design for a Hypermedia API i am currently building.
I have a notion of a site, very simple doesn't have much going on and it is accesible via:
/sites
/sites/{id}
Sites have a bunch of properties and none is all too sensitive. However, a sit... |
I was reviewing some threads on Stack Overflow and started asking myself how I would design my classes and relationships to create such a system.
My Goal -
I want to build a review system like the Stack Exchange review system.
Let's take a look at how the review system works on Stack Exchange. I will only refer to the... |
In most programming languages documentation where they talk about operators +-*/=<> they also include ()[] as operators.
There are unary operators, multiplicative operators, additive operators, bit shifting operators, etc. etc.
I can find no terminology that separates parentheses operators from the rest of them. Callin... |
I was going through the Introduction to Algorithms by Cormen et al.In the chapter titled Amortized Analysis,the difference between accounting and potential methods is given like this
The accounting method overcharges some operations early in the
sequence, storing the overcharge as “prepaid credit” on specific
obje... |
I'm working on a C# project which provides users an on-demand method of importing data from various formats and then performs mail-merge-like actions to complete a template. The process works for basic data types. However, I need to add the ability to perform calculations on the existing data (which is not present in t... |
I am using several activities based on the ListActivity. All of them display information from different SQLite queries, and all of them use the ViewHolder optimization. The cursor adapter have to be specialized, and the view holder is also special for the purpose. Therefore, they are defined as private classes inside t... |
In a code review that I was doing to a coworker, I said that here:
if (someValue === 'final'){
There is no sense to use strict comparison because the only way to pass it as true is with other string value equals to final.
I think that it is enough:
if (someValue == 'final'){
His argument is that an object could have ... |
I'm a bit stuck with a problem involving the normalisation of location input data from the user (which comes from a third party).
Aim
To logically breakdown and interpret the user location input field and understand if it is listing single or multiple locations, from one or more countries.
The Problem
The type of data... |
I've been studying object oriented analysis and, so to get started with this in practice I've decided to first of all build my own management system to have my customers data and so on. Trying to gather requirements for the first time and write use cases for the first time led me to some doubts. I want to ask here abou... |
I have a script written in Ruby that has maxed out a core in my server's Xeon processor for the last 2 hours. Since it's currently only using 1 of four possible cores, I want to try and rewrite the script to take advantage of all four cores.
I can use the .each_slice(n) method on the array that contains my data, but I... |
Short version
How does the IF() function cause the passed expressions to NOT be evaluated prior to being passed in as parameters?
Detailed version
I am part of a standards committee, and a discussion was initiated which, in general, is trying to ban the use of the IIF() function. The general consensus is that if you wa... |
We're redesigning our application's plugin interface, so we're using the Adapter pattern with our proof-of-concept design to show that the new interface will function without committing to using it in the application itself.
We don't know what to call this new interface. It serves the same purpose as the old one - let'... |
Suppose that we are developing some application that requires us to be able to manage customers and that those customers can be both natural and legal person. There are some different ways on which we can deal with it and I'm not sure which of them is the best regarding extensibility, code reuse and so on.
The first th... |
I'm starting to work with agile iterative approach to software development and this question seems quite natural. After gathering the requirements I should write a few use cases to describe how the user interacts with the system while the requirements are being met. Now, how much time should we spent with this?
Should ... |
When naming a model, should the name be as generic as possible-- even if that won't be the name displayed to users?
For example let's imagine a Django model for liking another user's posts.
Does it make sense to name the model 'Like' even if I plan on displaying it as Kudos, Endorsements, Ups, etc?
Does it make sense ... |
Can anyone explain this piece of code?
CODE1
int &fun()
{
static int x = 10;
int &b =x;
return b;
}
int main()
{
fun() = 3;
cout << fun();
return 0;
}
Output: 3
CODE 2
int &fun()
{
int x = 10;
int &b =x;
return x;
}
int main()
{
fun() = 3;
cout << fun();
return 0;
}
Out... |
In light of recent revelations about widespread government monitoring of data stored by online service providers, zero-knowledge services are all the rage now.
A zero-knowledge service is one where all data is stored encrypted with a key that is not stored on the server. Encryption and decryption happens entirely on th... |
We are looking at an app that needs an upgrade. Currently it runs on iOS4, 5 & 6. The upgrade will move to iOS5, 6 & 7. It will also involve some UI changes and new features. I've been reading stuff on iOS7 and looking at things like auto-layout.
What we are trying to figure out is the best way to handle the differenc... |
My development team presently uses the following software in our workflow:
JIRA
Bamboo (Atlassian continuous integration)
Greenhopper (Atlassian agile project management)
Confluence
Git, hosted on BitBucket
Visual Studio 2012
As you can see we are quite heavily invested in the Atlassian ecosystem. We are considering ... |
I've noticed that Facebook SOMETIMES uses a hash in the url. For example, when I'm on my home page, and then I click my profile page, the URL quickly changes to:
facebook.com/#_________
followed by some other stuff.
before quickly loading to:
facebook.com/profileName
It doesn't always do this. What's going on here?... |
For our iOS app, a lot of complicated UI logic depends on the interface orientation of the ViewController. This conditional logic is present in a lot of places.
Can it be segregated into different states in form of objects?
|
I develop an open source Android application, which is licensed under GPL and freely available on Github.
It is currently under heavy development, therefore it isn't published in the Play Store yet.
What can I do, if someone decides to publish it in the Play Store,
without modifying the code (just build it from m... |
I inherited the project from a very experienced Java developer. The project is Android app and the guy who coded is is very experienced in coding regular Java apps. He introduced some file structures that I haven't come across before (I haven't coded Java apps outside Android area). I can follow the code with no proble... |
According to rules of TDD unit tests are written before production code, but what about Integration tests that exercises interaction between concrete (non mocks) wired objects?
Should they be written before unit tests or after production code just to test the "wiring" ?
Note that I'm not talking about Acceptance or fun... |
I have this script I'm working on.
What it should do is generate a new div every time I press a button and I've already done that, but those are not draggable. I think that happens because of the onLoad function but alternative do I have?
The second problem is that when I click one of the blue boxes, all of them must ... |
I'm developing my own scripting language to solve some unique challenges for a project.
The language takes source code and converts the contents into tokens, and then a command factory is used to convert those tokens into something that can be executed.
An example of a script might look like this.
accept: always;
rejec... |
Asynchronous programming seems to be getting quite popular these days. One of the most quoted advantages is performance gain from removing operations that block threads. But I also saw people saying that the advantage is not that great. And that properly configured thread pool can have same effect as fully asynchronous... |
I am trying to setup a small data-logging application under linux. The data arrives via serial port, and from there it should be pumped to logging and to graphical display.
The logging functionality is there for initialization purposes of the graphing functionality, after a reboot.
The data arrives every second and is... |
I have started to learn Javascript. From book http://eloquentjavascript.net:
There is one more arithmetic operator which is probably less familiar to you. The % symbol is used to represent the remainder operation. X % Y is the remainder of dividing X by Y. For example 314 % 100 is 14, 10 % 3 is 1, and 144 % 12 is 0. R... |
On our team, we use Git as our source control. We have several areas of code that are almost independent but have some overlap. Lately we have been discussing workflows and approaches to using source control. One complaint that comes up when I promote using a feature branch workflow is that people often run into compli... |
The company I work for is in the process of completely overhauling our current intranet site by moving it onto a Drupal framework. One area I am questioning is the number of include files we have. As it exists right now, every single .php page has a corresponding .inc page. There are .inc pages that provide certain fun... |
I'm designing the database schema for a new product feature. In my current design I have some related optional data. Rather than have nullable fields I have a separate table with a 0..1:1 relationship to the main table. I chose this design because the queries are simpler* if null data doesn't have to be taken into cons... |
One of our web applications is a page that takes in a serial number and various information is returned and displayed to the user. The serial is passed via AJAX, and based on the response, one of the following can happen -
An error message is shown
A new form replaces the previous form
Now, the way I am handling th... |
The question will sound weird as I'm not very experienced in C, C++ and ASM.
Let's say I have a hard time finding a C# managed, safe-code-only solution to solve a problem. Then I find that in 1998, some codes for (e.g.) a codec have been written in C for PPC, x86, arm, etc. This code can have 20000+ lines, and I need t... |
Currently programming a new software, I'm searching for information about protecting my concept and my source-code. I precise I'm quite new in licensing.
As I'm feeling very concerned by Open-source and sharing with the community, I'm puzzled on the other hand because I want to make some profit of my work (around 1 yea... |
Assuming a platform with no kernel mode, such as Atmel AVR, is there any difference between a device driver and a library, given that everything is user mode anyway?
I ask because I'm thinking about how I want to layer my code. It's like this:
+----------------+
| Business logic |
+----------------+
| CAN library |
... |
Is there any software which can be used to write functional and non-functional requirements?
When writing those, it is essential to:
Store the document in text format to be able to make diffs and minimize the impact on the version control,
Apply extensive formatting when creating diagrams would be an overkill,
Use dia... |
Sometimes when I start working on a project, I just can't think of a good name, or think of a good name that isn't already taken. As a result, I'll end up picking some sort of code name for the project.
My question is, how do you handle name changes in your source code once you find a real name for your project? Should... |
I am looking for an efficient way of evaluating an array of strings against a series of rules and then adding them to another array.
For example I have an array of strings:
something
a
1234
#gohere
I want to iterate through all the items in the array and evaluate them based on a series of rules. For example:
Strings... |
In most programming languages, variables do not have identifying characters like they do in PHP. In PHP you must prefix a variable with the $ character.
Example;
var $foo = "something";
echo $foo;
I'm developing a new scripting language for a business application, and my target users do not have a programming backgr... |
Here's the gist of the problem: There are multiple service providers who each have their own schedules of availability. There are multiple customers who seek their services. Customers need to be able to book a reservation time for the service but they should only be able to book times in which some service provider is ... |
As a physicist, I've learnt programming on my own. But I would like to know the name of the discipline (like algorithmics is the discipline of designing algorithms) which consists of :
making the right choice of language/paradigm
designing a class diagram
organizing the different parts of a code and how they will inte... |
I do PHP Development on WAMP but sometime it don't work properly when I upload the files to a Linux server, its involve a lot of testing and annoying.
I am looking for a solution to do PHP Development on Windows but the files will be sync with Linux Server. I do not want to use SFTP/SSH clients like WinSCP to view or e... |
My situation is that I've been programming for about three years and have learned a lot but still have a long long way to go.
I have an idea for an app that I believe would take off, but I'm afraid to build it because it involves architecting a back-end with databases and authenticated payment transactions and user acc... |
Is "pass by value" synonymous with "functional programming" ?
Are there any iterative programming languages that are (largely) "pass by value"?
Are there any functional programming languages that are (largely) "pass by reference"?
Thanks.
|
I already posted this question on SO and it did ok. It was unfortunately closed though(only needs one vote to reopen) but someone suggested I post it on here as it is a better fit so the following is literally a copy paste of the question
I was reading the comments on this answer and I saw this quote.
Object inst... |
To create a website
I create Psd Files for the design (Phase 1)
I Convert these Psd's to html/css static webpages (Phase 2)
I add some javascript to these webpages (Phase 3)
I start the IDE "visual web developper" to start developping (Phase 4)
I have studied computer programming for the past five years and now I not... |
I'm in the middle of developing a new programming language to solve some business requirements, and this language is targeted at novice users. So there is no support for exception handling in the language, and I wouldn't expect them to use it even if I added it.
I've reached the point where I have to implement the divi... |
I am developing a new project where I will be constantly checking a webpage for data and adding this data to a queue for processing. This data will then be removed from the queue and added to a list if it hasn't already been added. This list will then be stored in the database.
I was wondering about how to use threads ... |
I'm a "weekend coder" developer making mobile apps and games and I've had the desire to make my own version of a game made for the Commodore 64 back in the early 80's by a small publisher e.g. Not EA Games or similar.
The game hasn't been ported / released on any platform since.
I want to make my version because it was... |
I'm replacing a guy who was in his first job as a programmer. You'd think being fresh out of school means the basics are fresh in one's mind, but think again.
The code base is horrible, Ctrl+C / Ctrl+V is apparent in lots of areas, about 60% of the logic is coded in forms and the rest is in a monstruous module called h... |
I've landed my first contract (hooray, self employment!) and the company is asking for time estimates.
Programmers are notoriously bad at time estimates, and I know I've been laughably wrong before. It's fixed bid, so I'm not concerned about charging. I'm just concerned about expectation management.
So far I've ite... |
I have recently came across some code where the variable names are in french, I could not use google translate because only part of the code needs translated, and it would not be that practical to copy and paste each of the variables into the translator.
How can i easily translate the variable names? what translator co... |
I have code that looks like this:
tr.t.findIndexSmoothed(arg0.getX(), arg0.getY());
"tr" and "t" are objects. Is it bad practice to reach all the way down the object hierarchy to call methods? The only reason I can think of is that is breaks encapsulation, and if that's the case, can anybody tell me why that poses a p... |
Our team using Scrum three iterations. We successfully estimate PBI in storypoints using poker-planning. But next we cannot do anything because we don't know
Who create tasks? PBI is created by everyone and approved by product owner, but what about task
Who estimates task?
What technique should be using for task estim... |
Just how efficient is "good enough" for all intents and purposes? I wrote a script to simply list off all numbers that divide into an input, x, as pairs (i, n//i) and was just curious how efficient I should be going for? what is the acceptable rate at which the script starts to lose its efficiency? This is my code (alt... |
I was reading about the at most once property that defines what an atomic action is and I've been curios about this example:
x = 0, y = 0
x = y + 1 || y = y + 1
If we use the 'at most once' definition, we can say that, indeed, x = y + 1 is atomic because
y is only referenced in an another thread and
x is not being re... |
I have quite a bit of experience with using Django for websites and so when I started a new project I naturally chose to use Django for it. Everything went well for a time but now the application is really starting to rub up against what Django can comfortably cope with and I fighting all the time to ensure that things... |
I am a Web Developer working at a company where the fronted framework we have selected is Angular JS. I am now in the position where I am the 'resident expert' whatever that may mean. I have been tasked with teaching/explaining everything that our Designers need to know about Angular JS. Unfortunately my knowledge/unde... |
My job is mainly building websites using CMS such as Drupal, eZPublish or Magento.
Most of the work is templating, CRUD and adhering to the specs with this. Occasionally, there is some business-specific logic, but it's usually 20 lines or so. Most of the logic is a bunch of if in the templates.
In this context, I find ... |
For a while I've been maintaining an ad-hoc script to check code style against our project's guidelines.
I'm aware of AStyle/Uncrustify and have used them, but they are best for once-off code-style cleanups, but impractical to just run all code through some automatic process after every commit.
To explain the issue a l... |
Suppose I have design like this:
class Corpus:
def something1(self):
pass
def something2(self):
pass
def serialize_to_stream(self, stream):
_CorpusJsonSerializer().serialize(self, stream)
class _CorpusJsonSerializer:
def serialize(self, corpus, stream):
.
.
... |
So in the past few weeks I was introduced to Bootstrap 3-RC1. I made some web sites using it, and I actually enjoyed it. Then, recently, I discovered Twitter Bootstrap has already released version 3-RC2. It makes me wonder if it's okay for me to use Bootstrap RC2 for production now? Is it wise if I used it considering ... |
As the data is migrated via the object level, there has been a slow upwards trend in memory usage. I can see the periodic gc activity, but the memory trend is still going up slowly. I have currently for my application set the starting and max heap at 14GB in production, however if we might need a large data set, my co... |
I'm working on reviving a C++ codebase that hasn't been touched since '97.
It's academic software for text analysis, and originally it was non-functional, it wouldn't even compile.
I fixed the code so that it works, and added some new functionality of my own.
I'm doing this privately for someone else, and they will pay... |
I have re-written an open source project from java to haxe, then from haxe compiled to javascript, with totally different UI
So, the question is, is the code considered to be mine after rewriting it to another language in a closed source project? can I use it freely with no worries about original copyrights?
|
Are there any good samples of web applications that consume restful web services?
I am developing a webapp with spring, and have come to the point of reading lists of elements and element details from a RESTful JSON api. I started developing as though I was using a database, creating services, model elements plus DAOS,... |
I've made a file browser in java that opens and read already been made excel files. (using Apache poi 3.9 library)
program read those files perfectly but i want to update some of those files. how can i be able to update those files through my program.
is there is any library or function/class that might be helpful, or ... |
If I look at a database table for editing - is it made up of rows or records?
If I write some sql and then look at the result is this made up of the same elements as the answer to 1.?
Is it the case that they are all rows but in very specific circumstances they are also records?
EDIT
A recent article by Itzik Ben-Ga... |
I have set up a web application which is of commercial use. This application had to make use of the plugin(which is not downloaded from http://plugins.jquery.com)
I downloaded this plugin from http://jquery.malsup.com/cycle2
Kindly, let me know if I could use this plugin in my commercial website.
If I do, would it caus... |
Consider having restricted man resources and thinking about using Xamarin Studio for building cross platform application. Will you be afraid of Apple trying to ban all applications NOT developed by xCode? I mean in future. It is obviously not banned now.
I am just asking this because I heard this on a meeting today a... |
I'm maintaining an ASP.NET Webforms 4.5 application for a few months and frankly i'm fed up with server controls. So i switched to pure HTML and Javascript for front end, when creating new content (or fixing the old, assuming there was enough time). Almost (for reusability reasons) all new requests to the server are do... |
What is it called when a website has another word in place of where www usually goes? For example, images.google.com vs google.com/images. I know the latter is a file on the server that the browser downloads, but what exactly is the purpose of the former? It would be helpful to know what this is called.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.