instruction stringlengths 34 19.9k |
|---|
As far as I recall, this has been the ongoing trend of the past, I'm just a student, so I might be wrong:
Long ago: Integer numbers and calculations. Very precise, however cannot present a big range.
At a later point: Added single-precision floating point numbers (floats), and also added FPU's which are incredibly fas... |
I was thinking of a data structure that I cannot describe better than with the word "book", or more exactly "binder".
I was wondering if this had already been implemented in libraries like Boost or others.
Principle
It's a data structure that allows constant-time random access and amortized constant time insertion/dele... |
Is possible to create and download a video file only on the client side?
Suppose that we have an animated canvas like in this JSFIDDLE. Please see this snippet:
...
var stop = false;
setTimeout(function () {
stop = true;
}, 1860);
...
if (!stop) { requestAnimationFrame( draw, 10 ); }
So, my animation duration is 1... |
We need to do pre-check-in code reviews. We are using Visual Studio and TFS.
The built in code review functionality, is a bit odd to me. If I "reject" a check-in and comments what needs work, the review goes away.
When the developer then makes the changes, he requests a new review, and I start all over again.
Now, let'... |
So I just was hired at a place that had only one Developer and that was the co owner. Their employee handbook had something to the effect of the following.
All IP, inventions or software you develop while at X company is the
property of the company. Additionally you will have to provide a list
of all prior invent... |
As a side-effect of an embedded project I've been working on, I've developed a small operating system for an ARM processor. While the OS and my user code are in separate directories and have clean boundaries between them, they're built into a single image using a single Makefile.
I'd like to release the OS as open sour... |
I am designing a web app for a client who wants to keep some of his business rules private, we have an NDA. In a nutshell, customers use the app to book a service, and employees use it to keep track of bookings. Since the front end is public (and untrustworthy), all of the decisions that are determined by business rule... |
I would like to know if CTRL+C (copy) keyboard shortcut works on all Windows versions above '98, all Non-English Windows and on all keyboards (English, German, Chinese...)?
|
I have a network I'm responsible for routing signals through. You can think of the network as a directed graph of nodes (hardware) but each edge is really a pipe capable of fitting a specific bandwidth, I can route signals to any index on that pipe and may have multiple signals of different 'size' going across the pip... |
Is the visitor pattern useful in languages supporting class extensions?
Why bother implementing it, when you have open classes or can subclass. If you want new functionality for a class you could just subclass it, so unless I'm missing something, is it still (very) useful in languages supporting class extensions?
|
I've gotta build a webservice for employee information, and I'm trying to plan it out.
To clarify, we already have a REST-ish service for People and a separate REST-ish service for Companies.
This service will specifically be for the relationship between those two (all the data will be delivered from services to the da... |
I've been asked a theoretical design question with an eye upon the GoF patterns.:
"Given a design for a tree using a standard visitor pattern, how would your design look to allow a user to choose between om pre-order, in-order or post-order traversals?"
I'm thinkin of just letting the visitor be, but give the traversal... |
I am trying to configure a mysql database table that I can use as a per user/group permissions table. Almost like what Facebook has, for a local company intranet site.
What is the best possible way to design this table, that would allow me to find user permissions with the fewest amount or queries?
|
In Ruby, I have a use case for a few common configuration options, e.g. NOOP, TRACE, SILENT. Right now I am using local vars instead of globals and passing them around all over the place and it's a pain. I be perfectly happy to use globals for these, if I could run a block where the globals can be temporarily changed a... |
I will be extracting certain bits from log files using regular expressions to filter out bit of data. Initially I was going to do this with Python. I later started to think about the fastest way I can perform this task. This lead me to parallel programming. I remember hearing somewhere that Python can't be truly parall... |
I was wondering, without using any kind of user info (id, nickname, age, etc), what would be the best way to assure filename uniqueness using php in a large database with high traffic and most probably simultaneously between many users? I am using $file = time() for example but I would like to know if this should suffi... |
Originally, I started off doing jQuery plugins, then moved onto Backbone.js applications, then been experimenting with MicroJS MVC modules, but these days I'm even wondering if there is any need for them at all.
Recently, I've been prototyping a new application, and the code is slim, sleek, and beautiful. I then procee... |
I am building an Android guitar application and I need a way for GuitarString objects to notify multiple listeners that it has just been played. This includes the current Activity and all instances of GuitarStringView that have it as their GuitarString (the guitar is displayed twice, zoomed in & out).
I have so far han... |
I have a domain model in which I use a few aggregation relations, i.e. an object of class A contains zero or more objects of class B.
I use Java for the implementation and I represent such an aggregation as a field of type List<B> in A, and a field of type A in B. In this way, each object can be the root of an aggregat... |
So while I was learning HTML I encountered CSS. It's interesting because with CSS you can make a webpage cool or more beautiful. But since it's more about colors, designs, styles etc., I can't know the results of my CSS codes. As someone who is visually impaired, why should I learn CSS if sighted people can always desi... |
I want to create a changelog for my application to display the set of recent changes to the user. But I'm not sure where I put it.
Do I create a text file and write in it? Where do I put this text file then?
Or do I use an action in the menubar and display the changelog in a new window when clicking on the action?
|
AFAIK, the term dispatch means just a method resolution and calling. It doesn't matter whether it is static or dynamic. I saw many people are using a term like static dispatch and dynamic dispatch.
What makes me confusing is there're also some mysterious descriptions. I was trying to understand what is multiple dispatc... |
On a 2D plane, I have 2 rectangles.
I want to find the closest pair of points (one on each rectangle), which are closest to each other. By points I mean the corners of the rectangles. And no, they do not overlap.
Is there any way to do that other than checking all the distances between all the combinations of points an... |
I am currently in the process of selecting a widget framework to be used for a new project. Current choices are Dojo/ExtJS4. We are leaning on ExtJS4 but might have some issues with the licensing.
From the Sencha license page:
Our open source license is the appropriate option if you are creating an open source applica... |
When developing features with TDD, I create a test for each combination of feature and case. So, one test for creating user successfully, one for validation errors, and one for database errors. I don't test each one with many different types of data, in general, as I write the tests to flesh out features, less to catch... |
With reference to iOS 7.
I couldn't find any Apple documents with regards to this.
Are we able to download any size of documents and manage them ourselves (within our app say < 100MB)?
Example, we roll out new content every month. Thus after downloading contents for this month, we should remove last month's content to ... |
The situation is this.
I'm a junior developer for a small government IT project. We don't have anything of continuous integration or a automated testing framework. But the idea is to be developing this kind of thing/improving our developing environment.
The product is a data processing algorithm that then displays in... |
I'm currently working on a pet project with two of my buddies. This web service will provide basic functionality such as Login/Password Modification/Registration etc.
All of us are comfortable with jQuery and ASP.NET. My friend's idea is to -
Set up a web service on the same domain and send it data for registration, v... |
I noticed Visual C++ 2010 (my current environment) and XCode both allow non-standard single-line comments in my C programs. Since these are both my target platforms, I assume it's fine to use it? VC++ 2010 doesn't support C99, so I'm limited to C89, though I know C99 added support.
|
My manager told me to include 15 line copyright notice on top of every file.
I am not sure whether I need to include in sql, xml, txt, documention, config files or even html templates.
In which files should I include copyright notice?
|
I am doing research on squares, and I thought of using constraint-satisfaction-problems solvers for proving or disproving some conjectures. As a simple example problem, consider the following task:
Draw two green squares and two red squares, such that:
- All squares of the same color are interior-disjoint;
- All squa... |
There is a finite set of points on a plane (about 1500 points in the current task). I need to construct triangles on those points such as each triangle lies completely inside one larger triangle:
Now I want an algorithm to maximize the number of such triangles. Where can I start?
I think one of the ways would be to ch... |
Why is it not possible to set a function returning an address while it is possible to set a function that returns a reference.
int* returnByAddress()
{
int x = 20;
return &x;
}
int& returnByReference()
{
int x = 30;
return x;
}
int main()
{
returnByReference() = 23; // possible
int x = 23;
... |
I have an app that is made up of multiple different components, each with their own version number and history. I would like to create a version number of the entire application, preferably somehow based on the version numbers of the components. I am not sure if this is possible at all, but I would like:
The version n... |
I am working on a highly customized shop software, based on a open-source one, written in PHP and usual web techniques (CSS, HTML, JS).
I did a lot of customization in the past months/years and developed specific, individual features which are necessary to be successful at our branch.
The shop and the project files are... |
So, I'm trying to use an NTP server to help me synchronize an app across two Android devices (to have them perform some action at the exact same time, give or take < 20 ms).
I'm using the SNTP client code here as provided from the StackOverflow post here and it works just fine. The problem is that at the exact instant ... |
How would you unit test the PerformUpdate method in the sample below? This is a (very) simplified version of some code that performs updates against a database where the schema is dynamic and represented by the fields collection.
EDIT: If it is not clear what I am asking, I would like to know how different developers w... |
What do I need to consider to determine which design I choose when I have the following scenario?
There are two cases to considerer;
Given T a generic class, I have to do something with multiple T's (Iterating each one of them).
In other cases, with the same T, I have to process just once.
In both cases, independent ... |
I have a general question on where to put validation.
I have an asp.net mvc that gets/sets data from/to a DataSet. Currently, the fields in the form are validated by the form itself (e.g. for invalid length, range, etc.). Is it a good or better idea to transfer these validation checks into the DataSet? The downside is... |
I am a big fan of agile development and used XP on a very successful project a few years ago. I loved everything about it, the iterative development approach, writing code around a test, pair programming, having a customer on site to run things by. It was a highly productive work environment and I never felt like I was... |
I'm building free games in javascript, with my code is easily accessible by looking into the html of the webpage.
I really don't mind people looking at my code (for curiosity, or to learn something). But I don't want anyone to use my code to make their own games, or steal the art I've done.
With this goal in mind, what... |
We have developed an application that is sold as an online service. After some time we realized that some of customers would need/prefer/require to have it installed locally on their intranet. However the application was developed using scripting language and we wouldn't want to allow clients to access the source code.... |
I'm working in a fairly old yet sufficiently unproductive code base that I need to create a(some) script(s) to help me out.
For example:
we add a version # and timestamp at the header of the file (yes we use a CVS based sys but this is beyond my control).
we have duplicated layout code for different languages (this... |
I'm using OOP and MVVM in a WPF c# application. The goal is for the resulting object (data-bound to user interface) to accurately represent a product. One specific area of the product is highly configurable. For conceptual purposes, imagine a boat which can have various means of propulsion. A submerged prop motor or ab... |
I can fully appreciate the benefits of a package manager like Python's pip, Node's npm, or Ruby Gems since they're doing much more than adding files to your applications path.
Maybe I'm missing the point, or I'm being obtuse, but here are the negatives I can see:
Separate step when building a project
Separate dependen... |
How do you manage the dependency of one unit test on another unit test succeeding?
So, supposed I have a class and this class has say 5 methods. I create like 2 dozen unit tests (test methods) for that class. each unit tests tests something specific and unique - so nothing is tested twice.
So for instance I have a coup... |
I've read in PHP Advanced and Object Oriented Programming by Larry Ullman that it is good programming practice to delete object immediately after use but reason is given nowhere.
I am a student web developer and objects in web applications are deleted automatically as soon as the script finishes. So, there seems no goo... |
I have been programming for several years now, and back then (learning PHP) I've didn't learn to program using classes, MVC-logic or using any frameworks. I found my self solving my problems very well using my own functions.
Eight months ago I was recruited to a start-up, to develop a huge social platform. I have been ... |
Suppose I'm writing some C++ code to visualize "Foo" objects. I have two ways of getting a "Foo": computing it from data, or from taking the pieces of a precomputed "Foo" and building a new "Foo".
Now, once a "Foo" is computed it's guaranteed to be good for visualization, but changing it may break this assumption. Ther... |
I'm used to working in a large development environment where code is peer reviewed and tested by the client, who is usually an IT person themselves. I am now working at a very small company where I'm not just the only developer, but the only IT person at all.
I'm inclined to have my coworkers and/or boss take a look at... |
Let's say I have a DatePicker control and I allow my US clients to type something like
"1/1" in it and hit tab go to next control. So I will parse that date for them as "01/01/2014" and some more similar patterns. But they are all US-based so they are
"MM/dd/yyyy"
Now my question is about other formats? What If I wa... |
I'm interested (for learning purposes) in creating an Namespace Extension for Windows that is similar to Dropbox or SkyDrive. What I'd like to do is integrate directly with Windows Explorer like those services that appear as a "connected drive":
When clicking on the connected folder, I'll be interacting with my own si... |
I have a visual studio solution that has, amongst other project the following three:
NamespacePrefix.NancyFX.csproj: Some Nancy modules
NamespacePrefix.NancyFX.IISHosting.csproj: A web solution to host the nancy modules
NamespacePrefix.NancyFX.Selfhost.csproj: An exe to host the nancy modules
In addition to rest serv... |
Generally variables are named in the singular Car car; and arrays and list with the pluras: List<Car> cars; or Car[] cars; But what about nouns like fish or media* that are already plural?
*already lost the battle to have the class called Medium.
|
I currently work as a .net developer and have coming up to 3 years experience in the industry as well as a degree in computer science specifically software engineering (I know that means nothing but just wanted to explain that I'm not your general back bedroom programmer).
When I finished Uni, I started contracting fo... |
If I do .1 + .1 + .1 in Python, I get 0.30000000000000004. (I am not asking about Python in particular, and do not want Python specific answers.)
The only problem I can see with this is 0.30000000000000004 != 0.3, so I need to take care in how I compare floats. Are there any other problems I need to be aware of with fl... |
After doing some (more-or-less) "low-level" async socket programming years ago (in an Event-based Asynchronous Pattern (EAP) fashion) and recently moving "up" to a TcpListener (Asynchronous Programming Model (APM)) and then trying to move to async/await (Task-based Asynchronous Pattern (TAP)) I've pretty much had it w... |
I am struggling with naming convetions in C# I do not know when to use PascalCase or camelCase. I have read Microsoft's naming convention, but I got lost ther http://msdn.microsoft.com/en-us/library/ms229045(v=vs.110).aspx
As far as I know this is correct:
public int Number;
private int number;
public void Method();
pr... |
I have a scenario where I will be receiving messages through a socket connection. I also need to keep a list of 100 messages (such as List) and periodically toss out old messages from the list when a condition is met.
List<Message> MessageList = new List<Message>();
Message CurrentMessage = new Message();
public void... |
I came across an enum definition :-
typedef enum NSInteger {
kBorderTypeNone = 0,
kBorderTypeLeft = 1 << 0,
kBorderTypeRight = 1 << 1,
kBorderTypeTop = 1 << 2,
kBorderTypeBottom = 1 << 3
} BorderType;
and also (possibly) it can be equivalent to
typedef enum NSInteger {
kBorderTypeNone ... |
I'm from the AS3, JavaScript, and similar "web languages" where loading means the code is being downloaded from the server, and can't run reliably until enough has been fetched to the user's computer.
However, what happens during a loading screen in software and games in which all the information already exists on the ... |
On Github, I've run across a pull request which it implements a feature I like but feel isn't quite intuitive and could be better. The maintainers of the original repo have so far declined to accept it (or explain why). It was requested 3 months ago so I suspect they won't take it without changes.
I'd like to improve u... |
In my database I have a table that looks like this Master(ID, Name, Attr1...). Every ID will have at least 1 entry in additional tables that have additional attributes. Those tables specialize the master table.
Spec1(MasterID, Attr2,...)
Spec2(MasterID, Attr3,...)
...
So, not sure how to map this to object oriented de... |
This is only anecdotal evidence but from my past encounters with programmers at various workplaces the programmers that understand the fundamentals of parsing and interpreting seem to be overall better programmers. They also tend to be less religious about their tools. My subjective experience indicates they tend to wr... |
A colleague of mine works as a consultant. He is recently asked to help a software development company to improve their processes. The company is aware of some of the issues, like the number of bugs or the fact that they can't release their lead product more often than once per year, but nobody there knows what to do.
... |
I have following C# code. It helped me to avoid some code repetition in a good way.
The ExecuteQueryGenericApproach<T> method receives a Func generic delegate as argument. The delegated method has a parameter which receives IDataRecord as argument. That is, the ExecuteQueryGenericApproach<T> method provides the requ... |
I have a software requirement, that needs to store the user that made the last modification to another object, for every object (assume that all objects are already mapped and into a BD).
So we have the ParamBase an object that holds the basic data for every object, this will be a super class, every other parameter in ... |
After reading this article I realized that I really didn't read any "serious" source code during my 3-years as a professional developer.
Recently I started a new web-project which makes heavy use of AngularJS, so I decided to start my reading - or, better, decoding [as the blogger wrote] - activity from something that ... |
Is CSV considered a good option against XML and JSON for programming languages?
I generally use XML and JSON (or sometimes a plain text file) as flat file storage. However, recently I came across an CSV implementation in PHP. I generally have seen CSV used for inputs in Excel files though, but I have never used it wit... |
Are design patterns (e.g. factory pattern, observer, etc...) required to be known to write good code?
I often have no idea of what people mean when they talk about inserting pattern name here pattern and sometimes I realize I‘ve implemented that pattern without knowing it even had a name.
I‘m a self-taught programmer ... |
This question might seem strange, but it's something I've faced sometimes. I've been trying to adopt DDD, however I'm always facing the problem of anemic domain models. The problem is that when I start to think about what should be the behaviors of the domain objects, nothing comes to mind. I've started then to seek on... |
Recently I learnt about a new methodology based on waterfall and scrum: Water-Scrum-Fall.
Some say that is the new "reality" and is what scrum pragmatist use nowadays....
But, from the definition of "Avalanche":
The Avalanche model is a Software Engineering project management
anti-pattern, it is a combination of a ... |
I found this statement from the gang of four's "Design Patterns" particularly odd; for some context, the authors are comparing inheritance versus composition as reuse mechanisms [p. 19]:
"...you can't change the implementations inherited from parent classes
at run-time, because inheritance is defined at compile-time... |
The problem
C# project consisting of WCF services used by a Flex application.
A customer may request a functionality change that requires me to alter code to work just for them. It could be a single line of code in a method or maybe a method acts in a totally different way for customer x.
My Ideas
Use branches for cus... |
I am using signals (specifically Boost signals2) to create an event driven protocol API and model.
Most elements have their own signals, and there are usually multiple of each element.
Consider a basic entity, a user; amongst others, the user may leave the system, so I need to have a leave signal.
The question is, shou... |
I am not sure what is the best way for the tasks below: threads, AsyncTasks, Loopers, services? Why? Are there other candidates?
I need threads/Tasks/Services/other for:
Plotting data, (refreshing should be done let's after after specific amount of data has been read)
Generating data, (must being done during whole app... |
I know log rotation is a feature seen in application servers like Oracle's Weblogic. I would like to understand:
What is actually meant by log rotation?
What is it useful?
Who performs the task?
Is this duty performed by the logging frameworks that the developers use or is it handled by the servers themselves? Would ... |
I want to know what should I write in copyright part? I mean the copyright part when you right click on the executable, click properties, and click the details tab.
I was developing a little tool that parses some information from output files. It's been a year now and somehow it became something more than a simple, per... |
I'm working on a modest sized web application that receives circa 30k unique users per day, this is an MVC C# application hosted on 3 web servers and backed by a single SQL server, everything is hosted in one data center.
The issue is we are seeing dom complete times upto 3 times slower in some parts of the world. We ... |
I have been reading (and watching presentations) about subjects like: DDD, TDD, BDD, SOLID (principles), design patterns, clean code, clean architecture, agile project methodologies.
All in all I have quite a clear view on how to approach agile software development. Especially the DDD part really helps in communicating... |
I'm refactoring some custom JavaScript modules written to support our mapping functionality. I'm looking to make them much more unit-testable and be able to plug pieces in and out more easily.
My question is related to having UI manipulation and business logic be in the same module. I know that having the UI part makes... |
I am very new to HTML5 (and web coding in general), and I am trying to create an interactive calculator. I will try to explain this as clearly as I can.
The basic idea is that the user will use pre-set equations to add numbers with the calculator. All of the buttons on the calculator will have an animated 'push down' e... |
I'm wondering how I seamlessly include a JavaScript unit testing framework into my workflow.
The context is, we have an existing data processing algorithm + webapp to display it, with no automated testing or continuous integration.
We use Eclipse as our IDE.
For the webapp JavaScript modification, it would be nice to... |
I want to pass a parameter to a function as below for clarity. It doesn't give any error. But is this a bad practice. Do I have to avoid this.
test('','','',$d='text','');
function test($a, $b, $c, $d, $e){
}
|
With relation to what's considered good OOP engineering principles, SOLID, DRY, KISS etc
I am wondering whether to complete multiple tasks within one loop when easily done.
The problem is that this conflicts with some principles (SRP), but could also partially lean in favor of others (DRY, KISS).
A simple example would... |
I have read that we should only catch exceptions that can be handled, which makes catching the base exception class (C# in this case) a bad idea (on top of other reasons). I am currently part of a project in which I so far have yet to see anything but the base exception being caught. I mentioned that it is considered b... |
I have an app that have multiple users. In my app an user can
- create contacts (people)
- edit contacts
- view contacts
- create an entry to agenda
- view entry from agenda
Also I need that User A is allowed to view User's B contacts but is not allowed to edit that contact.
User B can view and edit User's A entries in... |
In the following image for the State Pattern from Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
I'm trying to persist the SalesOrder entity into the database. Normally I would have a salesOrder table in my database with a field currentState pointing to the current state of the entity.
This i... |
I'm wondering how should testing take place in small teams (or start-up teams).
I'm talking 5-10 developers that are assigned to multiple development tasks.
From my experience there is little to none testing in the development process, but I also hear small teams can get through the initial level of software process ma... |
It is considered better to have a separate factory class than having static methods in same class. See this question.
But the standard API uses both approaches.
Separate factory:
DatatypeFactory.newInstance().newXMLGregorianCalendar(...)
Static methods in same class:
Calendar.getInstance(...)
Why is this? In what cas... |
I am a experimental physicist. In our research, we have our experimental data in a 400*400*400 matrix(x, y, z axis of a 3d space), each entry is associated with a value("brightness"). We expect the brightest entries will form a closed path in the 3d space. But some portion of the path is always too dark to identify, al... |
Historically a HLL is something like C, Fortran or Pascal and a VHLL is something like Ruby or Python. I am familiar with the terms 4GL, 5GL, DSL and LOP, and those who aren't should read Wikipedia for the definitions. I'm looking for UHLLs.
My question is: are there any computer languages out there which are another o... |
Let's say we have a website requirement to allow User functionality. Simple!
We create the UserModel, UserController and UserView. Works perfectly.
However, let's assume that User has a many-to-one relational table connected to it titled Child which also has its own MVC components: ChildModel, ChildController, ChildVie... |
I have observed a strange trend in the company I work at.
There are people who insist that there should be a list of tasks. They estimate those tasks, implement them, and try to meet their commitments. However, while they are coding, the requirements are likely to change. The priorities shift, the tasks increase or dec... |
I have several types of XML document.
The format of (i.e. the elements in) each document type is defined in an XSD.
Is there a convenient way to create HTML elements (or ASP.NET controls) on an ASP.NET form, to display/edit the elements in (contents of) an XML document, given the XML document and/or the document's XSD ... |
I am developing a jQuery mobile app. In this app, i often use Mustache.js templates in separate html files. Actually, every template is needed by the user, but my app loads a template (via GET method) only when it is needed.
For now, all the templates are small and they're all used by the client at runtime. But obvious... |
I have made a simple application which searches for files and folders on users computer. Since, I am a student currently in my 1st year and don't have any formal training and have made my application while I was still learning C# and .Net framework, I didn't have knowledge about unit tests and other good testing method... |
We are putting together an API to provide our vendors some simplistic direct access. I've built APIs before, and have always routed them as such:
{controller}/{action}/{id}
My boss, however doesn't think that's intuitive. He thinks we should route our API like this:
{controller}/{id}/{action}
His reasoning is this: "... |
I'm attempting to try out using unit test in for the first time in new iOS activity for work. I love the idea of unit testing, but always find the specifics to be... messy.
I get the general principals -- I have read a lot about it so I wanted to ask a specific question.
My situation:
I have a UITableView that can ha... |
I'm building a report for an end user.
They would like to see a list of all widgets... but then also like to see widgets with missing attributes, like missing names, or missing size.
So i was thinking of creating one method that returns json data containing all widgets... and then using javascript to let them filter ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.