instruction stringlengths 34 19.9k |
|---|
Let's assume that there are no command-line arguments. How do you pass input data to a program?
I'm thinking you'd write the input to a file with a specific name, such that the program knows to open and read it as input. However, how would one discover the name of that file? Usually, running a command-line program with... |
The main reason I don't like Debug.Assert is the fact that these assertions are disabled in Release. I know that there's a performance reason for that, but at least in my situation I believe the gains would outweigh the cost. (By the way, I'm guessing this is the situation in most cases). And yes, I know that you can u... |
Let's consider a fictional program that builds a linked list in the heap, and at the end of the program there is a loop that frees all the nodes, and then exits. For this case let's say the linked list is just 500K of memory, and no special space managing is required.
Is that a waste of time, because the OS will do th... |
Following from the previous question I've started to wonder - is it possible to implement "Components" in ASP.NET MVC (latest version)? And should you?
Let's clarify what I mean with a "component". With that I mean a "control" (aka "widget"), similar to those that ASP.NET webforms is built upon. A gridview might be a g... |
I'm currently developing a web-based XML managing program for a client (though I may 'market' it for future clients). Currently, it reads an XML document, converts it into manageable Javascript objects, and ultimately spits out indented, easy to read XML code. Edit: The program would be used by clients that don't feel ... |
It has a single root and each node has 0..N ordered sub-nodes . The keys represent a distinct set of paths. Two trees can only be merged if they share a common root. It needs to support, at minimum: insert, merge, enumerate paths.
For this tree:
The
+--------+----------------+
| | |
cat c... |
I had a discussion about OO programming today and by browsing the internet I found a lot of different specifications for object oriented languages.
What are the requirements for a language to be object oriented? For myself an object oriented language must have classes, inheritance and encapsulation.
Is C an object ori... |
I have seen several questions on here about touch typing and words per minute but not about improving ones ability to manipulate text using keyboard shortcuts, bindings etc.
I have tried putting a cheat sheet of keyboard shortcuts next to my monitor but I can never incorporate them in my 'flow'. I have also tried the '... |
This has been something that's been bothering me for a while: What makes an application memory bandwidth bound?
For example, take this monstrosity of a computer that calculated the 5 trillionth digit of pi (and later 10 trillionth digit). I was surprised that they choose the lower but faster 98 GB RAM at 1066 MHz inst... |
I've been running StyleCop over my code and one of the recommendations SA1122 is to use string.Empty rather than "" when assigning an empty string to a value.
My question is why is this considered best practice. Or, is this considered best practice? I assume there is no compiler difference between the two statements ... |
I need to create a REST web service to manage user submitted images and displaying them all in a website. There are multiple websites that are going to use this service to manage and display images. The requirements are to have 5 pre-defined image sizes available.
The 2 options I see are the following:
The web service... |
I'm a software engineer working on a complex, ongoing website. It has a lot of moving parts and a small team of UI designers and business folks adding new features and tweaking old ones. Over the last year or so, we've added hundreds of interesting little edge cases. Planning, implementing, and testing them is not a pr... |
I am a freelance Magento developer, based in Spain. One of my clients is a Germany based web development company and they're asking me something I think it's impossible. OK, maybe not impossible but definitely not a preferred way of doing things.
One of their clients has a Magento Entreprise installation, which is the... |
I’ve been working on a project for a little while and I’m unsure which is the better architecture. I’m interested in the consensus. The answer to me seems fairly obvious but something about it is digging at me and I can't pick out what.
The TL;DR is: how do you handle a program with application data and user data in... |
I am a web-developer with a desire to expand my skill-set to mathematics relevant to programming.
As 2nd career, I am stuck in college doing some of the requirements while working.
I was hoping the my education will teach me the needed skills to apply math, however I am quickly finding it to be too much easily-testable... |
HTML5 introduces a wide variety of tools such as Geolocation. Many browsers support them, but some do not yet.
Should web developers rely on them to build professional applications for industry? The features are powerful, but not all browsers support these features.
What are some ways (perhaps Javascript libraries?) to... |
Is some connection between using x86 segmentation and a possible implementation a thread package? I've been told that usually x86 segmentation is implemented in operating systems these days with an identity function (0 offset, unlimited limit), but can segmentation somehow be useful when dealing with multithreading?
|
We build some software platform, and now we need to make hardware sizing sheet for the server-side piece of this software. So, I should prepare some mathematical model that, for example, given the number of concurrent users, can predict the number of physical servers or storage capacity or network bandwidth. How to mak... |
I recently started a new job as a contract developer, and my non-developer boss of about two weeks ago gave me the task to re-create an app from another language and developer that he will reuse with multiple clients (replacing the front-end), that I estimated would take longer than his estimate of 12 hours.
Two weeks... |
Suppose an aggregate root : MailConfiguration (wrapping an AddressPart object). The AddressPart object is a simple immutable value object with some fields like senderAdress, recipentAddress (to make example simple).
As being an invariant object, AddressPart should logically wrap its own Validator (by the way of externa... |
I've been studying OO programming, primarily in C++, C# and Java. I thought I had a good grasp on it with my understanding of encapsulation, inheritance and polymorphism.
One frequently referenced concept when discussing OO is "message passing". Apparently, this is something that is not used whilst OO programming in to... |
I'm developing an xbox indie game and as a last-resort I have a try...catch encompassing everything.
At this point if an exception is raised I can get the user to send me a message through the xbox however the limit is 250 characters.
How can I get the most value out of my 250 characters?
I don't want to do any encodin... |
There are lots of books about good web design, UI design, etc. With the advent of Xtext, it's very simple to write your own language. What are good books and resources about language design?
I'm not looking for a book about compiler building (like the dragon book) but
something that answers:
How to create a grammar t... |
I am new to programming. I am eager to learn new programming languages / frameworks.
Can any one suggest the best way to master programming languages / frameworks?
|
I was sent out to discuss a system that a certain company is currently using and what should be done with it.
The company manufactures various carton displays. This system was developed to keep track of clients, orders and prices. Lots have happened since the system was created and the system is now, as the manager des... |
I'm on a private project that eventually will become open source. We have a few team members, talented enough with the technologies to build apps, but not dedicated developers who can write clean/beautiful and most importantly long-term maintainable code.
I've set out to refactor the code base, but it's a bit unwieldy ... |
I am developing a web based application whose primary objective is to fetch data from the database, display it on the UI, take in user inputs and write them back to the database. The application is not going to be doing any industrial strength algorithm crunching, but will be receiving a very high number of hits at pea... |
I have a set of Python projects which are under the mercurial VCS. I would like to automate the following tasks:
Run the test suite for every commit (CI).
Make a source distribution for every commit, which has a tag in mercurial. This is regarded as a new release.
Copy the distribution to a special repository.
There ... |
I want to develop a simple app for the Windows Phone 7 platform. It's basically a vocabulary based game that involves the user moving word tiles from one area to another to score points.
I want to know what is the best way of tying the UI to the game's backend? I saw the Windows Phone 7 jumpstart videos, there they tou... |
I'm currently playing with LISP (particularly Scheme and Clojure) and I'm wondering how typical data structures are dealt with in functional programming languages.
For example, let's say I would like to solve a problem using a graph pathfinding algorithm. How would one typically go about representing that graph in a f... |
My question is about storing data offline and potentially whether I will need to bring in an outside programmer or could this be learned within a few weeks?
The website I am working on will have an interface where users will login and go through a series of quizzes in the form of checkbox, drop down menus, and others. ... |
Intro
PHP allows you to overload method calls and property accesses by declaring magic methods in classes. This enables code such as:
class Foo {
public function __get($name) { return 42; }
}
$foo = new Foo;
echo $foo->missingProperty; // prints "42"
Apart from overloading instance properties and methods, since P... |
Just wondering if anybody has a good convention to follow in this corner-corner-corner case. I really use Java but figured the C# folks might have some good insight too.
Say I am trying to name a class where two consecutive words in the class name are numeric (note that the same question could asked about identifier n... |
I heard different interpretations of sound and complete. I understand that completeness means finding a solution if there is one. What does it mean to say an algorithm is sound.
What does it mean to say an algorithm is Sound and Complete?
|
I'm considering SQL Azure as DB for a new application I'm developing. The reason I want to go with Azure is because I don't want to have to maintain yet another database(s) and I want my users to be able to access the data from anywhere. The problem is that I'm not clear regarding how to users will connect. The applica... |
Paul Graham argues that:
It would be great if a startup could give us something of the old
Moore's Law back, by writing software that could make a large number
of CPUs look to the developer like one very fast CPU. ...
The most ambitious is to try to do it automatically: to write a
compiler that will paralleliz... |
Is there a formal/academic connection between an imperative program and algebra, and if so where would I learn about it?
The example I'm thinking of is:
if(C1) { A1(); A2(); }
if(C2) { A1(); A2(); }
Represented as a sum of terms:
(C1)(A1) + (C1)(A2) + (C2)(A1) + (C2)(A2) = (C1+C2)(A1+A2)
The idea being that manipula... |
Let's say I have a simple event system with the following syntax:
object = new Object();
object.bind("my_trigger", function() { print "hello"; });
object.bind("my_trigger", function() { print "hello2"; });
object.trigger("my_trigger");
How could I make sure hello2 is printed out first? (I do not want my code to depe... |
Taking inspiration from Javascript prototypes, I had the idea of a language where every instance can be used as a class.
Before I potentially reinvent the wheel, I would like to ask if there is a language already using this concept:
//To declare a Class, extend the base class (in this case, Type)
Type(Weapon,{price:0}... |
What is the easiest way to convert a Json data to a String at CSV format ?
I haven't read all the api yet but it seems that subclassing the default JSonWriter allows to remove unnecessary character in order to be closer to CSV format.
Does a simpler solution exist ?
|
I'm wondering which is a more effective storage method in java. Would be better to save constants in a class or a resource? The constants will be searched later by my Search program which will go through the list of constants so as to recognize possible options. Also if there is a more efficient method of storing them... |
A seemingly odd question, but here it goes. Say that a potential client asks that a certain level of ecology and sustainability is to be respected before they will consider your company for a web site project. How would you go about meeting this requirement?
|
I'm developing a telecom messaging platform in C, and I'm going to need multiple processes to be working with MySQL DB.
How can I make two processes read/write to/from a Mysql DB and, if/when one of them goes down, get the other to seamlessly take over the work until the dead process gets back to work? I was thinking/g... |
It is almost and instantaneous whenever I talk to developers about Model View Controller (MVC) they say you make a request to a url the server builds a entity (MODEL) and provides you with visual representation of that model.
So does this mean MVC is only for the web or have I been meeting people who are just develope... |
I am designing a public code repository. Users will be allowed to post and edit whatever amount of code they want, from code snippets to entire multi-file projects. I have a few major legal concerns about this:
Not getting sued/shut down - I feel the site would be a much easier target than tracking down an individual ... |
In these days there are many projects whose aim is to bring new languages to the browser by compiling them to JavaScript. Among the others one can mention ClojureScript, CoffeScript, Dart, haXe, Emscripten, Amber Smalltalk.
I'd like to try a few of these out, but I am not sure what I should be looking for when evaluati... |
After using Hibernate on most of my projects for about 8 years, I've landed on a company that discourages its use and wants applications to only interact with the DB through stored procedures.
After doing this for a couple of weeks, I haven't been able to create a rich domain model of the application I'm starting to bu... |
From http://www.w3.org/XML/Schema:
[XML Schemas] provide a means for defining the structure, content and semantics of XML documents.
I'm using an XML Schema (XSD) to validate several large XML documents. While I'm finding plenty of support within XSD for checking the structure of my documents, there are no procedural... |
Why was Java chosen for Android, instead of something like C++? I have heard that Java uses quite a lot of memory and I would presume that low memory usage would be quite important on mobile devices. Is there any real advantage to using Java instead of a language like C++ on a mobile device?
|
I've just started informatics university and I'm attending a programming course about C(++). The programming professor prefers to connect every topic with a type of programming design that is similar to Design by Contract. Basically, what he asks us to do is to write every exercise with comments that denote the pre-con... |
I'm looking for a solid and but fast paced entry in field of javascript development.
The following topics come to my mind:
Javascript advanced concepts, OOP
jQuery, jQuery-UI, jQuery-Mobile
backbone.js
node.js
BDD and/or TDD
The courses of http://www.codelesson.com seem promising.
What certificates for Javascript dev... |
From wikipedia, Anytime algorithm
In computer science an anytime algorithm is an algorithm that can
return a valid solution to a problem even if it's interrupted at any
time before it ends. The algorithm is expected to find better and
better solutions the more time it keeps running.
Hill climbing
Hill climbing... |
I have set of Objects of the same class which have different values of their attributes.
and I need to find the best match from a function under given scenarios out of these objects.
In future these objects might increase as well.
Quite similar to the way we have Color class in awt.
we have some static color objects in... |
I am choosing a license for my open source software and I've learned about GPL, EBMS and BSD. GPL seems to be most popular one.
The problems are:
Would anybody kindly name a few popular opensource licenses? Since I do not see any EBMS BSD license is popular.
Are there any chart or table that have list out the advantag... |
I have a need to write data to file in one of my classes.
Obviously I will pass an interface into my class to decouple it.
I was thinking this interface will be used for testing and also in other projects.
This is my interface:
//This could be used by filesystem, webservice
public interface ILogger
{
List<string> Pr... |
When is it best to use Iterators in PHP, and how can they be implemented to best avoid loading all objects into memory simultaneously?
Do any constructs exist in PHP so that we can queue up results of an operation for use with an Iterator, while again avoiding loading all objects into memory simultaneously?
An exampl... |
Do you know any good tutorials, frameworks, anything that can help me to write code that captures information from a website that don't have a public API, or hasn't been written in a RESTful way?
I've heard there's a Ruby gem that simulates a browser, but I forgot its name and couldn't find any information about it any... |
I am currently redoing some link structuring on a website. In the past we have used specific php files on the last step to direct the user to the proper place.
Example:
www.example.com/action/go-to-blue.php
or
www.example.com/action/short/go-to-red.php
www.example.com/action/tall/go-to-red.php
We are now restructuri... |
I was recently assigned reading from the Tanenbaum-Torvalds debates in my OS class. In the debates, Tanenbaum makes some predictions:
Microkernels are the future
x86 will die out and RISC architectures will dominate the market
(5 years from then) everyone will be running a free GNU OS
I was a one year old when the de... |
I'm looking for tests that are suitable for a graduate software developer role, mainly tests that are about reviewing code and finding faults and etc, multiple choice or otherwise.preferably code written in c#.
I have a test coming up soon and want to prepare before hand.
|
The other day my dad asked me a question that I would have never expected from him.
"How can I learn C++?"
My dad is turning 56 this year and computers are a distant concept for him. He doesn't know how to use a phone very well besides calling numbers (no speed dial or contacts); though he has started to learn computer... |
I have some files in my project that started from a sample in the all-in-one code sample browser: http://visualstudiogallery.msdn.microsoft.com/4934b087-e6cc-44dd-b992-a71f00a2a6df
Some files contain boilerplate code that I modify heavily. They contain MS comments at the top that mention the license, copyright microsof... |
We have program( written in VB ) using a call to a winzip program or 7zip command line tool to zip some files. Once I accidentally uninstall the winzip on my computer and making one of our program( created by the programmer already left ) crashed. So we cannot uninstall the winzip program.
Now we am writing another pro... |
This is the business requirement:
"
A Holiday Package (e.g. New York NY Holiday Package) can be offered in different ways based on the Origin city:
From New Delhi to NY
From Bombay to NY
NY itself ( Land package )
(Bold implies default selection)
a. and b. User can fly from either New Delhi or Bombay to NY.
c. NY is... |
Is using dependency injection (DI) essential for unit testing?
I can't think of another alternative for isolating code so it can be tested. Also, all the examples I have ever seen use this pattern. Is that because it is the only viable option or are there other alternatives?
|
I am reading Domain-Driven Design by Evans and I am at the part discussing the layered architecture. I just realized that application and domain layers are different and should be separate. In the project I am working on, they are kind of blended and I can't tell the difference until I read the book (and I can't say it... |
How would one know if the code one has created is easily readable, understandable, and maintainable? Of course from the author's point of view, the code is readable and maintainable, because the author wrote it and edited it, to begin with. However, there must be an objective and quantifiable standard by which our prof... |
I would like to start fiddling with ClojureScript, but I am puzzled about some points. My problem is what is a good way to deal with state changes coming from user interaction, when you trying to work functionally.
Let me give a couple of examples. I have in mind applications which run in the browser, but I think the i... |
I'm specifically interested in how users perform authorized / authenticated operations on a web API.
Are authentication cookies compatible with the REST philosophy, and why?
|
I've been procrastinating learning some framework for web apps w/ some library for AJAX, something like django with prototype, or turbogears with mootools, or zeta components with dojo, grok, jquery, symfony... The point is to spend some of my spare time, have "fun" and create cool stuff that hopefully is some useful. ... |
I have the following interfaces:
public interface Successorable<E> extends Comparable<E>
E suc();
}
and
interface IInterval <E extends Successorable<E>> {
E min();
E max();
}
I'm trying to implement IInterval by doing:
public class Interval<E> implements IInterval<E> {
....
However eclipse complains th... |
What are some practices I should use in a product registration system I'm building? I likely can't stop all malicious hacking, but I'd like to slow them down a great deal. (Note, I know only PHP.) I'm talking about things like encrypting traffic, testing the encryption from hacking like a man-in-the-middle attack, etc.... |
I am reading Learn Python the Hard Way by Zed Shaw. In this lesson he writes: "Every if-statement must have an else."
What are the benefits of ending every if-statement with an else? Are there any legitimate reasons not to end an if-statement with an else?
|
I have a table with about 37 indexes. Would that be considered too many? What are some best practices regarding indexing?
EDIT: It is warehousing data, updated daily with new transactions. There are 47 million rows. 3 of the indexes are very necessary. The other 34~ are 'where' clause indexes intended to speed up que... |
My editor of choice is Notepad++. It has macro capabilities, but as much as I think, I don't see how can I use it for anything.
Do you use macros in your editor that have made your work easier? (for general use I mean)
|
I was just laid off and it was the standard process that is used in the US: call the person to talk to personnel, and remove access to the network while that is going on, then have someone help pack, always have someone with the person until they are escorted from the property.
That is supposed to keep an unhappy dev... |
Edit: Justin Cave made a good point that this sort of communication should be up front in my quoting / estimations. Is this case, I'm still interested to know what sort of language people use to describe the 'existing code learning' activities. Especially to a company who haven't dealt with software contractors befor... |
OK this is a simple question but for some reason I just can't get it right. I have to scan from a file hundreds of lines of code and store it in a array (which I can normally do a ok job with) however At one point the code will specify a number that then corresponds to the next batch of chars ints and floats going into... |
We are all getting used to checking a box and putting our name in a text field to create a contract with an airline, a hosting company, or a software download. However, for some reason I am still asking clients to sign our contracts for website development on paper, and send me a scan. Few complain about this procedure... |
Almost all of the mobile phones, except the ones being produced by Intel, use ARM based processors while desktop/server industry is dominated x86 processors.
What features does one provide over the other with regards to the domination they have in their respective sectors?
|
I need to store questions and answers in a database. The questions will be one to two sentences, but the answers will be long, at least a paragraph, likely more.
The only way I know about to do this right now is an SQL database. However, I don't feel like this is a good solution because as far as I've seen, these datab... |
Today while playing with Google Chrome Omnibox, I notice a strange behavior. I guess there's some "hidden" web standard behind it, but can't figure it out. Here's how to reproduce:
Go to http://edition.cnn.com/
Use the search function at the higher right corner, Search a random keyword, for example: "abc"
Close the ta... |
I think of the scope of a variable as -
"The scope of a particular variable is the range within a program's source code in which that variable is recognized by the compiler".
That statement is from "Scope and Lifetime of Variables in C++", which I read many months ago.
Recently I came across this in LeMoyne-Owen ... |
One of the tenets of agile is ...
Customer collaboration over contract negotiation
... another one is ...
Individuals and interactions over processes and tools
But the way I see it, at least when it comes to interaction with the customer, there is a fundamental problem:
How the customer thinks is different to how a sof... |
Possible Duplicate:
Is there a canonical book for learning Java as an experienced developer?
Let me elaborate a little:
I used to be a C/C++ programmer where I used data structure concept like trees, queues stack etc and tried to optimize as much as possible, minimum no. of loops, variables and tried to make it ef... |
Possible Duplicate:
What is the difference between all-static-methods and applying a singleton pattern?
I need to make a decision for a project I'm working of whether to use static or singleton.
After reading an article like this I am inclined to use singleton.
What is better to use static class or singleton?
Edit ... |
I'm working for a company writing ERP applications. My problem is that I have to write tons of boilerplate code. I came up with ideas to automatize/prevent the drudgery but only some of them were accepted. I have been told by the lead developer that my ideas tend to be go far afield and I should write code everyone can... |
Intuitively I understand "elaboration" and have a very mild idea. But I want to know exactly what is elaboration of a declaration?
I came across this word in this context:
Stack dynamic storage bindings are created for variables when their declaration statements are elaborated.
The quote is from "Concepts of Programm... |
I work as an independent developer. I find it difficult to test functionality of a feature and test code. As project goes complex, I loose focus resulting in each feature partially developed. I want to know how to write test cases, manage smooth workflow and handle features effectively and while remain focused?
|
"Concepts of Programming languages" by Robert Sebesta says -
Implicit Heap-Dynamic Storage Binding:
Implicit Heap-Dynamic variables are bound to heap storage only when they are assigned values.
It is similar to dynamic type binding.
Can anyone explain the similarity with suitable examples. I understand the meaning of... |
I have seen many people around complaining about verbosity in programming languages. I find that, within some bounds, the more verbose a programming language is, the better it is to understand. I think that verbosity also reinforces writing clearer APIs for that particular language.
The only disadvantage I can think of... |
I am building a application that allow different user to store the subscriber information
To store the subscriber information , the user first create a list
For each list, there is a ListID.
Subscriber may have different attribute : email phone fax ....
For each list, their setting is different , so a require_attr... |
I study computer science and I have a class called "Programming Techniques". Its purpose is to teach (us) good object oriented design principles. During the semester we have homeworks, programs that we must write to demonstrate what we've learned.
The lab assistant demands for each of these homeworks that specific desi... |
As the question states, I am a developer, not a DBA. I have experience with designing good ER schemas and am fairly knowledgeable about normalization and good schema design. I have also worked with data warehouses that use dimensional modeling with fact tables and dim tables.
However, all of the database-driven appli... |
Is it possible to call the constructor using an arguments object?
var MyClass = function(a, b){
this.a = a;
this.b = b;
};
var myClassInstance = function(){
//This line would not work, but is what I'm asking. Is there a way besides eval?
return new MyClass.apply(?, arguments);
}('an A value', 'a B value');
|
In an oriented-services enterprise application, isn't it an antipattern to mix Service APIs (containing interface that external users depends on) with Model objects (entities, custom exceptions objects etc...) ?
According to me, Services should only depends on Model layer but never mixed with it.
In fact, my colleague... |
As I learn more about C and C++ I'm starting to wonder: How can a compiler use newer features of processors without limiting it just to people with, for example, Intel Core i7's?
Think about it: new processors come out every year with lots of new technologies. However you can't just only target them since a significant... |
Without knowing too much about JMX, I've always assumed that it would be the best approach for building in remote management to our standalone Java server application. Our server application has some minimal remote control capability, using text commands sent via TCP/IP socket to it.
Using the home grown approach, it i... |
We're using Catalyst to render lots of webforms in what will become a large application. I don't like the way all the form data is confusingly into a big hash in the Controller, before being passed to the template. It seems jumbled up and messy for the template. I'm sure there are real disadvantages that I haven't desc... |
(I'm not sure if it's a appropriate question here)
Shell scripts, like those written in bash, can do many things. They can call Unix programs, pipe their output, redirect I/O from/to files, control flow, check whether a file exists, etc.
But a modern programming language, e.g, python and ruby, can also do these things.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.