instruction stringlengths 34 19.9k |
|---|
I am starting with this project of mine of writing a custom UI for linux. What would happen is:
The computer would boot into this UI which would not be the typical taskbar/icons/startbutton kind of thing. Think more like a dedicated UI instead of a general purpose one.
It would provide access to wifi, ethernet, blueto... |
From the book Professional Enterprise .Net, which has 5 star rating on Amazon that I am doubting after having a read through. Here is a Borrower class (In C# but it's pretty basic; anyone can understand it) that is part of a Mortgage application the authors built:
public List<BrokenBusinessRule> GetBrokenRules()
... |
I think I have never seen a [] that doesn't mean array in C.
Background:
I was reading about l-values and r-values here: http://msdn.microsoft.com/en-us/library/bkbs2cds.aspx and there it says so. I am curious.
|
My (new) development team is setting up its software development environment. I won't describe the whole scenario, since that's another, much-maligned question.
Anyway, we're going to have services such as source control (mercurial), a wiki, an issue tracker, a file/document server, DNS and possibly other things. My qu... |
I am currently new to Dependency Injection pattern. I am influenced by link by Mark Seemann.
I have a confusion regarding whether an interface for an agent class of some agent module should be included in domain layer?
by agent I mean a class / module that interacts with external wcf/ webservices.
I have a diagram tha... |
I am working as a IT-developer. I am developing J2EE application in our own life project cycle methodology.
I have seen and learnt so many SDLC cycle models in order to develop a project but this open source development and its process still unknown to me.
So, how this open source development life cycle happen? How thi... |
C++ is a great language in many ways, but some things in particular are cumbersome to write without an IDE. As a VIM user, it would be very interesting if I had access to a higher level language which enabled me to write C++ with S-Expressions and possibly with Lisp-like macros, allowing for the generation of clean cod... |
Lately I can't seem to get enough of the amazing async-await pattern of C# 5.0. Where have you been all my life?
I'm absolutely thrilled with the simple syntax, but I'm having one small difficulty. My problem is that async functions have a totally different declaration from regular functions. Since only async functions... |
I'm trying to find a developer to write me a pretty basic program. I am also a developer, but don't have enough time to write it myself.
This program has a pretty basic function. It will notify users, via some dialog (or alert) that some program is about to access the built in desktop / laptop camera. It could be skyp... |
I have a class that encapsulates the results of a scientific measurement. I’m building in unit tests from the beginning, but I don’t have a lot of experience with unit testing and I’m not sure which behaviors I should be testing and how.
My class does three kinds of things:
Reads measurement data from a file (or a str... |
As an example of what I need and why I want it, I am trying to determine how a certain value (CurTotal) is getting set (wrongly). I've come up with these notes to myself to try to understand just what is happening:
**CurTotal is declared in frmEntry.SetTotalControlsProperties().
CurTotal gets its value within that meth... |
Resharper (or is it Visual Studio - it's a yellow light bulb with a tiny red filament in it) offers to "invert if" on this code:
if (tItems >= 0)
{
return tItems;
}
SetTotalItemsAndTotalAmt();
...and if I allow it to, it becomes this:
if (tItems < 0)
{
SetTotalItemsAndTotalAmt();
}
return tItems;
...but then ... |
Developing endless frameworks for web application, websites and web services is always great fun. It's one of the richest areas where you have 100 different ways of achieving pretty much the same thing.
Even with all this abundance, I've recently managed to find myself missing a web framework in C#.
I feel that the new... |
I want to develop a WordPress theme using Roots theme framework and then sell it on themeforest.net.
Roots theme license allows me to sell the theme as per its founder's discussion with some guy on this google group post.
It says that the product should have an MIT compatible license. The question is:-
If I sell it on... |
I have a controller in my mvc4 web application in which there is an action that needs to call another function. What happens in that function i.e. the return value is not important for my action. How i can call that function and never wait for it to be executed?
I think it can be done by async but my point is not to us... |
I'm building close-source application with some libraries that's using Apache License 2.0.
Number 4 point a) of the license stated that:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License;
Does this mean that my application is now under Apache License 2.0 because I included t... |
We are given a list of edges between a set of N vertices. There are atmost three edges joining a vertex. We have to arrange all the vertices on a straight line with the positions numbered from 1 to N so that the sum of the length of all the edges is minimized.
The length of an edge a,b is the difference between the po... |
I have a Java code which is writing some data in string format to Messaging queue. Now any one can subscribe to this queue and fetch this data. Here the client fetching this data can be written in any programming language.
I was planning to expose this data in JSON format, but then as per my understanding I have to exp... |
I have a basic search in my webpage. When I designed it, I chose to combine the search box inputs with OR. For example: A search for foo bar will be translated to foo OR bar, so every entry which includes foo or bar will be shown.
I did this because I thought that a search should return as much as possible and leave i... |
I have
if (!b && c || a && c)
//do action a
else
//...
Due to some internal relationship between a, b, and c. !b && c || a && c is proved to be equivalent to (! a && b) || c.
I just wonder will (! a && b) || c be simpler than !b && c || a && c? Can you prove it? Assume the chances of a,b,c to be True or False is ... |
Given an expression, such as int x = y + 5, we'd call int x the left-hand side (or LHS), and y + 5 the right-hand side (or RHS). The whole expression is called, of course, an expression (or equation), but is there a generic term for a "side" of an expression?
LHS and RHS don't quite cut it when it comes to an expressio... |
Insofar as I understand it, tools like Git and Mercurial derive checksums from their data, and those checksums are used to derive other checksums used in aggregate, leading to a kind of accumulative checksumming (checksums being the input to other checksums), that ensures a high level of integrity.
Is there a name for ... |
I'm looking at Azure Mobile Services, particularly the Authentication part (which I believe relies exclusively on OAUTH 1 or 2).
I want to make sure that my application isn't tightly coupled to the service and I can bring authentication back in-house using either of the following methods:
I use a version of Azure Mobi... |
My project lead considers both of these approaches to be unnecessary overhead. I have been involved in and have witnessed a lot of talk around XML vs JSON, but this is the first time that I have heard an argument against BOTH.
We are using c# in .Net 4. We'll be storing data in a sql server database on the server and a... |
What is better practice: force user to extend abstract class or make class with configuration? Eg. pseudocode:
ClassA{
this.name
this.weight
this.height
this.width
constr(config){
this.name = config.name
this.weight = weight
this.height = height
this.width = width
}
}
or
abstract ClassA{
this.name
thi... |
I've read recently that macro support in Scala is now official. I checked the documentation page and they are reminiscent to the LISP ones. In one of his essays Paul Graham writes that when "you add this final increment of power" to a language it is no longer a new one but a lisp dialect.
Is this the case with Scala? I... |
Our team is looking to introduce Web API, MVC/ASP.NET implementation in our SOA. I am having a hard time trying to wrap my head around the identity and access control it has compared to WCF.
WCF has Windows, X.509, UserName, and WS-Trust (probably more, but this is what I am familiar with), MVC's Web API seems to only... |
I am working on a PHP code and as it grows getting more and more tired of repeating the same standard pattern again and again and again:
class BolerPlate
{
protected $property1;
protected $property2;
...
public function __construct ($property1, $property2, ...)
{
$this->property1 = $propert... |
I am developing a Windows application and I want to store all the text for labels, radio buttons, buttons, check boxes and column headers of grids at one place. I have tried using a class file, an xml file, a database table and a resource file.
I found that a class file is the best way to store all these texts, but I w... |
I was trying to understand how to write unit tests for a few days now. I'm confused with following scenarios in the existing code.
In first function the max value changes depending on the object created at run time but in the second case it is a constant.
NOTE: The following functions are not related. These are two d... |
In working with python for the first time, I've found that I end up writing multiple classes in the same file, which is opposed to other languages like Java, which uses one file per class.
Usually, these classes are made up of 1 abstract base class, with 1-2 concrete implementations who's use varies slightly. I've post... |
First of all let me expose what I would like to do : I already dispose of a long-time running webapp developed in ASP.NET (C#) 2.0. In this app, users can upload standard PDF files (text+pics). The app is running in production on a Windows Server 2003 and has a dedicated database server (SQL server 2008) also running W... |
For my current class, I have to pick and research a Programming Language (or popular scripting language) and answer quite a few questions about it, write a paper, and do some example programs displaying it's strengths and weaknesses compared to other languages.
I'm currently looking into F# as a possible candidate, my ... |
I have read many times that insertion sort has tight code and hence the hidden constant factor in its asymptotic complexity is smaller. I just read yesterday that quick sort has tight code just like insertion sort so it also has smaller hidden constant factor. It is one of the reasons it is considered best among the O(... |
[edit]Turns out there's 1.5 million records... The SQL database is taking about 17-20 seconds to run the query. Would it be best to have Java handle the joins and rearranging in that case? Since this is a web app, if multiple users are getting Excel exports, would the long queries reduce the overall performance of the ... |
We are using JIRA to manage the scrum process. What I'm curious about is whether the User Story issue type should be assigned to a team member, the PO, or remain unassigned. My gut tells me it should remain unassigned to be assigned to the PO since the team should only be working on Task issues, but I wanted to see if ... |
This question could be generalized to any language where the language development is open-source, potentially, but I'm most curious about Clojure specifically.
If Clojure (as a language) is open-source, licensed by the Eclipse Public License, which per this GitHub side-project requires derivative works to disclose sour... |
Ok, the title might be a little misleading.
I have a Window class that draws widgets inside itself in the constructor. The widgets are all of the same type.
So I pass a list of dictionaries, which contain the parameters for each widget. This works quite nicely, but I am worried that the interface to callers is obfuscat... |
There is one camp of thought that argues that the first learned language should be C (or even some assembler). The motivation being that
Doing everything yourself builds discipline to e.g. garbage collect
Inventing the wheel is good for understanding the roots of more sophisticated "real" programming
Closer to the a... |
Please give reasons for your answer.
As I found, two additions are needed.
This is because every number to be add needs to changed to binary. Then addition is done between two binary numbers where the XOR gate is used for addition. When a carry bit is required an AND gate is involved to add the carry bit to the next li... |
It's the first RESTful web service and I am concerned about security issues. Is it safe to transmit my access token via HTTP headers? For example:
POST /v1/i/resource HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Api-key: 5cac3297f0d9f46e1gh3k83881ba0980215cd71e
Access_token: 080ab6bd49b138594ac9647dc929122a... |
I am curious about how to create a programming language based on JVM so I have tried to get some info online, but the information I got are quite fragmented. What I found are mostly information related to single technologies like ASM, Eclipse JDT, JFlex, etc, but what I would like to know are the main steps that need ... |
Consider this code:
>>> class Foo():
pass
...
>>> foo = Foo()
>>> foo.a = 'test'
>>> foo.a
'test'
One can just override __setattr__ to make attributes read only and prevent their creation at runtime, however:
Why is this the default Python behavior (any good reasons)?
Is there any practice to prevent this wit... |
I'm looking for a suggested workflow for quickly being able to download various c/c++ open source projects and then begin intelligently navigate sources.
"Intelligently" means being able to jump around to usages, definitions, implementations of a particular symbol, both in the downloaded code base, and also the head... |
I'm putting together some notes for a dev team on how to write secure Perl code - especially taking into account the current OWASP top 10 web application vulnerabilities. For cross-site scripting I've included information on ensuring that all output to the browser is checked and escaped where necessary, but I'm looking... |
I have a class with a lot of methods. I would like to group similar methods together in their own class, but all of the methods need to extend another class, ClassC. So I was thinking of having ClassA, which contains the first group of methods, extend ClassB, which extends Class_C, etc.
Is this inefficient in terms of ... |
If an agile team has members like Developers, Testers, and Automation Testers from different geographical regions, how can the daily scrum meeting can happen?
Obviously they have to work in different time zones. Can this be successfully managed? Do you think the daily scrum meeting can be replaced by sending status ema... |
This is related to this question but not quite the same. BTW, I'm not a native English speaker.
I keep having a hard time choosing a proper name for collections - Lets say that we have a collection of item s and that each item has a name. How will we call the collection of names such that the collection's name will be ... |
I'm writing a library. It's a completely rewritten version of another one, to suit my needs (PCL compatibility, mainly). However, the API will be completely rewritten, as I'll need to change a lot of stuff around for PCL compliance. Also, as it is a rewrite, I won't be able to just start from the library and just chang... |
I want an element to appear in case the website has not been used for a while and make it disappear after it is being used again. Is there any way to detect on a website if the mouse has not been moved for awhile?
|
I have a social location based application and I'm in a bit of design conflict that I can't seem to solve or find good information on.
Realizing that I have multiple controllers that will similarly access the user's location and load an array of places to be displayed in a table view, I've made a class that has class m... |
I have 3 IPs and every IP has a weight, I want to return the IP's according to its weights using the random function. For example if we have 3 IP's
X with weight 3
Y with weight 3
and Z with weight 3
I want to return X in 33.3% of cases and Y in 33.3% of cases and Z in 33.3% of cases, depending on random function in ... |
I'm using a parser generator to build a compiler. Should I commit the source files produced by the parser generator?
I want to commit them to avoid a dependency on the parser generator during the build process and tests.
However, if I commit them, it is tempting never to update the parser generator for fear of backwar... |
I will understand if you find this is more a discussion than a technical question and if you close the topic (then, where would be an appropriate place to discuss about that? thank you in advance).
The question : how do you decide between improving the user interface with a great design or adding more and more technica... |
I'm reading a book's chapter ("Controlled Exception Test" in "Testing Object-Oriented Testing") about testing exception handling in a running system (not at unit level). The conclusion is that it is hard to automatically trigger an exception at a given layer in the system other then simulate a cause for an exception.
... |
I am working on my first big(ger than before) project at my university which is coded under the Apache 2 License.
So here is the question:
Can I use copyrighted material/libraries (no restrictions and free to use) inside that project?
I want to be specific: The library is flot (flotcharts.org)
My guess is yes, but gues... |
I have a mobile app from which I'd like to allow voting on Things. I don't want to force all the users to have to sign up using email/Facebook/etc. just so that I can properly limit voting.
Is it really a bad idea to leave voting to be an "open" process where anyone can vote? I know theoretically that this allows impro... |
At the company I am currently working for we started to do Scrum projects. It was not so hard to convince the managers to move from waterfall to Scrum. We're doing a project where we rebuild our platform from scratch. So (most) functionality is known and most improvements are rather technical.
In this it could be justi... |
Consider a service such as Netflix... if on the server side netflix used code with a GPL license attached, do they have to make their server side code available under the terms of the GPL?
Obviously netflix being only an example, the company I worked for mostly provides 'services', we don't sell software that anyone ca... |
At my current workplace, Entity Framework 5 is used for all data access/manipulation.
It is a database-first approach using the model designer to add/edit/delete/update entities.
Problem
We now have tons of tables and this is becoming a nightmare to update. The model is very convoluted and it can sometimes crash the ... |
A common thing you need to do is to take a value, do something with it by passing it to a function, and then do some more with the return value, in a chain. Whenever I run into this type of scenario, I get unsure about how best to write the code.
As an example, let's say I have a number, num, and need to take the floor... |
I came from a background where I taught that when a transaction reached some state (FINISHED, PRINTED, etc) it should no longer be opened for modification even to admin users.
But here I am, fixing their human-input error barbarically by deleting a row in database and/or changing the current item's state to it's previo... |
In a service-oriented architecture, subsystems can depend on each other in different levels:
Database level => Foreign keys to enforce data integrity across services on deletions and updates (cascade), and views which use tables from other services to increase performance
Code reuse => like DLL references in .NET plat... |
I read this article on soundcloud's api:
http://backstage.soundcloud.com/2011/08/soundcloud-mobile-proxies/
It talks about consuming your own API.
What I don't understand is how they avoid giving away the secret key. If you normally give the secret key to a developer who is going to use it in his API how do you give... |
I have developed an open source PHP application and currently it uses both the MySQLi or MySQL extension for backwards compatibility. I'm wondering about switching it over to only be compatible with MySQLi since PHP now no longer supports the MySQL. Another reason I'd like to get away from supporting both MySQL and MyS... |
Here is my problem:
I have a set of 'n' colors including the primary colors and their codes in hexadecimal. Now given another color 'x' I wonder if it's actually possible to come up with a mix between two or more of the colors of the set that will produce 'x'. The mix should be subtractive.
Here is an example of the re... |
I have just landed a role as a C#/Asp.Net developer at a large software house. I have previously worked at a much smaller software house for about two years but it was a varied/mixed role there, and here the asp.net applications we have are a factor of 10 or so larger.
As seems to be the norm, I have been given the tas... |
Recently I have become incredibly interested in language development. The past few weeks I have written many language front ends (lexer, parser) including a calculator language/expression parser and much more. After creating so many things I have realized there MUST be more abstraction between parsing and code executi... |
When I worked as a freelancer, I encountered lots of cases where customers were protecting their ideas and source code of their projects (such as web applications) as much as possible, no matter how unimportant, uninteresting and unoriginal were the projects and the concepts behind.
I've already posted a question about... |
I'm quite new to stuff like DI, MVVM and WPF altogether, so it's fairly possible this reads like a giant WTF...
I have defined an interface in my business layer, ISomeEntity; then in my data layer, I have a public class SomeEntity : ISomeEntity entity type. The thing to note here is that the business layer does not re... |
I really don't know where else to ask. So here it goes.
I'm working at a very tiny company that makes ERP software and websites.
1 developer with + 10 years experience.
2 developers with + 3years experience.
3 developers with + 1 year experience.
That's it.
No team, no DBA, no system admin.
There is no one around her... |
Does Lisp still have any special feature which has NOT been adopted by other programming languages?
By Lisp, I mean all the Lisp programming languages as a whole. I've been told how amazing Lisp is and know that many languages have been inspired by Lisp. But does Lisp still have any exclusive design feature that just c... |
I've tried rewriting some Java functions in C++ and called them using JNI. I observed that it takes longer time to execute the native C++ functions as compared to Java functions, due to the JNI overhead.
As it is widely believed that C++ has certain advantages over Java, I wanted to know whether rewriting some Java cod... |
When outputting data in a large file, I try to make it a habit to incrementally output data in chunks, to prevent reading the entire large file into memory. As an example to show what I mean:
$fp = fopen('path/to/file.txt', 'r');
while (!feof($fp)) {
echo fread($fp, 8192);
}
fclose($fp);
Would this same practice b... |
When we call QApplication::exec() at the end of our main() function, the application enters Qt's event loop. Conceptually, the event loop looks like this:
while (!exit_was_called) {
while (!posted_event_queue_is_empty) {
process_next_posted_event();
}
while (!spontaneous_event_queue_is_empty) {
... |
I just searched for the same but didn't get the answers. What I have is a db file which is around 100MB. I have saved the db file in sdcard .
Through this db file I'm going to populate the contents for the android app. I can read the db file using like below.
File dbfile = new File("/sdcard/Your_db_File.db" );
SQLiteD... |
I'm in doubts this design is OK, it may be there is a way to do it better? The case is that I need a class which would be used in one and only class and that's it. But, this class needs to inherit from another one, which is in another package. This doesn't sound right as for me.
public class User {
private class Speci... |
I am visually impaired. With glasses I see well enough to drive, but at the font size I'm comfortable working at I can only see about 15 lines of 100 characters at a time. This has affected my coding style.
One thing I do is write shorter functions. My code tends to get good reviews because these short functions wit... |
I have some code that looks something like this, except rather than 2 sections, there are about 20, and they have real code in them:
/*------------
* Contents:
* 1. Load slider
* 2. Check form
/*------------
/*------------
* 1. Load slider
/*------------
var slider_id = 101;
var num_slides = 10;
$(docu... |
I need an interface to a back-end service, mostly for control commands (stop, status, cancel, reload config). The service might be in Python, Perl, Java, or whatever, and runs continuously. The interface will let me send infrequent commands to the running process.
A signal handler can tell a process to stop, and USR1... |
A buddy said today that one change between v6 and v7 is that v7 will close for instance database connection "automatically" but couldn't JBoss do that already with Java 5? I've seen "JBoss is closing the connection for you." in the JBoss' logs many years ago with Java 5 (or even 4). What do you think? I almost read the... |
I have to develop a batch procedure with VB.NET.
This simple procedure is going to read some data from a MS SQL database, execute some elaborations and the write the results on another Oracle SQL database located to a remote network reached via VPN. The VPN is "always on", we do not need a client to manage the connecti... |
My buddy told me today that some programmers transform a checked exception (e.g. EJBException, SQLException...) to an unchecked (RuntimeException?)
My buddy explained a call stack where if you change the bottom of the stack you would have to change every method that calls it if you change the bottom (innermost) method.... |
I maintain and add features on a freelance basis to a website written in PHP. The application was started in PHP4 by a junior programmer back in 2006, and features some very insecure and unmaintainable ways of doing things, which I am trying to correct as time goes on. If the client agrees, one of the first things I wo... |
Is there any design patterns (or best practices) for implementing a geographically distributed system (mostly a database)?
Description: There is a network of warehouses and a central office. Now I want every warehouse replicates it's data to the central office and the central office replicates just that portion of data... |
I am writing software (in Java) using three libraries:
Library A, licensed under MIT license
Library B, licensed under Apache License, Version 2.0
Library C, licensed under LGPLv3
I would like to make my software publicly available under the MIT license.
I'm going to include all libraries in source and binary form (j... |
I have been working on a system alone for about four years. I have built it from the ground up. It is not a perfect system. It is very complex, it is buggy, and the business is now becoming aware of this.
After all this time, other developers at the company are getting interested in the project, and they are becoming m... |
Are there any languages or even servers that instead of running a script on page load, (Apache/PHP, Ruby on Rails, ...) actually keep the code loaded and running forever, and when it receives a connection it calls a function of that code? (Like a PageLoad event basically?)
I didn't really know how to call this so I wen... |
I am a solo developer working on a decently small project with about 3 other people (non-developers). These other people are involved in the project in non-development ways and one is also my manager. Everyone is pretty open to ad hoc discussions, too.
My manager just gave me what seems like a dream come true - I was t... |
tl;dr
Some widely used programs, which generate html, will only generate opening paragraph tags, and not closing ones, assuming that the browser will properly close paragraphs.
On the face of it, it seems to me that the assumption that browsers will properly close paragraphs is not correct. Is my interpretation correct... |
The problem
I am on a software project which has about 10 developers, we share source code via Mercurial. We have a development and production branch per release. Repeatedly during the course of the project we have had source code from one branch i.e. v1 getting into patch and maintenance branches for earlier releases ... |
I've seen an increasing trend in the programming world saying that it is good practice to separate code blocks into their own functions. Obviously, if that code block is reusable, you should do that. What I do not understand is this trend of using a function call as essentially a comment that you hide your code behin... |
Almost in every interview for the position of web developer, they ask about stored procedures and triggers well I am aware from their definition and basic usage but the truths is I have never used any of them in any of my project. Well I have seen other developers who used them but only when they were the only solution... |
I'm still puzzled as why we have new in Go.
When you want to instantiate a struct, you do
t := Thing{}
and you can get a pointer to a new instance by doing
t := &Thing{}
But there's also this possibility :
t := new(Thing)
This last one seems a little alien to the rest of the language. &Thing{} is as clear and conci... |
I'm developing an application that allows people to place custom manufacturing orders. However, while most require similar paperwork, some of them have custom paperwork that only they require. My current class design has a Manufacturer class, of which of one of the member variables is an array of RequiredSubmission obj... |
I have a Rails 4 app having to do with graphs. These graphs need to be stored and I'm not sure of the best way to do it. Firstly, the app has a SQLite db in development and PostgreSQL in production. I would love to have graphs in JSON, but that can be achieved in several ways. Also, these graphs are going to be manipul... |
Well while developing a web application that allow users to draw graphs (flow charts, ER diagram , UML, .... etc) the information of drawn items and their relation to each other and position on canvas is expressed as JSON object
The question is:
1- is saving such graph in database as raw (json object text) is enough (i... |
I am developing a telephony call model and thinking about how best to design the interface.
One basic idea is that a call has a unique call identifier. I have a list of calls and finding a specific call is easy by callid.
Each call has zero or more parties. A party has a device identifier (eg extension 201) and a sta... |
As far as I have understood(?), the "Extends is evil" idea is in direct opposition to the Open Closed Principle?
In here, the concept of OCP is presented as inherently using Extends:
http://www.oodesign.com/open-close-principle.html
While in for example this article, the act of extending is considered a capital offense... |
In case of code where you have to do a resource cleanup before exiting a function, is there a major performance difference between these 2 ways of doing it.
Cleaning the resource before every return statement
void func()
{
login();
bool ret = dosomething();
if(ret == false)
{
logout();
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.