instruction stringlengths 34 19.9k |
|---|
I am re-factoring some code and an having an issue with retrieving data from two parallel processes.
I have an application that sends packets back and forth via different mediums (ex: RS232, TCP/IP, etc). The jist if of this question is that there are two parallel processes going on.
I hope the picture below displays w... |
Most academic researchers I know target just *nix, and rely on Cygwin to make their applications available on Windows. I have tried many of these projects and always found them too unstable for serious use when running on Cygwin.
Uwin looks like a promising alternative to Cygwin. I haven't tried it yet, but I found sev... |
How do you keep released binaries under version control?
This allows to track which stuffs are changed between each release.
I mean to separate the released binaries from source repository.
The released binaries are either built from Continuous Integration software or manually compiled.
|
Event Sourcing was popularized by LMAX as a means to provide speed, performance scalability, transparent persistence and transparent live mirroring. Before being rebranded as Event Sourcing, this type of architectural pattern was known as System Prevalence but yet I was never familiar with this pattern before the LMAX ... |
I have been learning C++ and I am having a hard time understanding null. In particular, the tutorials I have read mention doing a "null check", but I am not sure what that means or why it's necessary.
What exactly is null?
What does it mean to "check for null"?
Do I always need to check for null?
Any code examples wo... |
Most mobile platforms (such as Android, iOS, Windows phone 7 and I believe the new WinRT) can kill inactive application processes under memory pressure. To prevent this from affecting the user experience applications are expected to save and restore their state as their process is killed and restarted.
Having applicati... |
I read an article that says Scala handles concurrency better than Java.
http://www.theserverside.com/feature/Solving-the-Scalability-Paradox-with-Scala-Clojure-and-Groovy
...the scalability limitation is confined specifically to the Java programming language itself, but it is not a limitation of the Java platform as a... |
Upon searching for a fast primr algorithm, I stumbled upon this:
public static boolean isP(long n) {
if (n==2 || n==3) return true;
if ((n&0x1)==0 || n%3==0 || n<2) return false;
long root=(long)Math.sqrt(n)+1L;
// we check just numbers of the form 6*k+1 and 6*k-1
for (long k=6;k<=root;k+=6) { ... |
Recently I have become interested in learning Javascript for web development. I currently know HTML, CSS, and beginner/intermediate C++. I understand polymorphism, inheritance, and all of that fun stuff. Would any of these skills carry over to Javascript? In what key ways does Javascript differ from C++?
|
Having to work with large files now, I would like to know when the java libraries will start switching to long for indexing in their methods.
From Inputstreams read(byte[] b, int off, int len) - funnily there is long skip(long) also - to MappedByteBuffer to the basic indexing of arrays and lists, everything is adressed... |
(I will show examples using php and phpunit but this may be applied to any programming language)
The case: let's say we have a method A::foo that delegates some work to class M and returns the value as-is.
Which of these solutions would you choose:
$mock = $this->getMock('M');
$mock->expects($this->once())
->metho... |
I am programming in Objective C, iOS. I create a Class A which is a parent class, and Class B inherits to Class A.
Now I have Class B variables which I also need to use in Class A. And also one another Class C, Class A add in Class C (not inherits), and I want to use Class B variables in Class C.
How can I access? I ha... |
I'd like to write down the design of my program to understand the dependencies and calls better. I know there are class diagrams which show inheritance and attribute variables.
However I'd also like to document the input parameters to method functions and in particular which calls the methods function executes inside ... |
Since Java 1.6 the JVM can run a myriad of programming languages on top of instead of just Java. I conceptually understand how Java is run on the Java VM, but not how other languages can run on it as well. To me, it all looks like black magic. Do you have any articles to point me to so I can better understand how this ... |
I need to package an internal project as a debian package. That project will never ever be downloaded by anyone outside of our company, but the debian packaging system insists on there being a copyright file.
What should I choose for this file? There's a remote possibility that a sysadmin could stumble upon that packag... |
I was hired by a marketing company a year ago initially for link building / SEO stuff, but I'm actually a Web developer and took the job just in desperation to have one (I'm still quite young and just finished 2nd year of University). From the 3rd day my boss realised that I'm not into that stuff at all and since he ha... |
I've been following the successful Git branching model guide for most of my development. I still wonder if the way I handle bug tickets is correct.
My current workflow: Once I accept a bug ticket I will do a git checkout -b bug/{ticket_number}, create a single commit as a fix and then checkout develop and do a git merg... |
I need to write several passages of text in an offer to the client about the security layer in ASP.NET MVC web solution.
I am aware of security that comes along with MVC 3 and an improvements in MVC 4. But all of them are non conceptual, except for AntiForgeryToken (AntiXSS) and built-in SQL Injection immunity (with a ... |
As a learning experience, and as project, I am attempting to write a CMS module for ZF2. One of the functionality I would like to have is the possibility of adding dynamic contents in the pages by calling PHP functions in the view scripts.
However, I do not want to give the users freedom in writing PHP code directly in... |
I was recently discussing dvcs with a coworker, because our office is beginning to consider switching from TFS (we're a MS shop). In the process, I got very confused because he said that although he uses Mercurial, he hadn't heard of a "branch" or "checkout" command, and these terms were unfamiliar to him. After wonder... |
I've been doing a lot of reading these last two days on Microsoft Prism, but the thing I'm still not very sure of is what does the future look like for it? I know that version 4.1 was just released a few months ago, but besides Microsoft's own documentation, I haven't found many blog posts written in the last year on t... |
I work at a research organization and we publish a lot of large-ish documents, usually organized in sections. What I want to know is how best to present these multi-section documents on our website.
Presently, what I do is load the entire document as a single page, with each section as its own div. Then I show and hide... |
Is there one?
All the definitions I can find describe the size, complexity / variety or velocity of the data.
Wikipedia's definition is the only one I've found with an actual number
Big data sizes are a constantly moving target, as of 2012 ranging from a few dozen terabytes to many petabytes of data in a single data... |
We're considering converting our WinForms application to a WPF application. Part of the reason is that WPF/XAML seem to be the future. We are also using third party controls that we would like to be able to phase out. Making this conversion seems like a pretty big and time consuming undertaking, though. Would it make s... |
SO I'm building an application for uploading files. We're paying scientists to contribute information on pests, diseases and bugs (for Plants). We need the ability to drag and drop a file to upload it.
The question becomes since the users will be authicentated and setup by us, will it be necessarcy to include a virus ... |
What are best-practices for logging deep within an application's source? Is it bad practice to have multiple event log entries for a single error?
For example, let's say that I have an ETL system whose transform step involves: a transformer, pipeline, processing algorithm, and processing engine.
In brief, the transform... |
I saw this: Learning to program on punchcards
and I've seen this: http://en.wikipedia.org/wiki/Computer_programming_in_the_punched_card_era
but they leave much to be desired.
Can anyone explain to me how programmers programmed when they used punchcards? Specifically, the system of input computers used to derive instruc... |
According to the Wikipedia article on open-source, the philosophy of sharing code has been used in projects since the early computer days (mostly through Universities sharing code). However, I'm interested to know what (and when) was the first commercial open-source software (successfull or not)?
If there's any confusi... |
Is there a virtual memory management process that would allow a program to use the standard container structures and classes, but retain these structures and their data when the program is not running (or being used), for use by the program at a later time?
This should be possible, but can it be done without changing t... |
Sometimes I find myself writing comments on class methods like this:
class A : public Base
{
public:
/**
* Sets variable;
* should be called before ImplementsInterfaceMtehod(),
* else has no effect.
*/
void SetSomeVariable( var_type value );
virtual void ImplementsInterfaceMethod();
}
... |
Is a readonly field in VB.NET thread safe? For example, see the code below:
Class Customer
ReadOnly Name As String
ReadOnly ZIP As Integer = 98112
Sub New(ByVal Name As String)
Me.Name = Name
End Sub
End Class
|
I have the requirement to implement some kind of dual inspection or four-eyes principle as a feature of my software, meaning that every change of an object done by user A has to be checked by user B.
A trivial example would be a publishing system where an author writes an article and another has to proofread it before ... |
I am a CS student with several years of experience in C and C++, and for the last few years I've been constantly working with Java/Objective C doing app development and now I have switched to web development and am mainly focused on ruby on rails and I came to the realization that (as with app development , really) I r... |
I started to use psycopg2 to connect my little python script to a PostgreSQL database few days ago. After some research I found that a lot of database connector, like psycopg, work using cursors.
I know what is a cursor and how to use it. But I still wonder if it's safe to use the same cursor all along the script life... |
What is the best way to get this attributes, thinking in performance and code quality?
Using chained calls:
name = this.product.getStock().getItems().get(index).getName();
id = this.product.getStock().getItems().get(index).getId();
Creating new variable:
final item = this.product.getStock().getItems().get(... |
i would like to begin tinkering with Node.js but i am unsure of some "Real-World" situations where node.js would be considered the proper thing to be used. The last thing a developer wants is to learn a new technology and use it in-properly..
Can you provide real-world examples of where node.js would be used properly
|
I need help with a abstract factory pattern design. This question is a continuation of: Design help with parallel process
I am really confused where I should be initializing all of the settings for each type of medium (ex: RS232, TCP/IP, etc).
Attached is the drawing on how I am setting up the pattern:
As shown, when... |
Attribution: This grew out of a related P.SE question
My background is in C / C++, but I have worked a fair amount in Java and am currently coding C#. Because of my C background, checking passed and returned pointers is second-hand, but I acknowledge it biases my point of view.
I recently saw mention of the Null Obj... |
Tried to ask this on SO but was referred here...
Am I correct in saying that using a GPL'ed web application framework such as Composite C1 would NOT obligate a company to share the source code we write against said framework?
That is the purpose of the AGPL, am I correct?
Does this also apply to Javascript frameworks l... |
I see that there's a lot of questions related to OO Programming here. I'm actually trying to find a specific resource related to embedded OO approaches for an 8 bit MCU.
Several years back (maybe 6) I was looking for material related to Object Oriented programming for resource constrained 8051 microprocessors. I found ... |
This seems to be the common pattern that's emerging in some of the tests I've worked on lately. We have a class, and quite often this is legacy code whose design can't be easily altered, which has a bunch of member variables.
There's some kind of "Initialize" or "Load" function which would put an object into a valid s... |
I started studying Object Oriented Design and Modelling using the this book by James Rumbaugh. It uses a tool called Object Modeling Technique (OMT). I have certain newbie questions. I searched the net, but couldn't get answers
The book is pretty old. Don't know why the school told me to learn this. I know OMT is a pr... |
Can you program Android Apps in a functional language?
I meant is it possible to program for Android in a language that was designed from the ground up to be functional? I'm aware that you can use the functional components of an OO or a procedural language to program in a functional style, I was asking whether it woul... |
According to this Wikipedia article, Microsoft, Apple, Mozilla, and others criticize Dart, a programming language Google introduced to work in web browsers, because they feel "it seems harmful (cf. VBScript in IE)".
But Dart also compiles to Javascript, so a web application written in Dart can run on any modern browse... |
At home, I have a server that is running some software (on a LAMP stack, but only accessible internally). I have another machine and a laptop that I both use for developing said software. What is the best workflow for me?
Should I have a repository on my local server, create a live branch, staging branch and developmen... |
GLSL is fundamentally different from other shader solutions because the server (GPU driver) is responsible for shader compilation. Cg and HLSL are (afaik) generally compiled a priori and sent to the GPU in that way.
This causes some real-world practical issues:
many drivers provide buggy compilers
compilers differ in ... |
I would like to know if it is a good practice to generalize variables (use single variable to store all the values).
Consider simple example
Strings querycre,queryins,queryup,querydel;
querycre = 'Create table XYZ ...';
execute querycre ;
queryins = 'Insert into XYZ ...';
execute queryins ;
queryu... |
The .NET MicroFramework claims to work on 64K RAM and has list of compatible targets vendors. At the same time, same vendors who ship hardware and create Board Support Packages (vendors like Adeneo) keep releasing something named Windows 7 CE BSP for the same hardware targets. Obviously the OS as heavy as WinCE needs m... |
With Ruby on Rails I've usually used Forgery for generating dummy data for testing.
I've noticed recently that several clients and tutorials are using Faker
They both seem fairly similar in use and popularity:
Faker 128 forks, 418 watchers.
Forgery 59 forks, 399 watchers.
They both seem similar in how current they ar... |
I was recently working on a JS slideshow which rotates images using a weighted average algorithm. Thankfully, timgilbert has written a weighted list script which implements the exact algorithm I needed. However in his documentation he's noted under todos: "unit tests!".
I'd like to know is how one goes about unit test... |
I am in the very beginning of developing an app / desktop program. I want it to be cross-platform and possibly also as a tablet version (preferably Android Icecream sandwich).
Note that I need to run it offline.
I thought about the following approaches:
ADOBE Air, since I do not need much performance. Plus I did some... |
I really have never understood it at all. I can do it, but I just don't get why I would want to.
For instance, I was programming a game yesterday, and I set up an array of pointers for dynamically allocated enemies in the game, then passed it to a function which updates their positions.
When I ran the game, I got one o... |
Note: If you don't understand this question then feel free to ask clarification in the comments instead of voting down, it might be that this question needs some more work at the moment. I've been directed here from the Stack Excange chat room Root Access because my question didn't fit on Super User.
In many aspects p... |
edit: I am thinking that dependency injection is the best approach.
I am struggling to wrap my head around being able to share an object between two classes. I want to be able to create only one instance of the object, commonlib in my main class and then have the classes, foo1 and foo2, to be able to mutually share t... |
I've come up with 4 different ways to fit an image inside a viewing region, but I'm trouble coming up with names for them. Perhaps someone can suggest some?
Fit image in viewing region, do not enlarge if image is smaller
Size image so it fits snuggly inside the viewing region (enlarge if necessary) -- the image is as ... |
I'm working on a multi-player Android game (very simple it is that it doesn't have any game-engine used). The game is based on Java Socket. Four devices will connect the game server and a new thread will manage their session. The game server will server many such sessions (having 4 players each).
What I'm worried about... |
The time needed to download a website would be significantly reduced, and parsing would be also easier I think.
Why are not these languages imposed as a standard? Obviously they are better than raw html and CSS...
Browsers are the only thing that keeps us away from eliminating the intermediate HTML/CSS code.
|
Being a completely self taught programmer, I would like it if I could better myself by self-learning the computer science course taught to a typical CS grad.
Finding different resources on internet has been easy, there is of course MIT open course ware, and there are Coursera courses from Stanford and other universitie... |
There are huge numbers of programmers, especially juniors, who need good assistance in becoming professional.
I've heard a lot of about "books every programmer should read", etc. I have two years of programming experience, feel good in C++, but currently have a strange feeling, that I do not know anything about program... |
I've to access to files on the software user and I don't know if it's better to use a full JS app with HTML5 File Api rules or use Java and communicate with it ?
|
When the concepts of Object Oriented Programming were introduced to programmers years back it looks interesting and programming was cleaner. OOP was like this
Stock stock = new Stock();
stock.addItem(item);
stock.removeItem(item);
That was easier to understand with self-descriptive name.
But now OOP, with pattern like... |
Are symbolic programming and metaprogramming the same thing?
I've always read about symbolic programming while using Mathematica, but I've never searched about it's meaning, I've searched about it today and I found that both concepts are similar, are there any differences?
|
During an interview, I was asked whether I knew the difference between C and C++.
I was wondering why such question being asked?
|
I am wondering if I would need to license the Metro style or if I can just freely use it in my own applications. I mean, is it patented or protected in any way that would prevent me from building my own implementation? I effectively would like to copy the visible part of it.
I like to idea of being able to:
Provide an... |
Say you've committed a file of type foo in your favorite vcs:
$ vcs add data.foo
$ vcs commit -m "My data"
After publishing you realize there's a better data format bar. To convert you can use one of these solutions:
$ vcs mv data.foo data.bar
$ vcs commit -m "Preparing to use format bar"
$ foo2bar --output data.bar d... |
I'm new with OOP and UML and I have some confusion here. I'd like to know where to start, I mean, somebody comes to you and ask you to do something (involves software design of course), once you have determined what has to be done, what is the order in which you have to start the software architecture? I mean, is it fi... |
I am developing instrument driver and I want to know how to calculate checksum for a Laboratory Information System (LIS) frame.
Explanation:
Expressed by characters [0-9] and [A-F].
Characters beginning from the character after [STX] and until [ETB] or [ETX] (including [ETB] or [ETX]) are added in binary.
The 2-digit... |
1.
$(function () {
function foo() { return true; }
log(bar()); // getting error
var bar = function() { return true; };
});
2.
$(function () {
function foo() { return true; }
log(bar()); // working
function bar() { return ... |
Is there a phrase or word to describe an algorithm or program is complete in that given any value for its arguments there is a defined outcome? i.e. all the ramifications have been considered whatever the context?
A simple example would be the below function:
function returns string get_item_type(int type_no)
{
if(ty... |
I am currently using two systems to write code documentation (am using C++):
Documentation about methods and class members are added next to the code, using the Doxygen format. On a server Doxygen is run on the sources so the output can be seen in a web browser
Overview pages (describing a set of classes, the structu... |
What's better in terms of user experience?
Provide the user an email account where he can report bugs, or a link to the projects github issues page (which requires a github account but may be easier to submit bugs to)?
EDIT
The application is a Bash script hosted on github. The GNU Coding Standards suggests using an em... |
We're looking to migrate some existing Excel/Access processes into a new system which will provide the users with a Silverlight frontend to run and view the reports instead of using MS Access. The initial idea was to have SQL Server 2008 as RDBMS.
The problem is that we've got some static data such as country codes, co... |
I manage a small team of developers on an application which is in the mid-point of its lifecycle, within a big firm. This unfortunately means there is commonly a 30/70 split of Programming tasks to "other technical work". This work includes:
Working with DBA / Unix / Network / Loadbalancer teams on various tasks
Placi... |
Let's say we have some code that is used to initialize things when a page is loaded and it looks like this:
function initStuff() { ...}
...
$(document).ready(initStuff);
The initStuff function is only called from the third line of the snippet. Never again. So usually people put this into an anonymous callback like thi... |
On my project, we have po files to internationalize/translate various labels, error messages, button-text etc. We also have separate po files for the entirety of our help documentation, which is included in the product.
Is this an appropriate use of gettext - putting entire documents in po files as opposed to just labe... |
Sometimes you run into a situation where you have to extend/improve some existing code. You see that the old code is very lean, but it's also difficult to extend, and takes time to read.
Is it a good idea to replace it with modern code?
Some time ago I liked the lean approach, but now, it seems to me that it's better t... |
At the moment I am working on a Groovy/Grails project (which I'm quite new in) and I wonder whether it is good practice to omit the return keyword in Groovy methods. As far as I know you have to explicitly insert the keyword i.e. for guard clauses, so should one use it also everywhere else? In my opinion the additional... |
Possible Duplicate:
How should I test randomness?
Are their some techniques described for testing applications that have as a requirement some statistical or probabilistic features? They may for example use some random number generators and the customer may wish certain distribution etc.
How would software companies... |
What tools similar to GWT's UIBinder exist in other languages? By this I mean a system where you can define your UI layout in a markup language (preferably html+css) and attach the functionality to the layout using the code. I'm most interested in anything for python, but answers in other languages would interest me as... |
I've seen various open source libraries (actually I've seen it for assets as well) having a home-baked license in the following manner :
SomeGuy's License:1. You can use this code freely in commercial projects and modify it as you wish, but not sell it2.
If you want to sell a modified version, drop me an email first... |
I'm studying source code with other developers, and my job is to type up the specifications as the lead programmer describes what each function does. Are there any tips/tricks to doing this faster? a lot of times I have to ask him to repeat himself, as I didn't hear it well.
How can I be a better specification write... |
In bash at least, if and case blocks are closed like this:
if some-expr
then
echo "hello world"
fi
case $some-var in
[1-5])
do-a-thing
;;
*)
do-another-thing
esac
as opposed to the more typical close of end or endif/endcase. As far as I know, this rather funny convention is unique to shell scripting a... |
I am a developer working with small organization from last two years.
I have completed some successful projects and organization believe on my technical skill.
Now I get nominated for Team leader position, So how can convince them that I can lead a team ?
What skills I have to show besides technical stuff ?
Any help wi... |
I have just recently started my career as a web developer for a medium sized company. As soon as I started I got the task of expanding an existing application (badly coded, developed by multiple programmers over the years, handles the same tasks in different ways, zero structure).
So after I had successfully extended t... |
I was reading this article. It has the following paragraph.
And did Scala turn out to be fast? Well, what’s your definition of fast? About as fast as Java. It doesn’t have to be as fast as C or Assembly. Python is not significantly faster than Ruby. We wanted to do more with fewer machines, taking better advantage of ... |
I have a small github project, which I need to add an option to to output some version number on the commandline.
The problem is I have no idea how to "compute" the version number. Is this some random process? Should I just start at 1.0 (probably creating a tag or something), and put a number after . for fixes?
I know ... |
I'm working with multiple software with varying ways of monitoring for errors. When I make software, I usually send email with the stack trace to admins(usually me). Some customer software is monitored by a team who check that a particular batch run was successfull. Other software might not have any monitoring at all(s... |
We are designing a new architecture for an enterprise business. The principles we've followed so far is not to develop what you can (possible buy and) deploy, ie, don't reinvent any wheels.
In this way we've decided on CQRS, RabbitMQ, Riak and a bunch of other things. We still need to write /some/ business code though ... |
What is the decisive difference between LGPL(v3) and AGPL(v3) ?
Both can be used in commercial production, both can also be packed within a payed product. As long as I do not change the source code of these, I am not forced to enclose the source code with my product.
So where lies the eminent difference?
(Asked this al... |
I was under the impression that by now everyone agrees this maxim was a mistake. But I recently saw this answer which has a "be lenient" comment upvoted 137 times (as of today).
In my opinion, the leniency in what browsers accept was the direct cause of the utter mess that HTML and some other web standards were a few y... |
We have an application which is C++ trying to access MySQL database.
There are several (about 5 or so) threads in the application (with Boost library for threading) and in each thread has a few objects, each of which is trying to access Database for its' own purpose. It has a simple ORM kind of model but that really is... |
I'm in the planning stages of a new webapp, and I am leaning strongly toward a multitenancy model. The app has a file storage function, where the user can upload (and operate on) files.
I would like the ability of the user to share these files, however. How is this typically accomplished in a multi-tenant model?
The ... |
Let me try to explain what I mean:
Say, I present a list of objects and I need to get back a selected object by a user. The following are the classes I can think of right now:
ListViewer
Item
App [Calling class]
In case of a GUI application, usually click on a particular item is selection of the item and in case of ... |
I had a co-worker leave our company recently. Before leaving, he coded a component that had a severe memory leak that caused a production outage (OutOfMemoryError in Java). The problem was essentially a HashMap that grew and never removed entries, and the solution was to replace the HashMap with a cache implementation... |
I occasionally write code like this when I want to replace small parts of an existing implementation:
public interface IFoo
{
void Bar();
}
public class Foo : IFoo
{
public void Bar()
{
}
}
public class ProxyFoo : IFoo
{
private IFoo _Implementation;
public ProxyFoo(IFoo implementation)
{... |
I am wondering if there are any studies that examine the efficacy of software projects in CMMI-oriented organizations. For example, are CMMI organizations more likely to finish projects on time and/or on budget than non-CMMI organizations?
CMMI stands for "Capability Maturity Model Integration". It's developed by the S... |
Researching distributed source control management (specifically mercurial).
My question is more or less what is the best practice for rejecting entire sets of code that fail testing?
Example:
A team is working on a hello world program. They have testers and a scheduled release coming up with specific features planned.... |
I’m working on a "for fun" project in my spare time. I may end up making it Open Source and this makes me wonder what I need to think about if someone cares enough to contribute to it.
Do I need to have some sort of legal mumbo jumbo about “if you give
me yer code, it accepts the same license as the project, bla bla b... |
Okay, I have been learning SPARQL to query dbpedia and I can't seem to find clear and practical tutorials related to SPARQL and the Semantic Web. If I say that an ontology is analogous to an SQL table definition or maybe a specification of an object's members should I be slapped?
|
I have been tasked with adding some new features to a legacy ASP.NET MVC2 project. The codebase is a disaster and I want to write these new features with some thought behind the implementation and not just throw these new features into the mess. I would like to introduce things like dependency injection and the orchest... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.