instruction stringlengths 34 19.9k |
|---|
I'm trying to find a better solution for making a parser to some of the famous file formats out there such as: EDIFACT and TRADACOMS.
If you aren't familiar with these standards then check out this example from Wikipedia:
See below for an example of an EDIFACT message used to answer to a
product availability request... |
Today, the Internet Explorer Box Model problem is mostly a non-issue. Most web developers place a <!DOCTYPE> tag to enforce standards compliance, and nobody really cares about supporting Internet Explorer 5.5 anymore.
However, some developers have come up with subjective, conceptual arguments in defense of the IE box ... |
I have my Python source structured as follows:
+-branchname/
+-dst/
+-src/
| +-library/
| | +-cleese/
| | | +-test/
| | | | +-__init__.py
| | | | +-test_cleese.py
| | | +-__init__.py
| | | +-cleese.py
| | +-palin/
| | +-test/
| | | +-__init__.py
| | | +-test_palin.py
| | +-__init__... |
I'm developing a Killer Sudoku solver for a school project. I've programmed 10 human strategies showing what they are doing in order to be the most educational possible.
It can solve hard Killer Sudokus right now but my teacher proposed that I use backtracking to solve every possible grid.
I've been trying for one week... |
I have loaded a .RAW file into a 2x2 array in my class. The way I am rendering it works fine but I am struggling to get the camera to move on top of the terrain. The terrain renders from 0,0,0 (x,y,z) as that is where I put my camera. My camera class allows to the "camera" to move through the scene.
I want to be able ... |
Are there any eye-tracking case studies, or similar research done to verify what code format is easiest to read, maintain and work with?
I always format my code the following way:
function thing()
{
if(something)
{
// do something
}
else
{
// do something else
}
}
However, I never s... |
Going through some old Hacker News items, I came across a post from a user that said
Aguri trees, which marry a bounded-size radix trie (like you'd use in a software routing table) to an LRU list, and automatically synthesize aggregates (like, 10.0.0.0/16 from 1,000 observations across all IPs) from the pattern of ins... |
In Java, why are nextInt() and nextDouble() instance methods of Random objects?
I feel that these methods should be static methods of the Random class. What is the purpose of having to instantiate a Random object to generate random integers or double values?
|
Time to time, I have to work on a website that involves a huge background in size and resolution (1920 x 1080 in resolution, over 2mb in size). I've been using preloaders and it worked very well, except that users have to wait a little bit.
I noticed that google map splits a big image into many pieces. I researched abo... |
According to Wikipedia, a stack:
is a last in, first out (LIFO) abstract data type and linear data structure.
While an array:
is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key.
As far as I understand, they are fairly similar. So, wha... |
There are benefits to each and I understand the differences, but what is considered best / standard practice? And why?
For example :
"myString".equals(myStringVar)
Avoids a potential NPE and does not require a null check. (Good thing?)
Cleaner to read since a null check is not required.
If null is not an expected va... |
I'm a little new to Java Web Development. JSF, JSP, Servlets, Hibernate etc... I have really a good understanding of OOP and C++. I have years of PHP and MySQL web development experience. I also have experience with C# and ASP.NET and I'm a software engineering student.
I don't want to continue my career with PHP, sinc... |
I've heard swarming mentioned in the context of Agile or Extreme Programming. It seems to be a complement to pairing.
What exactly is it? When should it be applied? How do you do it well?
|
I'm fairly familiar with where to use Stacks, Queues, and Trees in software applications but I've never used a Deque (Double Ended Queue) before. Where would I typically encounter them in the wild? Would it be in the same places as a Queue but with extra gribbilies?
|
Is there a Cormen-like reference on Hashes and Hashing? This particular structure has seen little attention in my CS education for some reason but I'd like to learn more as they seem to be everywhere. I know Cormen covers it but I'm looking for something more specialized and in-depth.
|
Why does the add method of a Linkedlist return true in Java?
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/LinkedList.html#add(E)
Why not just make it a void method? I know it says "per the general contract of Collection.add", but why doesn't this contract/interface make add a void method?
|
I am studying OOP in C++ and, even though I am aware of the definitions of these 3 concepts, I cannot really realize when or how to use it.
Let's use this class for the example:
class Person{
private:
string name;
int age;
public:
Person(string p1, int p2){this->name=p1; t... |
Over the past week, I've been struggling to adapt a Grails application to use the REST architecture. Problem is, I've had nothing but trouble throughout.
For this application, the choice between using XML and JSON literally came down to a coin flip. Neither format offered much over the other, so I went with XML.
Writ... |
When we design applications, we generally end up with the same tiered sets of data structures:
A persistent data structure that is described using DDL and implemented as RDBMS tables and columns.
A set of domain objects that consist primarily of data structures, usually combined with business-rule level logic, that ar... |
I sometimes prefer to work in a terminal. I use git, and sometimes have merge conflicts. Are there any merge-conflict-resolution tools that work in a command-line only environment?
|
Often when configuring settings, applications have both an "Apply" and an "Ok" button. Should the "Ok" button always perform the "Apply" before closing the window out? Are there pros and cons to doing this?
|
I'm currently looking into API documentation generation tools and I noticed that apparently there are no efforts going on in standardization.
Javadoc style is kind of an ubiquitous convention... it is used for Java (duh), PHP (PHPDocumentor, doxygen, Stubbles), C/C++ (doxygen again)... and there is even IDE support fo... |
I have read different opinions about the singleton pattern.
Some maintain that it should be avoided at all costs and others
that it can be be useful in certain situations.
One situation in which I use singletons is when I need a factory
(let's say an object f of type F) to create objects of a certain class A.
The facto... |
The Ecma-334 (ISO/IEC 23270:2006) standard corresponds to the version 2.0 of the language.
Specification of version 4.0 is freely available from Microsoft, but Microsoft's open specifications list only lists the Ecma (version 2.0) version.
So what about all the good features added in the later versions (LINQ, lambda fu... |
Usually, tree data structures are organised in a way that each node contains pointers to all its children.
+-----------------------------------------+
| root |
| child1 child2 child3 |
+--+------------------+----------------+--+
... |
I am maintaining a WinForms application, which talks to a SQL Server database. Sometimes I have to change database schema (for example to alter a sql procedure or add new one). For this purpose I have a SchemaChange.sql file, where I put the corresponding sql code.
When I create an installer for my project, the msi pac... |
I want to learn about null values or null references.
For example I have a class called Apple and I created an instance of it.
Apple myApple = new Apple("yummy"); // The data is stored in memory
Then I ate that apple and now it needs to be null, so I set it as null.
myApple = null;
After this call, I forgot that I at... |
We have a requirement in our project to generate a big CSV file every 2 hours using a Java program.
This file will have around 60,000 lines (around 120 characters per line). I am not sure about the size yet.
I would like to know if I would run into any memory issues because I will open the file using FileWriter and the... |
I found two techniques for estimating user stories:
by the size of the story, which is unit-less
by the time estimate, which is measured by days
The first uses relative comparison between stories to infer time, and it should be independent on developer experience, while the second depends on developer experience.
I ... |
We want to store some genomic variant data but there are some problems, more important ones like problem of the data's immense size and variability.
Variant data can be huge. For example, a single individuals variant data could feasibly some day require a million rows of data in a table, or require of a gigabyte of r... |
I'm creating a web app using web.py (although I may later rewrite it for Tornado) which involves a lot of file manipulation. One example, the app will have a git-style 'commit' operation, in which some files are sent to the server and placed in a new folder along with the unchanged files from the last version. This wil... |
Sites like webpagetest allow users to enter a website url and a test location, to run a speed test on the site from multiple locations using real browsers. Can anyone give me a basic idea of how sites like this work? You also have plugin's like Aptimize latency simulator or charles web debugging proxy app, that simula... |
Well, I started using some CSS3 animations a couple of days ago. After hardcoding I've started trying different tools like Adobe Edge Preview version.
I made a short animation to get the functionality of the tool
http://things.eyemade.ch/css3edge/
After that someone at Twitter took a look at it and said that it is wron... |
I have a fairly large software project written in c++.
In there, there is a class foo which represents a structure (by which i don't mean the programmers struct) in which foo-objects can be part of a foo-object.
Here's class foo in simplest form:
class Foo
{
private:
std::vector<unsigned int> indices;
p... |
I'm a fresh grad, and I just started workingin real world projects. I'm basically using PHP most of the time. I just figured out that most of the solutions I came out with for most of the problems, is involving using an array in somehow. What Am I doing wrong here? How could I unlearn this and always think of something... |
I have found a major security hole in one of my company's public facing site. This is our first public facing site that was converted from an intranet site. I brought this issue up to my boss and they essentially shrugged it off, saying that it would take a good deal of work to re-architecture the site to make it secur... |
I'm trying to get a better understanding of Dependency.
In Martin Fowler's explanation of the Data Mapper pattern, http://martinfowler.com/eaaCatalog/dataMapper.html, the UML diagram shows the Mapper being dependent on both the Domain Object and the Database.
It seems to me, however, that the Domain Object is dependent... |
Wikipedia says
"software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification"
The word functions caught my eyes, and I now wonder if we can assume that creating an overload for a method can be regarded as an example of the Open/closed principle or not?
Let me explain... |
I'm looking for good practices or any advice regarding file access transaction mechanisms. We will have multiple instances of an application spread over a redundant network (cloud) watching a directory on a 100% available NAS. I'm also looking for any alternative architecture that may be more appropriate.
We will have... |
I am developing a series of webservices (based on spring and spring mvc).
For the first time in my dev career I do plan on replacing the dao layer in the future(I have always seen it mentioned but never had to do it).
Currently I'm using spring annotations, so I could simply change the qualifier name of the injected da... |
I am designing a programming language, and I would like to provide a complete documentation for it.
So far, I have planned to write the following documents:
An initial design outline, mostly as a reminder of the design and proposed changes to it, as well as an aid to construct all the other documents when the design p... |
I recently read a blog post (which I lost the link) that really make me think. The writer said that the one of the biggest problem in software projects is actaully completing it, and most people will end up abandoning the work.
I have been self-learning programming for over 15 years now, at this stage I actually feel p... |
I was reading JDOM's website.
Why is the JDOM API defined in terms of concrete classes rather than interfaces?
Jason Hunter summarizes the arguments against an interface-based API for JDOM:
With interfaces everything becomes a factory, elements have to be 'imported' into new documents instead of just added, features ... |
My goal is to include modules sources files into War file.
I read this explanation on the maven official site:
http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-source-inclusion-simple.html
I wonder if it's the only way to include all sources files contained within all modules.
Can't the... |
I am aware of the C++ Virtual Table which allows dynamic dispatch for doing things at runtime (although if I am honest I am not completely sure of the full list of things it achieves).
I am wondering what other "low level" aspects of C++ are there, which one doesnt usually come across when learning the C++ language?
Th... |
Ive been building a website with 2 pages and 1 master page. The master master page works as a "Menu". The two pages inherits from the master page and have some content on them.
On Page1 I have a link to Page2. Once I click on the link Page2 (and master page) loads.
Pretty straight forward I guess. But my question is no... |
I've got a senior developer with eight years of .NET experience starting tomorrow to work on a 11,000-lines-of-code application. In the team there's myself and another programmer. We've both got about three years experience each.
It's my first project as a manager (I'm also a developer on the project) and this is the f... |
When programmers talk about "data structures", are they only talking about abstract data types like lists, trees, hashes, graphs, etc.?
Or does that term include any structure that holds data, such as composite types (class objects, structs, enums, etc.) and primitive types (boolean, int, char, etc.)?
I've only ever h... |
A few months ago we found a library licensed under GPL that fit the bill for what we were looking to do at that time. We included it in our codebase and all was fine. Now, a few frantic months of coding later, we've refactored the hell out of the library: it's more feature complete, more stable, fully unit tested, PSR-... |
I need to process 2 million messages per second (perhaps in a scale out configuration) and route each message to a N delegates or multicast delegates.
Question
How should I structure my application in C# so that I can achieve the
best performance when receiving the message, and routing it to the
correct delegate?
Addit... |
Does the structured programming definition only consider imperative programming? By this I mean does the definition of structured programming automatically exclude functional programming (in the most common usage, by which I mean not necessarily pure-functional programming, but something like Clojure).
Structured prog... |
The biggest drawback of agile development I have experienced is that people not involved in development focus on the mantra that a user story (3-10 ideal person days) should not contain more than 1-3 sentences like:
As a customer, I can use free-text search so that I can find the products I'm looking for.
Giving this... |
I used to write C++ extensively between 8 and 10 years ago. I have since moved on to C# for professional reasons. However, from time to time I see statements like
"If you're still manually tracking pointer references, you're doing it wrong"
or
"C++ is perfectly safe as long as you're using modern concepts like R... |
My boss wants to introduce new guidelines for the computers in our company. This means that the software environments will be completely standardized with a predefined set of tools. The goal is that all machines are completely reproducable and exchangable.
I'm wondering what the guidelines for developer's computers are... |
The small website I built a long time ago is starting to pick up a little and I'm starting to run into problems with making changes. Originally, all the pages were .html and I would edit and test them offline to make sure everything worked. Then I realized how helpful php includes were, so I changed everything to .php ... |
I'm coming back to C++ after a month. I still didn't start practicing but seeing my old code gives me nauseous feeling like I'm seeing something new even with simple small code.
Is this normal? Will I retain everything as I'll start writing code back?
|
I went through a line somewhat like this "PHP has no native support for Unicode". Also i read that Python has native support for Unicode. Now you can call a function utf8_encode() in PHP to encode a string into Unicode and you can use a function unicode() in Python to convert a string to unicode. So what does it mean t... |
I have seen a practice from time to time that "feels" wrong, but I can't quite articulate what is wrong about it. Or maybe it's just my prejudice. Here goes:
A developer defines a method with a boolean as one of its parameters, and that method calls another, and so on, and eventually that boolean is used, solely to det... |
This may very well be nothing new and probably exists, but I've never learned about it and would like to.
The simplest way to be more specific is just to give an example.
I was on the bus and downloaded a Text to Speech appliation onto my Android phone.
I know that the speech synthesizer might run on my phone but pro... |
I've asked this question before and I got a few answers/idea, but I'm not sure how to implement them.
I'm building a telecom messaging solution. Currently, I'm using a database to save my transaction/messages for the network stack I've built, and as you know it's slower than using a data structure (hash, linkedlist, et... |
Note: I asked a very similar question on StackOverflow but did not get much attention, so was directed to http://programmers.stackexchange.com as licensing issues seem to have more interest here...
I am not an expert in Google Maps policies although I am aware that downloading / caching map tiles is not encouraged at a... |
I am not sure if this would be the right forum to ask the question (Please let me know and I will move the question to appropriate forum).
I would like to know what can be the best way for elders (in my case, my parents) to learn how to program. I was looking at Qimo 4 kids as a possible platform so that my parents ca... |
I'm new to the social coding community and don't know how to proceed properly in this situation:
I've created a GitHub Repository a couple weeks ago. Someone forked the project and has made some small changes that have been on my to-do. I'm thrilled someone forked my project and took the time to add to it. I'd like to ... |
Over the past year or two, I've been playing with newer technologies in my side projects. As a web developer, I've gone from the following (and still the following, at work):
The 'classic' technology stack
Web browser POSTs forms to...
a C#-coded web application server-side, communicating to...
external services via X... |
I have objects which implement the interface BroadcastInterface, which represents a message that is to be broadcast to all users of a particular group. It has a setter and getter method for the Subject and Body properties, and an addRecipientRole() method, which takes a given role and finds the contact token (e.g., an ... |
Is there an algorithm which I can use in order to generate synonyms for some term (word) in respect of a spam. I am writing a simple spam filter.
For example, I set that the app must omit a word "viagra" and press a button which saves this term into a filter database. A script automatically creates synonyms of this wor... |
I am asked to provide performance statistics for a program, one of them being memory consumption. I noticed that in perfmon or in .NET API there is apparently many variable related to memory usage, such as private bit, working set, page file, etc.
What are the difference, and which one should we use for measuring perf... |
I'll try to keep this question as specific as possible..
I'm about to start building an API for an upcoming project. I'm currently thinking PHP/Symfony2. It will be a farily simple HTTP-based api for CRUD on the site's models (and relationships between them).
There will also need to be a CMS for users. Traditionally w... |
I'm referring to *nix command line applications primarily, where you want to permanently modify the behavior from defaults.
Environmental variables are easily understood and implemented, usually requiring the user to modify their ~/.bashrc for a permanent change. However, namespace collision might be a problem (but unl... |
I'd like to prototype a computer algebra system. An equation would be represented by a tree and rules would be defined - similarly to mathematical axioms - by specifying a pattern (in the tree) and a restructuring rule for the matched part of the tree.
Can you suggest a programming language I could experiment with to t... |
We are trying to design our system to be testable and in most parts developed using TDD. Currently we are trying to solve the following problem:
In various places it is necessary for us to use static helper methods like ImageIO and URLEncoder (both standard Java API) and various other libraries that consist mostly of s... |
For the purposes of discussion let's consider a FourSquare scenario.
Scenario
Entities:
Users
Places
Relationships:
Checkins: users <-> places, many to many
Friends: users <-> users, many to many
Database Design
These will most likely have errors, please point them out.
RDBMS
Tables:
Users
Places
Checkins (junctio... |
Assume I have a stream of records that need to have some computation. Records will have a combination of these functions run Sum, Aggregate, Sum over the last 90 seconds, or ignore.
A data record looks like this:
Date;Data;ID
Question
Assuming that ID is an int of some kind, and that int corresponds to a matrix of ... |
I'm evaluating some NoSQL solutions for a project of mine and JCR popped up during my searches as a document store. But it seems somehow of an obscure niche which didn't have the impact its designers hoped for.
I'm interested in the technology, but so far there does not seem to be a lot of resources out there to show i... |
I'm trying out Visio for the first time today, creating ERD's. Is it possible to specify alternate keys in addition to PK's in Visio ERD diagrams. I can't see any way to define more than one key on a table.
Any ideas? Cheers.
|
Team is starting on their first capital-A Agile project, and the project seems like it will fall in line nicely with the methodology (i.e. we can probably just grab an agile book and follow it like a recipe), with one bit of confusion:
The project involves three things that nobody on the team has any experience with: I... |
When correcting bugs, it is encouraged where I work to first write a test that fails with the given bug, and then to fix the code until the test passes.
This follows TDD practices, and is supposed to be good practice, but I noticed it tends to produce cryptic tests that come really close to the implementation.
For inst... |
I've been programming C++ for almost a year, and I've written complex programs however there are a couple of programming features of C++ which I didn't cover up (Classes & pointers), however I felt ready to develop a desktop application. I didn't get any books nor did I find any REAL documentation. I said to myself "Pr... |
Context:
Student working through Class design in personal/side project for Summer. I've never written anything implemented by others or had to maintain code. Trying to maximize encapsulation and imagining what would make code easy to maintain.
Concept:
Tight/Loose Class design where Tight and Loose refer to access modi... |
Before we start this, let me say I'm well aware of the concepts of Abstraction and Dependency Injection. I don't need my eyes opened here.
Well, most of us say, (too) many times without really understanding, "Don't use global variables", or "Singletons are evil because they are global". But what really is so bad about ... |
Let's say I have two object types, A and B. The relationship between them is many-to-many, but neither of them is the owner of the other.
Both A and B instances need to be aware of the connection; it's not just one way.
So, we can do this:
class A
{
...
private: std::vector<B *> Bs;
}
class B
{
private: s... |
I need to transliterate a Hebrew text. So wrote a little Python script, which reads-in the Hebrew text from a text file, globally replaces the Hebrew letters with Latin ones. Now I need to do some fine tuning (replace certain things in some position but not in other, so a global replace won't do). The trouble is the fo... |
In my project (and I am sure many others), I need to copy a subset (R2) of one bitmap image (R1), into a region (R3) in another, where the destination region can be any size (stretching and scaling where necessary).
I am sure this is a solved problem but I cannot find any examples; what is the most straightforward alg... |
I am reading about a start-up company that works with online surveys:
Fulcrum is the world’s first complete project management suite to give
clients the power to seamlessly integrate multiple suppliers, increase
productivity and reduce costs. Ranging from vertically integrated
research firms to sample suppliers... |
Every so often I run into a situation where I need to map a set of properties from one object to another object of a different, unrelated class. The set of properties is large enough to make typing out the code by hand tedious. Anti-DRY principle code like this is the result:
if (objectOfType1.getPropertyA() != null){o... |
Years ago somebody created a bunch of really awesome and popular scripts. But they were not updated for a long, now they no-longer work (target platform were updated, and some changes are needed).
He hasn't released it under any license. I want to fix the bug (currently, many of the target users can't use it), and pos... |
This is my first question here so I hope it is not off topic. Although I am using the Linux inotify library to listen for changes to files, and I compare use of that against the Subversion program, I am specifically looking for the algorithm used.
To a human it is very easy to tell if a file has been created or modifie... |
I am developing a Java application. While using the application, data would be generated that needs to be stored on disk. I am looking for an embedded database appropriate for a average use-case of the application.
Initially I planned to use XML for storing information. But, then after some articles, I found a general ... |
Some of us can say a Distributed Version Control System (e.g. Mercurial, git) will have a positive impact on developers only out of the experience of using one (under the right conditions: higher productivity, higher code-base stability, etc.), but, in what situations could a customer (i.e. the observer of the outcome ... |
Sometimes I'm such a nerd that not even nerds understand me, or rather, sometimes I cannot put stuff in understandable and simple-enough terms... and sometimes I can but cannot really tell until after.
I like the details on technical stuff, I enjoy writing about them, but sometimes I cannot stop or tell when it is too ... |
I've recently been working on a web development project on a team of less-than-five people. Things are going good but now we are decided to go with test-driven development.
So far what I've learned is that one of the ultimate goal is that when you are testing your software, everything should be passed. However our cur... |
I would like to ask something about project management. I got a project that has some requirements, it can be done from scratch with the use of a big framework. Maybe some tools are necessary for some of the functions. But using a framework seems very cool, it seems that reduces the amount of work, but need to study a ... |
I am trying to determine some good interview questions to assess the ability of people coming in for a Html/CSS job, however that topic is extremely broad, and I'm not sure what sort of questions I can ask to properly evaluate someone's HTML/CSS knowledge.
What sort of questions can I ask to evaluate a candidate's Html... |
I am a web developer. I'm doing all kinds of web-sites and web applications.
It's very strange for me that a lot of customers do not know the difference between a web developer and a slicer. They just want to "give you the PSD" and expect you to give them a web site with a DB back-end and so on...
I'm just asking here:... |
In this blog posting by Uncle Bob
http://blog.8thlight.com/uncle-bob/2012/04/20/Why-Is-Estimating-So-Hard.html
Author states a possible solution to the problem at hand. He writes "Try this. Break some long string of text up into columns that are 10 characters long. Each time you break a line, record the position of the... |
I asked myself why we didn't import a package while we use String functions such as toUpperCase()? How they get in there without importing packages?
|
I'm not actually sure that "maze" is the correct term. Basically users start in a single Room that has 4 doors (N, S, E, and W). They can go in any direction, and each subsequent room is contains another room with anywhere from 1 to 4 doorways that go to other rooms.
The "maze" is supposed to be unlimited in size, and ... |
I have a 4 years old project which is written in Swing + SwingX. Currently, it is still alive and still kicking.
However, as more GUI related feature requests coming in (For instance, a sortable tree table), I start to feel the difficulty in fulling the requests. This is true especially since there isn't any active dev... |
Goal:
I'm trying to figure out the best way to model/design and then implement a "user" feature in a system.
Background:
I am designing an on-line access request system, so our company can use a web-based method for users to request access to various software systems. Since the system is all about the "user", the user ... |
Is there a pattern or standard way to handle Ajax race conditions? Take the following example. You have two tables. Clicking a row on table 1 removes the data from DB and then updates table 2 (which would now be showing all the rows of table 1 less the row that was clicked).
If someone where to click a bunch of rows i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.