instruction stringlengths 34 19.9k |
|---|
I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it...
I have one curiosity though, why is the syntax so cryptic (in lack of another word)?
Is there a reason why it isn't more expressive, more close to human language?
I understand that FP i... |
I have a condition
if(exists && !isDirectory || !exists)
{}
how can I modify it, so that it may be more understandable.
|
In Common Lisp, defmacro basically allows us to build our own DSL.
I read this page today and it explains something cleverly done:
But I wasn't about to write out all these boring predicates myself, so I defined a function that, given a list of words, builds up the text for such a predicate automatically, and then eva... |
Following the recent release by Microsoft of TypeScript I was wondering if this is something that should be considered for a experienced WinForm and XAML developer looking to get into more web development.
From reviewing a number of sites and videos online it appears that the type system for TypeScript makes more sense... |
As we know a many to many association are shown by two asterisks in both end of association. Now I have a association between two entities "Good" and "Invoice" so Good and Invoice have a many to many association but I want to show the "count of each good" in each invoice on class diagram.
How can I show it?
|
Java generics look quite different from those available in Scala, although both were designed by Martin Odersky. From my point of view, the design of generics in Java is worse, for instance:
there is no possibility to specify variance
one can get around the previous limitation by using wildcards, but this means the bu... |
I know that if a computation takes linear or linearithmic time based on the size of the input, that's good, and if it takes quadratic time, then that's not so good.
However, what about memory usage? Suppose a program takes a file as input and does something with that file. Is it okay for the memory usage to be linea... |
According to Roy Fielding (one of the principle authors of the HTTP specification) in his seminal thesis Architectural Styles when discussing REST, he mentions:
[E]ach request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context ... |
Тitle might be a little bit incorrect. :) Anyway, I'm building a software where employees input time they worked per day (work hours) and employer "pays" for this time. "Payment" is done outside this system, so employer just "confirms" (checkbox or something like this) which work hours are paid.
So the question is - wh... |
It is easy to define the Equals operation in ways that are not commutative. When providing equality against other types, there are obviously situations (in most languages) were equality not being commutative is unavoidable. However, within one's own inheritance hierarchy where the root base class defines an equality ... |
When freelancing / contracting a customer will typically specify functional requirements, acceptance criteria, etc, and the implementation details are in the developer's hands.
As a developer your technology choice is a balancing act between what you are most familiar with, technologically what the right tool appears t... |
I'm about to make a simple web application with just image uploading and user management. I'm browsing through several web app frameworks I could use yet I'm still thinking if I should still make use of them or just make one from scratch for this specific application.
Any suggestions from experienced web app developers... |
I have searched the idea of address space that is The set of all legal addresses in memory for a given application. The address space represents the amount of memory available to a program. I am unable to find that how this concept is implemented? And how it works with operating system? Any help would be appreciated.
|
A situation has arisen where (if I don't scream and run away) I will be involved in an ERP system. This project will be using OpenERP specifically. My background is entirely science/engineering/music/games/art/whatever. I've never set foot in the realm of business systems or anything describable with the word "enterpri... |
Let's say I write a mobile app and I want to sell it on all three:
Apple Market Place
Android Market Place
Windows Market Place
Will any of these market places tell me that it's not possible, that
in order to sell it I must only go through them and not through the
other ones?
p.s I know Angry Birds sells on all three... |
I wonder why would anybody want to use identity comparison for fields in equals, like here (Java syntax):
class C {
private A a;
public boolean equals(Object other) {
// standard boring prelude
if (other==this) return true;
if (other==null) return false;
if (other.getClass() != ... |
I have some experience writing small tools in Haskell and I find it very intuitive to use, especially for writing filters (using interact) that process their standard input and pipe it to standard output.
Recently I tried to use one such filter on a file that was about 10 times larger than usual and I got a Stack space... |
I was talking with my architect about some concerns with a particular approach that may result in very low level of cohesion in a set of classes. However, I couldn't think of the word that represents a low level of cohesion.
I said something along the lines of "Obviously, we want cohesive classes not... uh ... not cohe... |
I am working through some Lisp exercises using Clojure. If I were to convert Lisp lists to Clojure vectors, solving some of the problems would be simpler, so here is my question:
Does using vec or vector cost a lot in terms of time and/or processing? Does using either function cause a meta state change, or are the valu... |
For a few decades the programming language of choice for AI was either Prolog or LISP, and a few more others that are not so well known. Most of them were designed before the 70's.
Changes happens a lot on many other domains specific languages, but in the AI domain it hadn't surfaced so much as in the web specific lan... |
If the header file supplied by a vendor of something with whom one's code must interact is deficient in some way, in what cases is it better to:
Work around the header's deficiencies in the main code
Copy the header file to the local project and fix it
Fix the header file in the spot where it's stored as a vendor-supp... |
After receiving some threats of the copyrights holder of a dual licensed software(GPL2 and commercial) to buy the commercial version for projects in production, I am thinking to make a fork.
In a case of GPL2 and commercially dual licensed with business owned copyrights software, is forking the GPL2 version an option?
... |
The "Verbally Readable !== Quicker Comprehension" argument on http://ryanflorence.com/2011/case-against-coffeescript/ is really potent and interesting. I and I'm sure others would be very interested in evidence arguing against this. There's clear evidence for this and I believe it. People naturally think in images, not... |
What things should absolutely always/never be included in a header file?
Functions: what must go in the header file and what mustn't
Constants: Is it good practice to define lot of constants in a header file?
Any other good practices for C header files?
Example
I'm writing a parser for a documented industry standard ... |
Maintaining bug database is an important for every project. I am used to store the followings at bug database
Issue date time
Who is assigned to
Whether it has been solved or not
If solved then, solved date time
Is those enough to maintain a good bug database?
|
We currently are using CCNet as our continous integration server. Most projects check for changes every 30 seconds (the default) and if needed perform a build (unit tests, stylecop, fxcop, etc).
We've gotten quite a few projects now, and the server spends most of its time near 100% cpu utilization. This has alarmed s... |
I currently have some code that checks if squash and tennis scores are valid, both in javascript and PHP.
This results in 4 blocks of code existing, 2 languages * 2 sports, which does not scale well should any extra sports come around, or extra languages...
How can one describe the valid scores of games via a settings/... |
I'm really struggling with my software specs. I am not a professional programmer but enjoy doing it for fun and made some software that I want to sell later but I'm not happy with the code quality. So I wanted to hire a real developer to rewrite my software in a more professional way so it will be maintainable by oth... |
The development team that I'm a member of has recently adapted to work according to Agile practices. This has personally highlighted the fact that I can't stop myself gold-plating code (and documentation) and I consequently exceed original estimates, when I could've delivered solutions that meet the requirements much e... |
Hi I recently learned asp.net webforms and looking to get some experience under my belt using it.I found a website that provided some exercises here:
asp.net exercises
There weren't that many and I managed to finish them all.Are there any other website or books with similar exercises or tasks that could help me get so... |
I've been wondering about this. What do we exactly mean by design and verification.
Should I just apply TDD to make sure my code is SOLID and not check if it's external behaviour is correct?
Should I use BDD for verifying the behaviour is correct?
Where I get confused also is regarding TDD code Katas, to me they looked... |
In my understanding, the GPL prohibits static linking from non-GPL code to GPL code, but permits dynamic linking from non-GPL code to GPL code. So which is it when the code in question is not linked at all because the code is written in an interpreted language (e.g. Perl)?
It would seem to be too easy to exploit the ru... |
Let's say we have a class called 'Automobile' and we have an instance of that class called 'myCar'. I would like to ask why do we need to put the values that our methods return in a variable? Why don't we just call the method?
For example, why should one write:
string message = myCar.SpeedMessage();
Console.WriteLine(m... |
What exactly is C# version of Java RMI?
I want to invoke the methods of client from the server, ping the client from server etc.
How the server and client communication is done with c#?
|
To clarify, when I mean use the terms persistent and immutable on a data structure, I mean that:
The state of the data structure remains unchanged for its lifetime. It always holds the same data, and the same operations always produce the same results.
The data structure allows Add, Remove, and similar methods that ... |
I've got an interesting tiling problem, I have a large square image (size 128k so 131072 squares) with dimensons 256x512... I want to fill this image with certain grain types (a 1x1 tile, a 1x2 strip, a 2x1 strip, and 2x2 square) and have no overlap, no holes, and no extension past the image boundary. Given some proba... |
A variable refers to a value. A variable is also stored in a memory address. People say that it's good to have this memory model in mind. Is that true? What is some sample code that shows this as beneficial in practice?
You dont have to use programming, you can use a real-world analogy if you like.
edit: they keep remo... |
It seems that both Apple and Microsoft prohibit GPLv3-licensed software in the app stores for their locked-down devices (i.e. iOS, Windows Phone and the Metro part of Windows). I have heard various explanations for this. However: Would they even be able to allow this license in their app stores if they wanted to, or do... |
There's two of us working on something. We're using this branch structure
master
dev-A
dev-B
We both work on separate branches (dev-A,B) and whenever we're done - we promote our changes to master.
But the drawback of this is we can't get changes the other developer makes. Everything exists in the master tree - but we... |
I was reviewing my notes and stumbled across the implementation of different sorting algorithms.
As I attempted to make sense of the implementation of QuickSort and MergeSort, it occurred to me that although I do programming for a living and consider myself decent at what I do, I have neither the photographic memory no... |
I am working through the Windows 8 app tutorial.
They have some code about saving app data like so:
private void NameInput_TextChanged(object sender, TextChangedEventArgs e)
{
Windows.Storage.ApplicationDataContainer roamingSettings =
Windows.Storage.ApplicationData.Current.Roaming... |
I am reading/learning about interfaces in C# at the moment, and thus far I managed to understand how it differs from an abstract class. In the book I am reading the author explains that interfaces are the ultimate abstract class and that it simply sets the standard of certain methods the inheriting class will have, but... |
Every library, open-source project, and SDK/API I've ever come across has come packaged with a (usually large) documentation file, and this seems contradictory to the wide-spread belief that good code needs little to no comments. What separates documentation from this programming methodology?
a one to two page overview... |
Plenty of sentiment exists that measuring commits is inappropriate.
Has any study been done that tries to draw in more sources than commits - such as:
browsing patterns
IDE work (pre-commit)
idle time
multitasking
I can't think of an easy way to do these measures, but I wonder if any study has been done.
On a pers... |
I don't have any question related to coding. My concerns are about embedded systems programming independent of any particular programming language.
Because I am new in the realm of embedded programming, I would quite appreciate responses from those who consider themselves experienced embedded systems programmers.
I ba... |
I am interested in multicore programming at the kernel level. I expect this affects many areas and is probably different for each architecture. What are some must read sections of the kernel? If I wanted to compare and contrast code for an Intel I7 and an ARM Cortex-A9 MPCore where would I find the differences?
|
I have been reading about the MIPS architecture and learned that it has been used a multiprocessor architecture in the past. Is anyone presently using it in a multicore SoC?
|
Is there a way to get the version of Ubuntu that Google uses for development? Even better would be a full up VMWare or Virtual Box Virtual Machine image that might include a full complement of preinstalled tools as well.
|
I have to import data from Excel to an SQL database. The Excel data contains various parameters and their values, like P1, P1, P4, P5, etc. I have to apply business rules. Like if (P1 > 100 and P1 < 200) then insert the record in database. Similarly, in some cases, string values are also validated. Can I have any open ... |
Do you need to take account of the different processors and their instructions when writing a compiler? Have instructions been standardised? Or what tools and techniques are available to assist with this? E.g. Ignoring machine instructions that are specific to a certain processor model.
|
According to Stephen Schach, “Classical and Object-Oriented Software Engineering”, chapter 6:
a module consists a single block of code that can be invoked in the way that a procedure, function, or method is invoked
This seems very vague and broad. So could anyone explain it clearly and show some actual examples of ho... |
I work for a medium company that has around 250 developers. Unfortunately, lots of them are stuck in a procedural way of thinking and some teams constantly deliver big Transactional Script applications, when in fact the application contains rich logic. They also fail to manage the design dependencies, and end up with s... |
I'm taking my first steps with Clojure. Otherwise, I'm somewhat competent with JavaScript, Python, Java, and a little C.
I was reading this artical that describes destructuring vectors and maps. E.g.
=> (def point [0 0])
=> (let [[x y] point]
=> (println "the coordinates are:" x y))
the coordinates are: 0 0
but I'm ... |
I'm rewriting a PHP client/proxy library that provides an interface to a SOAP-based .Net webservice, and in the process I want to add some unit and integration tests so future modifications are less risky.
The work the library I'm working on performs is to marshall the calls to the web service and do a little reorgani... |
I'm trying to detect if an article or forum post is a duplicate entry within the database. I've given this some thought, coming to the conclusion that someone who duplicate content will do so using one of the three (in descending difficult to detect):
simple copy paste the whole text
copy and paste parts of text mergi... |
I want to add databases (traditional client/server RDBMS's like Mysql/Postgresql as opposed to NoSQL, or embedded databases) to my toolbox as a developer. I've been using SQLite for simpler projects with only 1 client, but now I want to do more complicated things (ie, db-backed web development). I usually like follow... |
In particular, I'm curious about the following aspects:
How do you know that your test cases are wrong (or out-of-date) and needed to be repaired (or discarded)? I mean, even if a test case became invalid, it might still pass and remain silent, which could let you falsely believe that your software works okay. So how ... |
I'd really appreciate your advice on an ongoing project.
I presented my client with a proposal and design samples which he approved, and he paid in full instead of the 50% upfront deposit as I'd given him a generous discount. He was then slow in furnishing me with some of the content, but once we did, he expected the w... |
Supposed there is an application with multiple windows, like:
Logo splashscreen
Connecting... screen
Login-usercontrols screen
Logging in... screen
etc.
Is there a design pattern, which allows to effectively manage all those windows? (to hide previous windows, display a new window etc.)
|
This is a continuation of me rewriting GPL project.
What will be the correct way of attributing my project as being a derivative of some other GPL-licensed project? So far I came up with:
HgSharp
Original Copyright Matt Mackall <mpm@selenic.com> and contributors.
The following code is a derivative work of the code fr... |
Does it make a difference if I declare variables inside or outside a loop in Java?
Is this
for(int i = 0; i < 1000; i++) {
int temp = doSomething();
someMethod(temp);
}
equal to this (with respect to memory usage)?
int temp = 0;
for(int i = 0; i < 1000; i++) {
temp = doSomething();
someMethod(temp);
}
And... |
I am new to the cross platform application development. I came across the very similar cross platform frameworks AppMobi and PhoneGap.
I want to know
Is there any differences between apk/ipa created using Appmobi and
apk/ipa created using PhoneGap?
Is there any difference in native features that can be used ?
What are... |
I want to calculate y(n)=32677Sin(45/1024•n), where y is an integer and n ranges from 0 to 2048. How can I make this process quicker and more precisely?
Now I want to show you a reference answer:
Since Sin(a+b)=Sin(a)Cos(b)+Cos(a)Sin(b)
And Cos(a+b)=Cos(a)Cos(b)-Sin(a)Cos(b).
So I can store Sin(45/102... |
Programming is my hobby and I've just downloaded VS Studio 2012 Express Desktop.
Now I am going to register it but they want me to tell them business information
Are only companies and no private programmers allowed to use VS Studio 2012 Express Desktop?
And what shall I type in these text fields?
|
I am using WPF, Prism and Unity to develop the user interface for a .net application. The UI will run from a PC, but I also need to develop a separate complex server component that will provide services to the PC component via WCF.
Prism and Unity have proved to be of great value in creating a modular application, at ... |
A recent article by ycombinator lists a comment with principles of a great programmer.
#7. Good programmer: I optimize code. Better programmer: I structure data. Best programmer: What's the difference?
Acknowledging subjective and contentious concepts - does anyone have a position on what this means? I do, but I'd... |
I have many objects in my game world that all derive from one base class.
Each object will have different materials and will therefore be required to be drawn using various rendering techniques.
I currently use the following order for rendering my objects.
Deferred
Forward
Transparent (order independent)
Each object ... |
I realize some things are easier/harder in one language than the other, but I'm only interested in type-related features that are possible in one and impossible/irrelevant in the other. To make it more specific, let's ignore Haskell type extensions since there's so many out there that do all kinds of crazy/cool stuff.... |
Sometimes I write constructor code like
class X
{
public:
X( const int numberOfThingsToDo ) :
numberOfThingsToDo( numberOfThingsToDo )
{
}
private:
int numberOfThingsToDo;
};
or in C#
class X
{
public X( int numberOfThingsToDo )
{
this.numberOfThingsToDo = numberOfThingsToDo;
}
private int ... |
I am adding some "social" type features to an existing application. There are a limited # of node & edge types. Overall the data itself is relatively small (50,000 - 70,000 for each type of node) there will be a number of edges (relationships) between them (almost all directional).
This, I know, is relatively easy to... |
I attended a in-person interview recently and performed well. But surprisingly I got rejected. When I asked the HR for reason, he contacted the technical interviewer and told me that I was syntactically wrong while coding.
I used Google Guava for coding. So my code looked like this:
List<String> items = Lists.newArra... |
Models in an MVC application gets kind of hard to test when validation of data and persistence of data is baked together in the model. I would like to test those separately to prevent doing integration testing instead of actual unit testing.
What patterns are available to keep validation and persistence separated?
|
In an article from HN, I came across the following advice:
Always tell your customer/user "yes", even if you're not sure. 90% of
the time, you'll find a way to do it. 10% of the time, you'll go back
and apologize. Small price to pay for major personal growth
But I've always thought that one should do a feasibilit... |
For example: yeoman. It's licensed under a BSD license. The CLA form (Contributor License Agreement) isn't project specific, and it can be signed electronically.
How and what issues can signing out this agreement prevent?
Does it matter how big or minor contribution I made?
Why some projects require signed CLA to acc... |
I need help trying to understand what the meaning of the arrow in a UML Class Diagram is, more specifically in this Composite Diagram. What's the difference between the simple line (from a class to another one) and the arrow (not the inheritance arrow, I refer to the black one)?
|
I am trying to test-drive (or at least write unit tests) my Model classes but I noticed that my classes end up being too coupled. Since I can't break this coupling, writing unit tests is becoming harder and harder.
To be more specific:
Model Classes: These are the classes that hold the data in my application. They rese... |
Kind of a REST lightweight here... Wondering which url scheme is more appropriate for a stock market data app (BTW, all queries will be GETs as the client doesn't modify data):
Scheme 1 examples:
/stocks/ABC/news
/indexes/XYZ/news
/stocks/ABC/time_series/daily
/stocks/ABC/time_series/weekly
/groups/ABC/time_series/dail... |
This is my first post here in programmers.stackexchange (I'm a regular on SO). I hope this isn't too general.
I'm trying a simple project to learn Java from something I've seen done in the past. Basically, it's an AI simulation where there are herbivorous and carnivorous creatures and both must try to survive. The pa... |
If I am sole developer (I do not work in a team) working from my laptop (Windows OS and Linux VM) and backing up data to the cloud (Dropbox etc), then is git still better than svn for my version control needs?
I was thinking not since I wont need any of git's distributed features. But is git such a better approach t... |
What are graphs, in computer science, and what are they used for? In laymen's terms preferably.
I have read the definition on Wikipedia:
In computer science, a graph is an abstract data type that is meant to implement the graph and hypergraph concepts from mathematics.
A graph data structure consists of a finite (and ... |
I was planning on logging a lot of different stuff in my production environment, things like when a user:
Logs In, Logs Off
Change Profile
Edit Account settings
Change password
...
etc
Is this a good practice to do on a production enviornment? Also what is a good way to log all this. I am currently using the follo... |
I'm considering implementing slugs in my blog. My blog uses MongoDB. One of the side-effects of using MongoDB is that it uses relatively long hex string IDs.
Example
before: http://lastyearswishes.com/blog/view/5070f025d1f1a5760fdfafac
after: http://lastyearswishes.com/blog/view/5070f025d1f1a5760fdfafac/improvements-... |
Thanks to the great help of this site and SO, I've been able to make a prototype of a software I want to sell but unfortunately although the prototype works I think my code quality is very low. I didn't use much OOP or design patterns so although my code is understandable to me, I think a normal developer would faint i... |
C++ noob here. I have a very basic question about a construct I found in the C++ book I am reading.
// class declaration
class CStr {
char sData[256];
public:
char* get(void);
};
// implementation of the function
char* CStr::get(void) {
return sData;
}
So the Cstr::get function is obviously meant to return a c... |
I'm looking at a sample Windows 8 C# "Metro" style app (bingPushpin). When I 2-click MainPage.xaml, it gives me, "Design view is unavailable for x64 and ARM target platforms."
My Acer Aspire laptop is, indeed, 64-bit.
Is this going to continue to be a problem for me, or is there a workaround?
If the former, can anybody... |
I like XP (extreme programming), especially the part where there are 2 programmers at the same screen, since a problem's solution is often found more quickly if only you explain what you're doing and pair programming forces you to explain what you're doing.
Over the last 10 years or so, the XP style of working seems to... |
I'm about to start on a project which will involve developing prototype native mobile apps (iOS and Android initially) as well as a web-based admin interface and an API for these apps to communicate with. We've got a list of stories already drafted up, however a lot of them are in the format:
As a mobile user I want t... |
We usually have this dilemma in our team. Sometimes, in order to implement a task or a story we find out that the system must be in a specific state. For example, a specific system configuration has to be made beforehand.
The task / story can be completed and it is working as specified on it with the proper configura... |
I am learning C (still very much a beginner) on Linux using the GCC compiler. I have noticed that some libraries, such as the library used with the math.h header, need to be linked in manually when included. I have been linking in the libraries using various flags of the form -l[library-name], such as -lm for the above... |
I am in the beginning phase of create a mobile MMO with my team. The server software will be written in JavaScript using NodeJS, and the client software in Lua using Corona. We need a tool to auto-generate documentation for both the server-side and client-side code.
Are there any tools which can generate documentation ... |
I am working on a project which has a Desktop Application for MAC/COCOA, a native application for iPhone another native application in iPad. All the application do almost same thing. The applications are data driven applications. Every communication to server is made via a restful API developed in PHP.
When a user logs... |
I'm planning on developing an app on multiple platforms and I'm thinking that PhoneGap might be perfect for me. I had been reading that it's one codebase for all platforms but looking at the PhoneGap guide it seems there are separate instructions for each platform. So if i want to develop for iOS, Android, BB and WP7 I... |
A friend and me are working on a webapp. We're using git so each of us has a local copy of the app. But the problem is the database. We want to be able to see the latest changes the other person made. From what I understand, we have two options:
Host the database on a server
Add the .sql file to every commit we make.
... |
The dilemma I'm facing is: should I use static classes for the components of an application just to get nicer looking API?
Example - the "normal" way:
// example component
class Cache{
abstract function get($k);
abstract function set($k, $v);
}
class APCCache extends Cache{
...
}
class application{
funct... |
I'm wondering if I can create an EPUB (free and open e-book standard) reader in JavaScript. The basic requirements would be:
Server parts of the EPUB reader from a server API.
Read the EPUB data in JavaScript.
Render it on page.
Provide some extra functionality, like text highlights or page notes.
I have no... |
Is there a best practice for the order to define getters and setters in? There seems to be two practices:
getter/setter pairs
first getters, then setters (or the other way around)
To illuminate the difference here is a Java example of getter/setter pairs:
public class Foo {
private int var1,
var2,
var3;
... |
I have forgotten a slang programming term. This thing is an intentional bug or a decoy feature used as a distraction. An example usage, "Hey Bob, QA is doing a review today. Put a $THING into the module so they actually have a problem to find".
This can be used negatively, to have a very obvious intentional flaw to dis... |
I would like to run the PageRank algorithm on graph with 4 000 000 nodes and around 45 000 000 edges.
Currently I use neo4j graph databse and classic relational database (postgres) and for software projects I mostly use C# and Java.
Does anyone know what would be the best way to perform a PageRank computation on such g... |
First off I have seen this post which is slightly similar to my question. :
What can you do to decrease the number of deployment bugs of a live website?
Let me layout the situation for you. The team of programmers that I belong to have metrics associated with our code. Over the last several months our errors in our l... |
QUESTION:
How should you handle compound words when programming?
Are there any good lists available online for developers of generally accepted technology-related compound words?
I can see how this is highly ambiguous, so should I just use common-sense?
EXAMPLE:
I would be inclined to do this:
filename NOT FileName
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.