instruction stringlengths 34 19.9k |
|---|
Consider the following enum and switch statement:
typedef enum {
MaskValueUno,
MaskValueDos
} testingMask;
void myFunction(testingMask theMask) {
switch (theMask) {
case MaskValueUno: {}// deal with it
case MaskValueDos: {}// deal with it
default: {} //deal with an unexpected or uni... |
Since my graduation (late 2005) I was working for the same company as a c++ software engineer. A year ago I was promoted as a software architect but I have found myself involved more and more in qualification and fixing bugs, level 2 support.
50% of my time spent in Notepad++ analysing the software logs and trying to f... |
Is better to keep our Membership stuff on the DefaultConnection and create another connection (another database) for our data? Or just one database for all?
If I have a MyAppContext and I want migrations for that context, It seems that I cannot have migrations for UserContext (In other words, I can just migrate one con... |
I came across the term 4GL(generation language) in reading about Oracle ADF Busniess components . I want to know what exactly is 4GL ?
This is the actual quote from the book Oracle Fusion Guide:
Oracle ADF Business Components is the business services layer of choice in Oracle Fusion
application development. Com... |
I've noticed that in JavaScript, when creating a Date, months are zero based, and days aren't.
For example:
var foo = new Date(2012, 1, 1)
produces February 1st 2012
Why is this?
|
Regarding growing of Behavior-Driven Development imposing acceptance testing, are use cases diagram useful or do they lead to an "over-documentation"?
Indeed, acceptance tests representing specifications by example, as use cases promote despite of a more generic manner (since cases, not scenarios), aren't they too sim... |
I'm developing a standalone application using java, I have a Login screen, wherein user enters his username and password. For each instance of the application, user have to enter his credentials. From a usability standpoint, I thought of keeping a remember me check Button. My question is, as I am not using any database... |
Suppose that I have an input stream interface, which defines a method for reading data. I also have a seekable interface which defines a method for seeking. A natural way of defining a input file is then to implement both input stream and seekable.
I want to construct a data decoder from the input stream interface so I... |
I would like to redistribute my app (PHP) in a way that the user gets the front end (presentation) layer which is using the API on my server through a web service.
I want the user to be able to alter his part of the app but at the same time exclude such altered app from the normal support and offer support on pay by t... |
I am trying to create a localized application in C# / WPF in Visual Studio 2012. For that I created two resource files and changed one string in a (XAML) window to use the resource files (instead of a hardcoded string).
I see the English text from the resource file, which is correct. However, I want to check if the oth... |
What are relative merits of something like a button on a piece of custom bizware that says, "press me to ask for a feature" or "click here if something didn't work right".
The problem I'm trying to remedy is the general lack of formality surrounding feature requests. Most specifically, the rate at which I receive walk... |
I have an open source project that is a add-in to TFS (ie it is for developers and those using TFS.)
It is currently using the GPL. But it occurs to me that the GPL does not really represent what I am trying to do with my license.
I want my code to be free to everyone who wants to use it. And if you modify it and use... |
Traditionally, a singleton is usually implemented as
public class Foo1
{
private static final Foo1 INSTANCE = new Foo1();
public static Foo1 getInstance(){ return INSTANCE; }
private Foo1(){}
public void doo(){ ... }
}
With Java's enum, we can implement a singleton as
public enum Foo2
{
INSTANCE... |
Okay, say I have a point coordinate.
var coordinate = { x: 10, y: 20 };
Now I also have a distance and an angle.
var distance = 20;
var angle = 72;
The problem I am trying to solve is, if I want to travel 20 points in the direction of angle from the starting coordinate, how can I find what my new coordinates will be?... |
Scala has no static-keyword, but instead has similar functionality through companion objects. Behind the scenes the companion objects are compiled to classes that have static methods, so all this is syntactic sugar. What are the advantages of this design choice? Disadvantages? Do other languanges have similar construct... |
I am going to adopt TDD in our team and one of the ideas I have is to review tests first. So one would write interfaces, mocks, and tests first, submit them for a code review and once interfaces and tests (think specification) are approved an actual implementation can be written (theoretically, can be done by another d... |
I have a fairly technical functionality requirements spec, expressed in English prose, produced by my project manager. It is structured as a collection of UI tabs, where the requirements for each tab are expressed as a lit of UI fields and a list of business rules for the tab.
Most business rules are for UI fields on a... |
I have been reading up on distributed hashing. I learnt that consistent hashing is used for distributing the keys among cache machines. I also learnt that, a key is duplicated on mutiple caches to handle failure of cache hosts. But what I have come across on memcached doesn't seem to be in alignment with all this. I re... |
As a small in-house dev department, we only have experience with developing applications for our intranet. We use the existing Active Directory for user account management. It contains the accounts of all company employees and many (but not all) of the business partners we have a cooperation with.
Now, the top managem... |
I am reviewing basic algorithms from a book called Algorithms by Robert Sedgewick, and I came across a problem in MergeSort that I am, sad to say, having difficulty solving. The problem is below:
Sublinear Extra Space. Develop a merge implementation that reduces that extra space requirement to max(M, N/M), based on ... |
What is it? I was reading Effective STL and came across it. I have also Googled it, but couldn't get any helpful info.
|
A lot of sources (e.g. Wikipedia) mentiones System requirement specification and Functional specification as two separate entities.
However, Wiegers in his book writes:
The software requirements specification is sometimes called a
functional specification, a product specification...
This is very confusing for me a... |
I have been reading the Scrum Guide from scrum.org and it says:
Development Teams do not contain sub-teams dedicated to particular domains like testing or business analysis.
In its literal translation this means that there are no testers which is confusing. How can they be suggesting this?
|
Currently we have code stored on a shared network drive and do not use any kind of VCS. The code stored on our shared network drive is always being backed up. We would like to keep things as close to they are now as possible, while using some kind of VCS software.
I am envisioning a centralized workflow with each d... |
I have previously forked other people's repos on GitHub, and I have noticed that issues stay with the original repo, and that I can't file issues on the forked repo.
I now have the following task. I am working for a small business where development was being done by one of the principals on his personal account. He h... |
My team is looking for a technical term which may or may not exist.
We are trying to describe an environment, such as a database, which has been built up over time with little or documentation about the change process that has gone into it. Generally these are legacy systems who's original developers have long since... |
I'm writing (in PHP) a client/proxy for a SOAP web service. The return types are consistently wrapped in response objects that contain the return values. In many cases this make a lot of sense - for instance when multiple values are being returned:
GetDetailsResponse Object
(
Results Object
(
[TotalRe... |
I'm developing a PHP login component which includes functions to manipulate the User object, such as $User->changePassword(string $old, string $new)
What I need some advice with is how to return a status, as the function can either succeed (no further information needs to be given) or fail (and the calling code needs t... |
I work in a Rest Oriented environment. The number of endpoints is quite large and span multiple applications. The dependencies between the endpoints are large in number as well and not very well planned. Applications have cyclic dependencies amongst each other. Unfortunately, there is no central location where all th... |
I have a question, it's about why programmers seems to love concurrency and multi-threaded programs in general.
I'm considering 2 main approaches here:
an async approach basically based on signals, or just an async approach as called by many papers and languages like the new C# 5.0 for example, and a "companion thread... |
So I'm learning about design patterns in school. Many of them are silly little ideas, but nevertheless solve some recurring problems(singleton, adapters, asynchronous polling, ect). But today I was told about the so called 'Prototype' design pattern.
I must be missing something, because I don't see any benefits from it... |
Unfortunately, Excel format is required for the project I am working on. I have no problems getting the data I need in objects and arrays, and currently PHPExcel is doing handling the document generation. It works, but it's slow and loopy. Was wondering if there is a more efficient server language to generate Excel doc... |
Is it possible, legally, for code to be publicly available online, but have copyright protection?
|
I'm creating a stack oriented virtual machine, and so I started learning Forth for a general understanding about how it would work. Then I shortlisted the essential stack manipulation operations I would need to implement in my virtual machine:
drop ( a -- )
dup ( a -- a a )
swap ( a b -- b a )
rot ( a b c -- b c a )
... |
There are a lot of analogies for HTML/CSS development; which can be a bit confusing for a beginner.
HTML = foundations/house
CSS = walls/blueprint/wallpaper
Is there any best practice here? Which one should we write first?
|
Many times there is the need to load external resources into the program, may they be graphics, audio samples or text strings.
Is there a patten for handling the loading and the handling of such resources?
For example: should I have a class that loads all the data and then call it everytime I need the data? As in:
Grap... |
What are technical specifications? Are they the same as design documents. If not, what is the difference and some examples?
|
I own a .co.uk domain, and I whenever I've dealt with Java-style package naming, I've gone with uk.co.domainname. Once I encountered package that did the following: co.uk.domainname.
Is one of these right, or is it something that's up to the developer's discretion? Is there some sort of convention that deals with this?... |
I have been programming for many years but I am still not comfortable with the concept of "Interfaces". I try to use interfaces but many times I don't see a mandatory use for it. I think this is probably because the projects weren't so big, or because interfaces are more useful when teamwork is involved.
So, making ano... |
I have recently been reading The Pragmatic Programmer which states that:
Details mess up our pristine code—especially if they change frequently. Every time we have to go in and change the code to accommodate some change in business logic, or in the law, or in management's personal tastes of the day, we run the risk of... |
Anyone know of a free license that offers the user the right to use the software freely, but not modify it or share it?
In other words, it is closed source, but it's free. And since it's gonna be a website it can only be used on this one website.
What would be a good simply license for this? If possible that it's not t... |
I am thinking of applying a real dependency injection library to my toy C#/GTK# desktop application. I chose NInject, but I think this is irrelevant to my question.
There is a database object, a main window and several utility window classes. It's clear that I can inject the database into every window object, so here D... |
I couldn't find a better topic but here it is;
1) When user clicks a button, code starts t work,
2) When another button is clicked, it would stop doing whatever it does and start to run the second button's code,
3) Or with not user interaction, an electrical power down detected from a connected device, so our software... |
I find that I understand much of the Javascript concepts used in the Google Maps API code, but then again there is quite a bit that is way over my head in syntax.
For example, the geocoder syntax seems to be of Ajax form, though I don't understand what is happening under the hood (especially with lines like results[... |
I want to ask – I am slowly learning jQuery.
What I see is an exact example of a God Object anti-pattern. Basically, everything goes to the $ function, whatever it is.
Am I right and is jQuery really an example of this anti-pattern?
|
I need to find or create a tool that analyzes the audio spectrum of a sound file (like a .wav or .mp3). I need to output the "volume" or power of x number of frequency bands and output the data as text. This will be used to produce a visualization, a graphic equalizer like you'd see on a stereo.
I am currently looking ... |
I've recently been delving into functional programming especially Haskell and F#, the prior more so. After some googling around I could not find a benchmark comparison of the more prominent functional languages (Scala,F# etc).
I know it's not necessarily fair to some of the languages (Scala comes to mind) given that th... |
I had read an interview with a great programmer (it is not in English) and in it he said that "a great programmer can be as 10 times as good as a mediocre one" giving reason for why good programmers are very well paid and why programming companies give many facilities for their employees. The idea was that there is a v... |
Possible Duplicate:
Which hashing algorithm is best for uniqueness and speed?
I have created a hash algorithm and would like to test if it is usable. What do I need to test and how?
|
What benefit could C++ bring to system administrators?
I am working on Windows and Ubuntu. If I learn C++, where could I implement it in system administration, Please specify some of its benefits.
|
As programming in JavaScript, I've noticed everything that can be done with statements and blocks can be done with expressions alone. Can a programming language work fine with only expressions? And, if yes, why are statements used at all?
|
In a Drupal programming guide, I noticed this sentence:
The theme hook receives the total number of votes and the number of votes for just that item, but the template wants to display a percentage. That kind of work shouldn't be done in a template; instead, the math is performed here.
The math necessary to calculate ... |
I'm creating a standard library for a programming language, and I'd like to license each and every single class or function in there under the MIT license, so they're completely FOSS.
All of the files reside in a single directory. Would it be enough to put a LICENSE.txt file in the same directory, containing the MIT li... |
I'm talking about giving clients professional looking code. The whole nine yards, everything you hardcore professional highly experienced programmers here probably do when coding freelance or for the company you work in.
I'm fresh out of college and I'm going into freelance. I just want to be sure that my first few pro... |
Background
I have a joomla based application. My customers sign up and they register as a user on the site. My customers (primary customers) then have their own space on the site that they can then setup their own customers (secondary customer).
Question/Problem
The problem I am having is that I need to tag each second... |
Suppose that you need to implement persistence, I think that you're generally limited to four options (correct me if I'm wrong, please)
Each persistant class:
Should implement an interface (IPersistent)
Contains a 'persist-me' object that is a specialized object (or class) that's made only to be used with the class th... |
I have a network game licensed under the AGPL that I modified to suit my needs. Theoretically, I want to charge people to play this game over a local area network that is set up in a private establishment of which I own all the local network infrastructure including the server and the game stations. would I still be r... |
I have a script, and now it's the perfect time to have an option to change theme templates.
I was looking forward to store these files in php files, or html files. with CSS file. I looked over some codes and I found that they use brackets to refer to the variable.
Here's an example of a template block:
<div class='bl... |
Can software with AGPLv3 license be used with GPLv3 project?
Can the resulting project be GPLv3, or must it have the special requirements of AGPLv3?
I am not very smart from clause 13 of GLPv3 that mentions AGPLv3.
Notwithstanding any other provision of this License, you have
permission to link or combine any covere... |
Problem Statement -
Given a NxM grid of 1s & 0s (1s mark walls, while 0s indicate empty chambers), the task is to identify the number of chambers & the size of the largest. And just to whet my curiosity, to find in which chamber, a cell belongs.
It seems like an ad hoc problem, since the regular algorithms just don't... |
I've come to notice that a lot of software that companies use for managing things like time, expenses, setting up phone systems, etc is very non-intuitive from a user experience point of view. I know personally I waste a lot of time just trying to figure out how to navigate these systems, especially if I don't have a ... |
What's the basis behind SHA-1 or SHA-2 or other Checksum algorithms?
I read about it here http://en.wikipedia.org/wiki/SHA-1#Data_Integrity
But I am still wondering about an answer in a layman's language.
Can I understand it as a very, very compressed code that can be translated back into original data?
Let's say, I ... |
In this post, Martin (the language's head honcho) writes:
[XML literals] Seemed a great idea at the
time, now it sticks out like a sore thumb. I believe with the new
string interpolation scheme we will be able to put all of XML
processing in the libraries, which should be a big win.
Being interested in language... |
I am fighting about a web application script optimization. I have an ASP.NET web app that reference jQuery in the master page, and in every child page can reference other library or JavaScript extension.
I would like to optimize the application with YUI for .NET.
The question is, I should put all the libraries referen... |
I was wondering if there's some software to manage a XP project. I'm starting a school project and I want to follow this methodology, but, we don't have a place to work. Each one works at home (in pairs), therefore I can't follow XP ambient patterns.
So, anyone knows of any software to manage this?
|
I have been reading up on arithmetic coding and, while I understand how it works, all the guides and instructions I've read start with something like:
Set up your intervals based upon the frequency of symbols in your data; i.e., more likely symbols get proportionally larger intervals.
My main query is, once I have en... |
We want to allow the same core service to be either fully implemented or, as other option, to be a proxy toward a client legacy system (via a WSDL for example).
In that way, we have both implementation (proxy & full) and we switch which one to use in the configuration of the app.
So in a nutshell, Some desired features... |
I am somewhat familiar with the concepts and benefits of Scrum. With that in mind, I am trying to improve the failing Scrum product management structure of a company I'm now working for that has three separate B2C products, catering to the same demographic and accessible on the same website. Each product has a product ... |
I am currently working on a rather large project, and I have used JUnit and EasyMock to fairly extensively unit test functionality. I am now interested in what other types of testing I should worry about. As a developer is it my responsibility to worry about things like functional, or regression testing? Is there a goo... |
I would like to implement some kind of manager class in my application. It will be in charge of loading textures, processing them, distributing them etc...
At first, I wanted to make a global variable that simply contains an instance of my manager class. I found this question: https://stackoverflow.com/questions/464657... |
I have a need to produce a simple dependency tree diagram. The input data would be in the following simple format:
ITEM_NAME DEPENDENCY
----------------------------
ITEM_101 ITEM_75
ITEM_102 ITEM_77
ITEM_102 ITEM_61
ITEM_102 ITEM_11
This means that ITEM_101 depends on ITEM_75 and ITEM_102 depends on item... |
So yeah, I'm creating a programming language. And the language allows multiple threads. But, all threads are synchronized with a global interpreter lock, which means only one thread is allowed to execute at a time. The only way to get the threads to switch off is to explicitly tell the current thread to wait, which all... |
What is the "stack" exactly?
I've read articles, tried comprehending it through my understanding, experience, and educated guessing of programming and computers, but I'm a bit perplexed here.
The "stack" is a region in RAM? Or is it some other space I'm uncertain of here?
The processor pushes bits through registers o... |
I'm looking for some input and theory on how to approach a lexical topic.
Let's say I have a collection of strings, which may just be one sentence or potentially multiple sentences. I'd like to parse these strings to and rip out the most important words, perhaps with a score that denotes how likely the word is to be i... |
I need an algorithm to place horizontal text labels for multiple series of points on the screen (basically I need to show timestamps and other information for a history of moving objects on a map; in general there are multiple data points per object). The text labels should appear close to their points--above, below, o... |
How could a random generator be implemented?
I'm not speaking about the invocation of a language mathRandom() method, but the implementation of the routines that lead to generate numbers totally random.
|
In http://www.json.org Douglas Crockford shows the specs of the JSON format in two interesting ways:
In the right side column he lists a text spec that looks like a YACC or LEX listing.
In the main body of the homepage, he put several images that gives us a simple way to visually understand the valid sequences that com... |
A class that performs both computations and data logging* seems to have at least two responsibilities. Given a system for which the specifications require heavy data logging, what kind of design patterns or architectural patterns can be used to avoid bloating all the classes with logging calls every time they compute s... |
In a C++ program that doesn't contain legacy C code, is there a guideline regarding the maximum number of levels of indirection that should be used in the source code? I know that in C (as opposed to C++), some programmers have used pointers to pointers for a multiple dimension array, but for the case of arrays, there... |
I appreciate you can't start an open source project with just an idea but would just a design be enough? Has anyone ever seen that done where a designer posts a design and developers join to start the coding?
|
I am designing a logic analyzer and I would like to implement some Matrix Algorithm.
I have several channels each one represented by a row in the matrix and every element in the column would be the state, for example:
Channel 1 1 0 0 1 0 1 1 0 1
Channel 2 1 1 0 1 1 0 0 1 1
Channel 3 0 1 0 1 1 0 1 0 0
I would lik... |
I have to read lines from a text file in sequential order. The file is a custom text format that contains sections. If some sections are out of order, I would like to look for the starting of the next valid section and continue processing.
Currently, I have some code that looks like this:
for (int currentLineIndex=0; c... |
I worked in academia a few years, but more on the D-side of R&D. The race for papers never appealed to me and I'm a practical not theoretical type, but I do like reading papers on certain topics (e.g. Google Papers, NLP, FB papers, ...) a lot.
How common is it that normally working developers submit papers to conferen... |
Is support for non-english characters common in programming languages? I mean, technically, I would think it is feasable, but I don't have any experience in anything other than english, so I don't know how common it is.
I know that there are non-english based programming languages, but can something like C#, C++, C, Ja... |
We are using TFS and SQL Server 2005 (looking to upgrade to SQL Server 2012 if that makes a difference). We store our database schema in a Visual Studio Database project (VS 2010).
When code is released to live we currently use the Visual Studio Database Project to build a script for all our schema changes. The problem... |
Can any one please explain this piece of code I found in the linux kernel source. I see a lots of code like this in linux and minix kernel but dont seem to find what it does (even if C compilers support that kind of function definition)
/* IRQs are disabled and uidhash_lock is held upon function entry.
* IRQ state (as... |
One of the problems web apps have against native apps, especially on the mobile front, is the constant need to re-download each web page on request. Ultimately, this leads to slower performance. Why if web apps only download new pages if they're actually needed, not because they're simply requested.
For example: perhap... |
I would like to publish part or full source code of one or more plugins (licensed under GPL, GPLv2, MIT or no license) in my website/blog. Website I am talking about is for everyone, free to use and free to copy code. Plus, is it okay if I do not provide any link to the source code/plugin? I will definitely give full c... |
The 'continue' keyword in Java (and probably in many other programming languages) is used to skip further execution of the current iteration.
Why was the name 'continue' chosen? Why not something more straightforward like 'skip' ?
|
I have read recently some articles (e.g. http://dailyjs.com/2012/09/14/functional-programming/) about the functional aspects of Javascript and the relationship between Scheme and Javascript (the latter was influenced by the first, which is a functional language, while the O-O aspects are inherited from Self which is a ... |
I always get confused about how to use the verb "to map" in the context of associating objects with each other, particularly if the mapping is directional.
Is there a distinction between
mapping users to IDs
and
mapping IDs to users
In the given example, which would be the better way to put it?
|
I've built a few API's using the complete rails stack. In each project there have been multiple uses for rails core features. Each of the API has had management screens for monitoring usage, managing authentication keys, etc. Is there such thing as an API without a management front end?
|
I need a very simple pseudo random generator (no any specific quality requirements) and I found Microsoft's variant of LCG algorithm used for rand() C runtime library function fit my needs (gcc's one seems too complex).
I found the algorithm here:
http://rosettacode.org/wiki/Linear_congruential_generator#C
However, I w... |
I'm in a new position where I need to process a flat files on a regular basis. The last time I did this was 5 or 6 years ago but as part of the file layout I received control totals. It gave me simplistic information on the file like the total number of records as well as sums of the important fields. This helped me... |
Zend's Coding Standard Naming Convention says
Functions in the global scope (a.k.a "floating functions") are permitted but discouraged in most cases. Consider wrapping these functions in a static class.
The common wisdom in Python says practically the opposite:
Finally, use staticmethod sparingly! There are very few... |
I'm building a blogging site for learning, with a PHP/MySQl back-end. All of the user input is handled with forms sent in POST requests.
Will using JSON somehow make it cleaner, or easier to maintain or add features? Or am I just adding an interchange format for no reason?
So essentially, what functionality would be be... |
(This is mainly aimed at those who have specific knowledge of low latency systems, to avoid people just answering with unsubstantiated opinions).
Do you feel there is a trade-off between writing "nice" object orientated code and writing very fast low latency code? For instance, avoiding virtual functions in C++/the ove... |
What is a better approach when it comes to performance and optimal resource utilization: accessing a database multiple times through AJAX to only get the exact information needed when it is needed, or performing one access to retrieve an object that holds all information that might be needed, with a high probability th... |
Edit: my language allows for multiple inheritance, unlike Java.
I've started designing and developing my own programming language for educational, recreational, and potentially useful purposes.
At first, I've decided to base it off Java.
This implied that all the code would be written in form of classes, and that code ... |
Is there a difference between
public class A extends AbstractB implements C
{...}
versus...
public class A extends AbstractB
{...}
abstract class AbstractB implements C
{...}
I understand that in both cases, class A will end up conforming to the interface. In the second case, AbstractB can provide implementation for ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.