instruction stringlengths 34 19.9k |
|---|
I have a logic intensive algorithm that I need to code in two languages (actually I finished it in one language satisfactorily and am about to start coding in the other language). By logic intensive I mean the algorithm is non trivial, needs careful understanding and, importantly, could be having bugs (due to complexi... |
I've been checking out Berkeley DB and was impressed to find that it supported a SQL interface that is "nearly identical" to SQLite.
http://docs.oracle.com/cd/E17076_02/html/bdb-sql/dbsqlbasics.html#identicalusage
I'm very curious, at a high-level, how this kind of interface might have been architected. For instance:
... |
I'd like to reach out to the community on this one. As a software developer, I'm not an expert salesperson or marketing guru - I think in code and not much else. Most developers I come across are like this and also tend to be serious penny-pinchers. Let's say, as a developer, I recently released a new software produc... |
I want to create my own Dropbox clone (for learning purposes - only the Windows app) and am looking for some tips.
Currently, I use the FileSystemWatcher to check if there's a change, then use rsync to sync all the data. Now, how does this work with multiple computers? If computer A changes a file, it should be pushed ... |
Just came across this post on reddit, where someone was charged $1,223 for a "FREE STEAK SALAD".
I was trying to figure out 'Why 1223?' thinking that this might be a programming error somewhere. But 1223 seems to be pretty much an ordinary number (= 100110001112).
Any ideas?
|
I'm just learning about use-case analysis and use-case diagrams and am a little confused whether or not the MySQL database of a web app should be considered an actor.
Is the databased considered outside of "the system" or my application, because it is its own server, most probably on another physical machine?
On the o... |
In an ideal world:
In an excellent article Don't Call Yourself A Programmer, And Other Career Advice, Patrick McKenzie explains, among other things, that language doesn't matter:
A developer is a person who solves problems, in general. A developer is not a person who writes code in a specific language.
Businesses don'... |
I am just beginning to learn Functional programming (FP). I come from a OOP world, where everything are objects, and most of them are mutable. I have a hard time wrapping around the concept that functions don't have side effects.
If something is not mutable, how are common things objects like Employee or Person repres... |
I'm part of a small team of four, and I'm the unofficial team lead (I'm lead in all but title, basically). We've largely been a "cowboy" environment, with no architecture or structure and everyone doing their own thing. Previously, our production deployments would be every few months without being on a set schedule, ... |
I need to find a way or an algorithm that groups members of a given data set (of positive integers) so that the difference between group means is minimized (not maximized, as usual).
There are two constraints:
The number of groups should not exceed log(N) base 2. N is the input array size. Let us assume that N = 16, ... |
I am relatively new to Visual Studio Development and I was wondering - it seems that everytime I make changes to my JS or CSS in my project - I have to "build" the project again.
Is there any way to simply refresh the browser as opposed to building everytime ? My understanding is that all the files are copied to some t... |
Microsoft released Silverlight 5 but there has been no news of any future versions (except service releases) being released. Combined with the increasing visibility of HTML5 and modern JavaScript libraries it now makes a lot of sense to start adopting the new and emerging technology instead of relying on Silverlight wh... |
I ask because I've seen a couple of OO PHP tutorials which do not adhere to this, but to me it just makes sense. It makes it easy to instantly see if a file is a class or not, if non-class files all use lowercase names.
|
Say I have a function that creates a list of objects. If I want to return an iterator, I'll have to return iter(a_list). Should I do this, or just return the list as it is? My motivation for returning an iterator is that this would keep the interface smaller -- what kind of container I create to collect the objects is ... |
When starting a new software project that will be used on several platforms, how do you determine the best way to start development? Do you develop for one platform and then port to the next? Do you try to develop all platforms simultaneously?
For example, I'm going to start developing a Windows Phone app in C#. Much o... |
Possible Duplicate:
How much documentation is enough?
Do you know how the big IT company like IBM, Microsoft, or google make sure their application source code has proper documentation for future new programmers? What are their methods or tecniques? Do they tell the programmers to write documentation or hire a speci... |
I am working on a project in which we have to implement and unit test
some new module.
I had a quite clear architecture in mind so I quickly wrote down the main
classes and methods and then we started writing unit tests.
While writing the tests we had to make quite a few modifications to
the original code, such as
Mak... |
Abstract (tl;dr)
Please read the full question, this is awfully simplified:
How can unix file permission style restrictions be applied to inter-type data/control flows, allowing fine-grained access to some class-members for some groups of classes?
Background information
If you think about unix file systems and permissi... |
Is there a way I can make the license I use for an open-source software package be valid for all contents of the package without having to write it into every single file?
I often saw a LICENSE file, but does this file (with the license in it) makes all contents of the package (i.e. the current directory and all sub-di... |
I'm going to work on some project that would do a user-action recognition based on what he/she does in the system.
As far as I understand there are two main parts here:
Intercept the user actions (say http traffic in web/ui interaction in thick-client)
analysis of user intentions.
While the first part is rather technic... |
I've heard a few times that every extra [number1] milliseconds it takes to process a web request and return a response will lose you [number2] percent of users. Is this just "conventional wisdom," or have there been actual studies on the subject? And has there been found to be a lower bound to this phenomenon, like "... |
For about 10 years I've worked on various in-house desktop client applications with SQL Server data stores. Rarely did I start these projects - most are takeover work.
One thing that seemed constant everywhere was that there was a single global SQL Server user account that this application used that granted it permiss... |
I don't understand what is passed to the function f() when I call it like this.
main()
{
void f(int,int);
int i=10;
f(i,i++);
}
void f(int i,int j)
{ printf("%d %d",i,j); }
gives me 11 10 .Can somebody explain why its 11?
|
Im working on a Java Software and there is a need to use some extern libraries. I found two relevant libs. The one is on an AGPL and the other on the MIT License. Now Im asking my self, can I use these libs if:
I would make a non-opensource-nonfree-software
or
I would make a non-opensource-free-software
I dont real... |
I have two different tables in two separate databases with around 1.5 million records each. (BTW: im working on oracle databases)
The objective is to check if every record present in table A is also present in table B. Since the tables exist in different databases, I think I cannot calculate the "difference" between ... |
I'm writing a web app and am wondering about future upgrades and how upgrading the webapp will affect the user experience.
In particular, I was wondering how a company like Google approaches this problem. For example, I have seen several examples where a particular google app will ask the user if they want to upgrade t... |
A Client has a huge Windows Application running on a Database. This client wants you to develop an "Express" version of this application, including only, let's say, 20% of its features. This Express version must be a Web Application, opened on the WWW. You have 2 choices:
Use the same Database to develop the web appli... |
Note more discussion at http://news.ycombinator.com/item?id=4037794
I have a relatively simple development task, but every time I try to attack it, I end up spiraling in deep thoughts - how could it extending the future, what are the 2nd generation clients going to need, how does it affect "non functional" aspects (e.... |
Can we use the word "object" for data / functions in e.g. C (or Pascal) which doesn't really have objects? In C, what is an object? A data structure? A named memory area? I spoke to my collegue about "objects" in C and he said that there weren't any but in the text I study about C the word object is used as a generaliz... |
WinRT: is it really about calling WIN32 (wrapped in COM (exposed as .NET)) via a proprietary extension of C++?
That looks like a lot of wrappers and layers between the developer and the actual functionality. Does anyone trying to go with it stand a chance at profoundly understanding the ecosystem (if his last name is... |
I find that some software developers are very adept at this, and often times are praised for their ability to deliver a working concept with abstract requirements. Frankly, this drives me crazy, and I don't like "making it up" as I go. I used to think this was problematic, but I've started to sense a shift, and I'm won... |
I just graduated from university with a degree in Computer Science/Engineering and was fortunate enough to land a job working in the pharmaceutical industry as a developer. My title is System Developer I, which will require the following skills:
0-3 years development experience with C# .NET and SQL Server
Experience wr... |
I am looking for coding guidelines developers should follow while writing C#/ASPX/SQL code, so that merging into other branches is smooth if not seamless.
|
I have been asked to quality review two code bases. I've never done anything like that, and need advice on how to perform it and report it.
Background
There are two providers of code, one in VB and one in C (ISO 9899:1999 (C99)). These two programs do not work so well together, and of course, the two suppliers blames ... |
This is a repost of a question on cs.SE by Janoma. Full credits and spoils to him or cs.SE.
In a standard algorithms course we are taught that quicksort is O(n log n) on average and O(n²) in the worst case. At the same time, other sorting algorithms are studied which are O(n log n) in the worst case (like mergesort and... |
I have, for example, this table
+-----------------+
| fruit | weight |
+-----------------+
| apple | 4 |
| orange | 2 |
| lemon | 1 |
+-----------------+
I need to return a random fruit. But apple should be picked 4 times as frequent as Lemon and 2 times as frequent as orange.
In more general case i... |
I have been working on a database project, and I recently received a bug report for the remote execution of some queries.
Usually, you try to find out the actual cause for the bug to occur and then fix it.
But sometimes what I do when I'm fed up of doing some research (and can't find suitable information on the interne... |
In my company we are building a webapp containing serveral central services that we design ourselves and then specify as interfaces. I.e. the interfaces are application specific and they are then implemented with third party libraries which we may change over time. When it comes to exceptions, I have realized that the ... |
Another team in my company start to document their stand-up meetings, but I believe it is a waste of time. As far as I know, stand-up meetings are for communication not for status reporting (please, correct me if I am wrong)
So, Should we document stand-up meetings?
|
If we have more than one service that uses same database - is it ok to move out user authentication on separate server and use RPC calls, instead of traditional database lookup?
|
Me and a friend are looking to team up for some freelance web designing. We both are very strong PHP coders and website designers, but I am better at design and he is better at PHP. So, I'll be controlling the stuff the user sees, he'll be controlling the stuff the user does.
In order to speed up development, I'm wonde... |
I am currently creating a web application that allows users to store and share files, 1 MB - 10 MB in size.
It seems to me that storing the files in a database will significantly slow down database access.
Is this a valid concern? Is it better to store the files in the file system and save the file name and path in the... |
I'm designing a pretty standard Spring MVC application, and I'm trying to figure out where the responsibility for transaction management should lie.
I've been reading Java Transaction Design Strategies, and the one that I think best suits is the Server Delegate one, where the controller is what manages the transactions... |
I'm writing a game and the accompanying graphics engine on top of OpenGL in C++. Im also a fan of good coding processes and automated testing. Graphics code + testing seems pretty immiscible, since the output is often visual only, or very heavily visual-oriented.
For example, imagine analyzing the raw image-stream that... |
Preamble (Skip if you don't like to read)
I've been learning C/C++ in school for a year now and all the assignments in the book, after reading through the chapters, were not too difficult to implement. Some examples of programs I've written are abstract data types like binary trees, queues, stacks, lists, and other typ... |
According to section 11.2 of the App Store Review Guidelines,
Apps utilizing a system other than the In App Purchase API (IAP)
to purchase content, functionality, or services in an app will be rejected.
Various apps like JetSetter, Gilt, and Kayak include in-app purchasing flows that either collect credit card inform... |
I'm starting an internship program for our software department and I was wondering about creating a position ("chief intern", intern supervisor, or whatever one should call it) with the following responsibilities:
Train interns
Coach interns
Manage projects and tasks for interns
Supervise intern's work in terms of rhy... |
We are a group of people playing floorball together on a regular basis. Every session starts with the daunting task of dividing teams...
So what would be better than an application to pick teams automatically?
So, given a history of team-combinations and results, and a list of people showing up for this particular sess... |
Current job: Working as the lead business analyst for a Big 4 firm, leading a team of developers and testers working on a large scale re-platforming project (4 onshore dev, 4 offshore devs, several onshore/offshore testers). Also work in a similar capacity on other smaller scale projects.
Extent of my role: Gathering/... |
I have FILE_A which has over 300,000 lines and FILE_B which has over 30 million lines. I created a Bash script that greps each line in FILE_A over in FILE_B and writes the result of the grep to a new file.
This whole process is taking over 5 hours.
How can I improve the performance of my script?
I'm using grep -F -m 1 ... |
The Queue class in the python kombu library inherits from MaybeChannelBound, which in turn implements the call method (making it callable). The call() method itself is a thin wrapper around the bind() method.
It is not clear why this was done, as calling the bind() method seems (to my simple mind, at least) to be clear... |
I'm working on an Android app.
We have listeners for position data and camera capture which is timed on a background thread (not a service).
The timer thread dictates when the image is captured and also when the data is cached in a local sqlite db.
So, my question is how to properly store the location data as it com... |
I'm working on a team where the team leader is a virulent advocate of SOLID development principles. However, he lacks a lot of experience in getting complex software out of the door.
We have a situation where he has applied SRP to what was already quite a complex code base, which has now become very highly fragmented a... |
I'm looking at using some open source code in my ASP.NET web app (specifically dapper). Management is not a fan, because open source is seen as a risk that has bitten us before. Apparently previous developers have had to rewrite things after having open-source components fail.
The pros seem to be:
It does a lot of s... |
I wanted to verify with all of you, if I have a correct Observer Pattern analogy. The scenario is as follows:
Consider, at a junction, there is a traffic signal, having red, yellow and green lights respectively. There are vehicles facing the traffic signal post. When it shows red, the vehicles stop, when it shows green... |
The data in my website is stored in many different tables(friends,relatives,etc) and every-time I have to query each and every table. But all this data is subject centric. E.g. data for a person is of the form
data[301]={
"pid"=>301,
"friends"=>array(),
"relatives"=>array(),
"interests"=... |
When I want to use the Apache 2.0 licence in my project, I should include this in the comments of my source code:
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the Lice... |
Why was it decided to call the kill command "kill"?
I mean, yes, this utility is often used to terminate processes, but it can actually be used to send any signal.
Isn't it slightly confusing? Maybe there are some historical reasons.
All I know from man kill that this command appeared in Version 3 AT&T UNIX.
|
Working on two formats throughout our website - PC and mobile. Each request will have a check who the client is. Then, two methods seem optional:
Render the page accordingly.
Redirect to a parallel site
Is there a difference in server load (i.e. maybe 2 has less load because requests are actually pointed at different... |
I have been conducting some research into RESTful web service design and I've reached what I think is a key decision point so I thought I'd offer it up to the community to get some advice.
In keeping with the principles of a RESTful architecture I want to present a discoverable API, so I will be supporting the various ... |
I was thinking on how current key-value storages implement "expire date" for items. Currently I have 2 variants for that in my mind:
they don't do anything (keep expired data), and only do check when you do, for example, GET by some key. The problem here is that if you are limited in memory, expired items won't be del... |
We've been tasked with creating a web based workflow tool to track change management. It has a single workflow with multiple synchronous tasks for the most part, but branch out at a point to tasks running in parallel which meet up later on. There will be all sorts of people using the application, and all of them will ... |
I'm trying to understand how the puts function fits in Ruby's "Everything is an object" stance.
Is puts is the method of a somehow hidden class/object? Or is it a free-floating method, with no underlying object?
|
My experience with web services is slim and I'm trying to understand this a little bit more.
I have done for instance a web service using visual studio. In order to use it, I add a web service reference in my projects and this creates a proxy and the use is pretty simple. Does this use SOAP?
I ask this because i will ... |
I wonder what are the advantages of Maybe monad over exceptions? It looks like Maybe is just explicit (and rather space-consuming) way of try..catch syntax.
update Please note that I'm intentionally not mentioning Haskell.
|
I am building a Flex 4 based application using the presentation model design pattern. This application will have several different components to it as shown in the image below.
The MainView and DashboardView will always be visible and they each have corresponding presentation models and models as necessary. These view... |
How can 2 or more developers code a certain feature/module of a software? Let's assume that the module is big and feature rich. How would they prevent each other from overlapping their code? Say, we have the same method but is implemented in a different way. Do you think it might be better to have one focused at a ... |
For functions that need to index files in a directory and rename them FileName0001, FileName0002, etc... I often need to write a function that splits the file name from the file path and rename the file. When I put the file name and file path back together, I don't have a very good name for the variable that contains ... |
I was reading Code Complete regarding variable naming in trying to find an answer to this question and stumbled on a table of commonly accepted prefixes for programming word processor software. Well, I'm not a word processor software programmer, but if I was, I'd be happy to use those user defined types.
Since I'm a... |
I am implementing a controller class to manage a view. I have a file uploader class, Grabber, which could communicate in one of 2 ways:
1) Offer some kind of notification event to the controller on upload start and finish
2) Provide a property on Grabber that indicates true or false if upload has completed
I am concern... |
I have a few functions in PHP that read data from functions in a class
readUsername(int userId){
$reader = getReader();
return $reader->getname(userId);
}
readUserAddress(){
$reader = getReader();
return $reader->getaddress(userId);
}
All these make a call to
getReader()
{
require_once("Reader.php");
static $reader ... |
I have about 12 Oracle tables that represent data that's being integrated from an external system into my web application. This data is going to be used in an informational and comparative manner for the clients using my web application.
On one particular page of my web application, I need to combine data from 3 - 5 O... |
I was just wondering if a language could support something like a Retry/Fix block?
The answer to this question is probably the reason it's a bad idea or equivalent to something else, but the idea keeps popping into my head.
void F()
{
try
{
G();
}
fix(WrongNumber wn, out int x)
{
x = 1;
}
}
void G... |
Why was section 1 added to LGPLv3? My understanding of section 3&4 is, one can convey the combined work under any license and with no requirements from GPLv3 (besides those explicitly stated as requirements in LGPLv3 3&4). Given that, why is section 1 necessary. Wouldn't that sections 3&4 by themselves already imply an... |
I'm developing a web application for Windows Azure using ASP.NET MVC 4. I would like to enforce one restriction in the architecture: do not use Session.
To achieve availability on Azure, and since there is no sticky sessions, I would need to store the session data in some central service, probably either SQL Azure or ... |
I am trying to make an algorithm that counts the days between two dates, e.g. between 3/1/2012 and 3/2/2012.
What is the correct answer, or the most popular choice? Should be the one I use?
In this case, if I don't include both dates I am comparing, the days are 0; if I include one of them, the days are 1; if I inclu... |
The goal is to create an application that has objects that can represent some operations (add, subtract, etc).
All of those objects will have common functions and members, and thus will either implement an interface or inherit from an abstract class (Which would be better practice, this will be in C# if that matters?).... |
I know that exponential time algorithms should generally be avoided but are sometimes necessary. A case being the Traveling Salesman. How common are such algorithms in production software? Are these cases typically necessary or a result of rush jobs? I understand that many can be solved with a good heuristic. What is t... |
Here's an excerpt from "The C++ Programming Language"
template<classT> class List { // optimal
public:
class Link { /* ... */ };
List (); // initially empty
void put(T *); // put before current element
T* get(); // get current element
/ / ...
};
Can we make a class inside another class ?
How about other languages? For... |
Scala has been called complex with its rich feature set by many of my colleagues and some even blamed all those new features of it. While most programmers are aware of the OO-features, and at least the decent ones also know about functional programming, there is one feature in particular in Scala for which I am not awa... |
I inherited a project that I am managing and having to maintain pending the redevelopment of the code base. At the moment I am being tasked with adding little features all over the place and have gotten into the habit of returning null instead of zero in parts of the code where I am working on.
The problem is we have ... |
If we should favor composition over inheritance, the data part of it is clear, at least for me.
What I don't have a clear solution to is how overwriting methods, or simply implementing them if they are defined in a pure virtual form, should be implemented.
An obvious way is to wrap the instance representing the base-cl... |
I'm (still) working on a template-based XML editing program. It's a GUI-based XML editor that only allows users to add certain tags and attributes based off the requirements. You can see the current version here for an idea.
Now, I'd like to allow users to upload their own data templates, but I'm concerned about potent... |
Is there a metric analogous to the McCabe Complexity measure to measure how cohesive a routine is and also how loosely (or tightly) coupled the routine is to other code in the same code base?
|
Is there an advantage to piecemealing sql strings together vs conditional sql statements in SQL Server itself? I have only about 10 months of SQL experience, so I could be speaking out of pure ignorance here.
Where I work, I see people building entire queries in strings and concatenating strings together depending on c... |
I'm trying to improve my c++ coding technique by reading c++ source code. Which open source project would you recommend? Is the code of Boost C++ Libraries a good one?
|
We're trying to implement a strategy for how we transition our builds from RC to released retail code.
When we label a build as a release candidate, we send it to QA for regression. If they approve it, that RC then becomes our released retail code.
I liked the idea of "obvious" labeling of versions so that a user knows... |
I'm working on a fundamental programming class in college and our textbook is "programming logic and design" by joyce farrell(spelling?)
Anyhow, I'm struggling conceptually when it comes to initialized variables and named constants.
Our class is focusing on pseudo-code for the time being and not one particular language... |
I have an application that needs to store client data, and part of that is some data about their employer as well. Assuming that a client can only have one employer, and that the chance of people having identical employer data is slim to none, which schema would make more sense to use?
Schema 1
Client Table:
----------... |
I recently have been reading about move constructors in C++ (see e.g. here) and I am trying to understand how they work and when
I should use them.
As far as I understand, a move constructor is used to alleviate the performance problems caused by copying large objects. The wikipedia page says: "A chronic performance pr... |
This is something I did for a bus travel company a long time ago, and I was never happy with the results. I was thinking about that old project recently and thought I'd revisit that problem.
Problem:
Bus travel company has several buses with different passenger capacities (e.g. 15 50-passenger buses, 25 30-passenger bu... |
To make it more clear, this is a quick example:
class A implements Serializable { public B b; }
class B implements Serializable { public A a; }
A a = new A();
B b = new B();
a.b = b;
b.a = a;
So what happens if we serialize a and b objects into a file and deserialize from that file?
I thought we get 4 objects, 2 of ea... |
Let's say I need to add a drop shadow behind a box. Some old platforms do not support drop shadows, so I have to fake it by putting an image behind the box. Here's the pseudo code of how I'm currently handling this fallback:
if (dropShadowsAreSupported) {
box.addDropShadow("black");
} else {
box.putImageBehind... |
suppose I have a custom function such as
def greater(a, b):
if (a % b) % 2 == 0:
return 1
return 0
It defines how to compare two numbers and determine which is greater.
In this case, if the function returns 1 a > b else, a < b. Can I use inbuilt <built-in function sorted> orto create a sorted array of... |
I was writing some tests in Gherkin (using Cucumber/Specflow). I was wondering how abstract should I get with my tests.
In order to not make this open-ended, which of the following statements is better for BDD:
Given I am logged in with email admin@mycompany.com and password 12345
When I do something
Then something ha... |
I've programmed in Java for about 8 years and I know the language quite well as a developer, but my goal is to deepen my knowledge of the internals. I've taken undergraduate courses in PL design, but they were very broad academic overviews (in Scheme, IIRC).
Can someone suggest a route to start delving into the detai... |
I was talking with a colleague today. We work on code for two different projects. In my case, I'm the only person working on my code; in her case, multiple people work on the same codebase, including co-op students who come and go fairly regularly (between every 8-12 months). She said that she is liberal with her comme... |
http://php.net/manual/en/function.mb-convert-encoding.php
Say I do:
$encoded = mb_convert_encoding ($original);
That looks like simple enough. WHat I am imagining is the following
$original has a pointer to the way the string is actually encoded. Something like char * kind of thing. And then there are things like what... |
By introducing LINQ to SQL, I found myself and my .NET developer colleagues gradually moving from TSQL to C# to create queries on the database. Entity Framework made that shift almost permanent.
Now it's nearly 2 years that I use LINQ to SQL and LINQ to Entities and haven't used TSQL that much.
Yesterday, a colleague ... |
Many web sites when you registering an account present you with a form where you put in your details such as name and other profile data. One of the fields without a change is email address. It seems that there are quite a lot of web sites that double this field up. They have email address field and then re-type your e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.