instruction stringlengths 34 19.9k |
|---|
I've recently read three separate books on algorithms and data structures, tcp/ip socket programming, and programming with memory. The book about memory briefly discussed the topic of serializing data structures for the purposes of storing it to disk, or sending it across a network. I can't help but wonder why the the ... |
I always use System.out.println(...) to debug my code, and it works pretty well. In which cases do you use the eclipse java debugger? I never had to use it and the little bug symbol is still ab bit mysterious to me. Are there cases where the debugger helps me that I can´t solve with a println?
|
I have written many codes using OOPS and I am still to understand when is a code good enough to be accepted by experts. The thought procedure of every man is different and so is the design. My question is should I do something in particular to design my programs in such a way that they are good enough to be accepted by... |
The solution for the 3-d case can be found here; I would like to get the generalized version. There's no simple generalization of the Mathworld algorithm since the cross product is defined only for 3 and 7 dimensions, so I understand.
|
I'm working on a PHP project where some object (class member) may contain different data type. For example :
class Property {
private $_id; // (PK)
private $_ref_id; // the object reference id (FK)
private $_name; // the name of the property
private $_type; // 'string', 'int', 'float(n,m)', 'dat... |
It might be like this: Parameter means from the callers POV and arguments mean inside the procedure, or other way round.
Or is there no difference?
Update
In Swedish we say "anropsparametrar" i.e. "parameters that are calling the procedure" and we would not say "anropsargument" ("arguments that are calling the procedu... |
We are doing software testing by testing a lot of I/O cases, so developers and system analysts can open reviews and test for their committed code within a given time period (e.g. 1 week). But when it come across with extracting information from a database, how to consider the cases and the corresponding methodology t... |
I've heard that Perforce is very good at merging, I'm guessing this has to do with that it tracks changes in the form of changelists where you can add differences across several files in a single blow. I think this implies Perforce gathers more metadata and therefore has more information to do smarter merging (at least... |
I'm seeing a lot of instantiable classes in the C++ and Java world that don't have any state.
I really can't figure out why people do that, they could just use a namespace with free functions in C++, or a class with a private constructor and only static methods in Java.
The only benefit I can think of is that you don't... |
In visual programming, there are many events which support our application tasks. So, along with user defined processes, should these also be in flowchart or not?
What about the constructors of classes, are they supposed to be shown in flowchart or not?
|
Title says most of it. I have found surprising little information about this. I have a long running operation of which the user wants to see the progress (as in, item x of y processed). I also need to be able to pause and stop the operation. (Stopping doesn't rollback the items already processed.)
The thing is, it's no... |
Situation: a piece of software reads frames of data from a file in a seperate thread and puts it on a queue, emptied by another thread. That second thread periodically checks on the queue and fails rather gracefully, by showing an error message stating the read timed out, if no data is available within a certain amount... |
I am writing code to parse mathematical expression strings, and noticed that the order in which chained power operators are evaluated in Python differs from the order in Excel.
From http://docs.python.org/reference/expressions.html:
"Thus, in an unparenthesized sequence of power and unary operators, the operators are e... |
Sorry, for my confused question. I'm looking for some pointers.
Up to now I have been working mostly with Java and Python on the application layer and I have only a vague understanding of operating systems and hardware. I want to understand much more about the lower levels of computing, but it gets really overwhelming ... |
I just read through the documentation on the Codecs module, but I guess my knowledge/experience of comp sci doesn't run deep enough yet for me to comprehend it.
It's for dealing with encoding/decoding, especially Unicode, and while to many of you that's a complete and perfect explanation, to me that's really vague. I d... |
I have a large java project, and we use maven for our build cycle. This one project is used extensively - in other projects, in various applications, some of which are contained in it and some which are elsewhere... To be honest, it's a bit of a mess (various bits added on at different times for specific purposes), and... |
Looking into Haskell's standard library we can see:
newtype StateT s m a = StateT { runStateT :: s -> m (a, s) }
newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a }
newtype Sum a = Sum { getSum :: a }
Apparently, there (at least) 3 different prefixes used to unwrap a value inside a newtype: un-, run- and get... |
Say, my project have dependency N with version 1.0.0.
Then something have changed, and I should depend on newer version - let it be 1.0.1.
OK, I'm incrementing dependency version, nothing else changes in my code.
It looks like I should increment my own projects' version, but how exactly I should increment?
Should I inc... |
Edit: I'm rephrasing the question a bit. Apparently I caused some confusion because I didn't realize that the term destructor is used in OOP for something quite different - it's a function invoked when an object is being destroyed. In functional programming we (try to) avoid mutable state so there is no such equivalen... |
Sometimes I would like to declare a property like this:
public string Name { get; readonly set; }
I am wondering if anyone sees a reason why such a syntax shouldn't exist. I believe that because it is a subset of "get; private set;", it could only make code more robust.
My feeling is that such setters would be extreme... |
I have an issue tracking system, but sometimes users report bugs directly to me in an email.
If I'm responding to a bug report in an email, what's a good etiquette to use? Do I thank them for reporting the bug? Do I apologize for it ? Is there a good template anywhere?
|
I am implementing a tree Data structure in c# based (largely on Dan Vanderboom's Generic implementation). I am now considering approach on handling a Count property which Dan does not implement.
The obvious and easy way would be to use a recursive call which Traverses the tree happily adding up nodes (or iteratively tr... |
Wikipedia's definition of software rot focuses on the performance of the software. This is a different usage than I am used to; I had thought of it much more in terms of the cleanliness and design of the code—in terms of the code's having all the standard quality characteristics: readability, maintainability, etc. Now,... |
I have been practicing coding for a while, but the problem is that it takes me a lot of time to write a solution for the problems. I want to ask if competitive programming can help me in improving this.
If yes, then how should I start and from which web sites could I use (like TopCoder)? I obviously won't be able to so... |
How do you work with forms in your web applications?
I am not talking about RESTful applications, I don't want to build heavy front-end using frameworks like Backbone.
For example, I need to add "contact us" form. I need to check data which was filled by user and tell him that his data was sent.
Requirements:
I want t... |
I am having a design problem in test automation:-
Requirements - Need to test different servers (using unix console and not GUI) through automation framework. Tests which I'm going to run - Unit, System, Integration
Question: While designing a test case, I am thinking that a Test Case should be a part of a test suite (... |
I'm sure this scenario has arisen before, and I want to know what experience has taught to be the best solution.
I have a number of classes that are all of a kind. Say all the objects are "Content". They may be "Article", or "Book" for example.
The reason I want the "Content" abstraction is because I want to define... |
On this picture:
Does updating grades extend a feature that shows grades? I am not sure if the notation is correct, so I am hoping you guys will know it.
|
I have recently seen a few URIs containing the query parameter "utf8=✓". My first impression (after thinking "mmm, looks cool") was that this could be used to detect a broken character encoding.
So, is this a better way to resolve potential problems with character encoding, or is it just a developer having fun with a ... |
What is the difference between eScience infrastructures and grid computing or distributed computing infrastructures? And what are some of their examples.
I can not distinguish them clearly. Is it how a grid is used make it an e-science platform?
|
In some cases, I want to use referentially transparent callables while coding in Python. My goals are to help with handling concurrency, memoization, unit testing, and verification of code correctness.
I want to write down clear rules for myself and other developers to follow that would ensure referential transparency.... |
I was always taught to strive for the highest Normal Form of database normalization, and we were taught Bernstein's Synthesis algorithm to achieve 3NF. This is all very well and it feels nice to normalize your database, knowing that fields can be modified while retaining consistency.
However, performance may suffer. Th... |
Sometimes when I start a small project (like an android app), I don´t know which approach will work out at the end, and I just go for one approach and give it a try. But if I never used this approach before (for a sort of application I´ve never programmed before) it is like stepping into unknown terrain. I don´t know w... |
What would be a good GPU to start learning CUDA on?
Are any GPUs unsuitable?
|
I'm working on a project that uses some icons that are under a Creative Commons license (ND) that forbids modification of the picture.
What can I do with this icons as a programmer?
Can I modify the looks of the image in the program as long as I don't change anything in the file that contains the icon?
Have I modified... |
Globally Unique Identifiers (GUID) are a grouped string with a specific format which I assume has a security reason.
A GUID is most commonly written in text as a sequence of hexadecimal
digits separated into five groups, such as:
3F2504E0-4F89-11D3-9A0C-0305E82C3301
Why aren't GUID/UUID strings just random bytes en... |
I've done quite a lot of javascript over the years and I'm using a more object-oriented approach, specifically with the module pattern. Which kind of approach do you do use to avoid a bigger code-base to becoming spaghetti. Are there any "best approach"?
|
Recently, I read that Facebook ads are moving towards retargeting and got interested deeper into subject. Essentially, retargeting is technique advertisers use that tracks purchase intent by putting cookies into your browser and when you visit another website within ad network you will see ad for item you "wanted to bu... |
I've just started work at a small start-up company who mainly uses PHP to develop their front-end apps. I had no prior PHP experience before joining, and this has led to my apps becoming large pieces of spaghetti code. I essentially started by adding code to implement an initial feature, and then continued to hack in m... |
I'm buying a few C++ books after moving from Java. I obviously want to read the reference manual from the man himself, though I cannot tell the difference between these two editions. The special edition is ten pages shorter than the third edition. However, the special edition is recommended over the third edition and i... |
I'm learning the 23 design patterns of the GoF.
I think I've found a way to understand and simplify how the Abstract Factory works but I would like to know if this is a correct assumption or if I am wrong.
What I want to know is if we can see the result of the Abstract Factory method as a matrix of possible products wh... |
I'm trying to return an object when mocking a parser class. This is the test code using PHPUnit 3.7
//set up the result object that I want to be returned from the call to parse method
$parserResult= new ParserResult();
$parserResult->setSegment('some string');
//set up the stub Parser object
... |
I have a set of numbers say : 1 1 2 8 5 6 6 7 8 8 4 2...
I want to detect the duplicate element in subsets(of given size say k) of the above numbers...
For example :
Consider the increasing subsets(for example consider k=3)
Subset 1 :{1,1,2}
Subset 2 :{1,2,8}
Subset 3 :{2,8,5}
Subset 4 :{8,5,6}
Subset 5 :{5,6,6}
Sub... |
Even though I have quite some experience in using various tools, I still can't make up my mind whether I prefer using IDE or a simple editor for code editing.
Most IDEs I have experienced are written in Java (like Eclipse) which makes them slow and bulky. What's good about them is that it provides lots of tools.
On th... |
I have been looking for some advice for a while on how to handle a project I am working on, but to no avail. I am pretty much on my fourth iteration of improving an "application" I am working on; the first two times were in Excel, the third Time in Access, and now in Visual Studio. The field is manufacturing.
The basic... |
I am maintaing several data process shell scripts which are full of if-else statements and for loops . I try to make the scritps tidy and easy to debug.
When I read some suggestions about shell code best practice, it seems that is is not a best practice to have many if-else and for loop statements.
So what should I d... |
Given a rectangular board of height H and width W.
N colors are given and each color occupies Xi percentage of area on the board.
Sum of Xi's is 1.
The colors on the board must be placed in rectangles.
An optimal solution has the rectangles' aspect ratios as close to 1 as possible.
An ideal case has the board filled on... |
This question is centered around Scheme but really could be applied to any LISP or programming language in general.
Background
So I recently picked up Scheme again having toyed with it once or twice before. In order to solidify my understanding of the language, I found the Revised^5 Report on the Algorithmic Language S... |
Can someone clarify the following things for me ?
Let's say I want to build a website and add publicity to it so I can make money out of my work.
I would use Html5 for the interface and C# with ASP.NET for the background programming.
I would use Visual Studio as my IDE and SQL server as a database.
This is just an exam... |
I am a beginning iOS programmer and use the Model-View-Controller model as a design pattern: my model doesn't know anything about my view (in order to make it compatible with any view), my view doesn't know anything about my model so they interact via my controller. A very usual way for a view to interact with the cont... |
I am working on saving state of an object to a database using the data mapper pattern, but I am looking for suggestions/guidance on the validation and error message generation step (step 4 below). Here are the general steps as I see them for doing this:
(1) The data mapper is used to get current info (assoc array) abou... |
It's not meant to be subjective or get advice on what would be the best path to take, but an objective list of things that must be known in order for me to pick up a book on compiler theory and understand it.
What level of mathematics, and related skills are required?
|
Is there a 'design pattern' styled listing of common/popular algorithms anywhere? Specifically, something that has a similar format along the lines of:
Algorithm Name: e.g., Quick Sort, Bubble Sort, etc.
Problem: A description of the stereotypical problem the algorithm is supposed to address
Description: Description o... |
I'm taking a class where I work with a partner to implement the link layer of the OSI model.
I've worked programmed with a partner once before and it went bad. Is the goal to divide the work up and decides who does what or should one person code and the other person reviews and switch roles after a while?
Any tips are ... |
I'm re-working on the design of an existing application which is build using WebForms. Currently the plan is to work it into a MVP pattern application while using Ninject as the IoC container.
The reason for Ninject to be there is that the boss had wanted a certain flexibility within the system so that we can build in ... |
Java would be jsps and servlets (or a framework such as Spring) running on the JVM and tomcat (or glassfish etc).
C# would be asp and C# running on dot.net framework and IIS ? (I have no experience with this please correct and improve my terminology)
Is there an equivalent for C++ ? I could happily call some C++ from a... |
I'm a Python programmer learning C# who is trying to stop worrying and just love C# for what it is, rather than constantly comparing it back to Python.
I'm caught up on one point: the lack of explicitness about where things are defined, as detailed in this Stack Overflow question. In short: in C#, using foo doesn't tel... |
So looking around earlier I noticed some comments about long methods being bad practice.
I am not sure I always agree that long methods are bad (and would like opinions from others).
For example I have some Django views that do a bit of processing of the objects before sending them to the view, a long method being 35... |
At my local university, there is a small student computing club of about 20 students. The club has several small teams with specific areas of focus, such as mobile development, robotics, game development, and hacking / security.
I am introducing some basic agile development concepts to a couple of the teams, such as u... |
I am (re-)designing some packages for R, and I am currently working out the necessary functions, objects, both internal and for the interface with the user. I have documented the individual functions and objects.
So I have the description of all the little parts. Now I need to give an overview of how the parts fit toge... |
I'm developing an app that will be used to open and close valves in an industrial environment, and was thinking of something simple like this:-
public static void ValveController
{
public static void OpenValve(string valveName)
{
// Implementation to open the valve
}
public static void CloseVal... |
I've been looking at some job postings and noticed that a fair amount of them list IDEs under the 'required skills' section, even for senior positions. This is not localized to one company either, but rather it's something that comes up once in every few postings.
I am perplexed by this job requirement, as my mentors a... |
I was thinking a lot about software licensing lately, because I would like to do some coding. I'm not an expert in all those licenses, so I came up with my own idea, and before I will put in on paper, I would like to make sure that I didn't reinvent a wheel, so maybe I would be able to use something that exists.
Main i... |
I've never worked in assembly, but I was just curious if SDK's exist for assembly programming. For instance, if I wanted to create a linked list, are there libraries available that have already done this, or is everything typically done from scratch?
|
I'm doing a little pro bono work for an organization in Central America. I'm ok at Spanish and my contacts are perfectly fluent but are not techincal people. Even if they don't care what I call some fields in a database I still want to make as clean a schema as possible, and I'd like to know what some typical abbreviat... |
I have written a program which records protocol messages between an application and a hardware device which matches each application request with each hardware response. This is so that I can later remove the hardware, connect a 'replay' application to the main application and wait for an application request and reply... |
I am creating a pair of apps, one to run preferably on tablets, but also laptops and PCs, and the other for WP8.
These apps are complementary - having one is of no use without the other.
I know there is a Windows Store, and a Windows Phone store, so one would be released on one, and one on the other.
My question is: a... |
I have been programming for couple of years and am generally good when it comes to fixing problems and creating small-to-medium scripts, however, I'm generally not good at designing large scale programs in object oriented way. Few questions
Recently, a colleague who has same number of years of experience as me and I w... |
Possible Duplicate:
Do I need to use an interface when only one class will ever implement it?
I am taking over a project where every single real class is implementing an Interface. The vast majority of these interfaces are implemented by a single class that share a similar name and the exact same methods (ex: MyCar... |
I have a course in which the proffesor has asked us to create a DSL for a our final project. He presented us in the first courses xText with Eclipse. This being a new course, I am still a bit fuzzy on what Domain Specific Languages means.
This is my current understanding: a domain specific language is a language th... |
Is there a good term that is similar but different than "deprecate" to mean that a method or API is in the code base but should not be used because its implementation is not complete or will likely change? (Yeah, I know, those methods shouldn't be public, yada yada yada. I didn't create my situation, I'm just trying to... |
First of all: I've got no academic background. I'm working primarily with Java and Spring and I'm also fond of web programming and relational databases. I hope I'm using the right terms and I hope that this vague question makes some sense.
Today the following question came to my mind: How much is modern programming sti... |
I'm a big StackOverflow fan, but I think this question belongs here, correct me if I'm wrong.
So basically I'm trying to localize my plugin in as many languages as possible. I posted a section on the docs to reach people that wants to help translating but I only got one contributor that attached a German translation. S... |
This is a follow up question on my past questions :
Concurrency pattern of logger in multithreaded application
As suggested by others, I am putting this question separately.
As the learning from the last question. In a multi-threaded environment, the logger should be made thread safe and probably asynchronous (where ... |
Doing unit testing for the first time at a large scale, I find myself writing a lot of repetitive unit tests for my business logic. Sure, to create complete test suites I need to test all possibilities but readability feels compromised doing what I do - as shown in the psuedocode below.
How would a well written, readab... |
When coding, I naturally often come up with classes or a set of classes with a high reusability. I'm looking for an easy, straight-forward way to work on them separately.
I'd like to be able to easily integrate them into any project; it also should be possible to switch to a different version with as few commands as po... |
I'm working on a web project (PHP, jQuery) which currently using Google Maps powering up the map functionality of the application, however we need to make it multi-platform like you can go to the dashboard and choose one from 5-10 map providers (which Goolge Maps is just one of them) to underlying your map functionalit... |
When I'm using C# to write some code and I define an interface using Visual Studio 2010, it always includes a number of "using" statements (as shown in the example)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestEngine.TestNameSpace
{
interface ITest1
{
... |
About 3 months ago our lead web developer and designer(same person) left the company, greener pastures was the reason for leaving. Good for them I say. My problem is that his department was completely undocumented. Things have been tough since the lead left, there is a lot of knowledge both theoretical knowledge we us... |
Possible Duplicate:
How do you dive into large code bases?
I just joined a new company and started to study one of the their bigger system. For me to be productive, I need to understand the entire system without too much help. Other programers are really busy and dont' have time to hold my hands.
I used to use brain... |
Our data model has almost 200 classes that can be separated out into about a dozen functional areas. It would have been nice to use domains, but the separation isn't that clean and we can't change it.
We're redesigning our DAL to use Entity Framework and most of the recommendations that I've seen suggest using a Repos... |
I'm attempting to write a process that matches obscure strings to a single 'master string' for further processing. I have a lot of data that looks something like this:
Basketball
Basket Ball
Football
BasketBallR
BBall
BBall - r
FootB
...and so on. These need to be mapped to a master record like so:
Basketball = ... |
When it comes to OO database access you see two common approaches - the first is to provide a class (say "Customer") with methods such as Retrieve(), Update(), Delete(), etc. The other is to keep the Customer class fairly lightweight (essentially just properties) and perform the database access elsewhere, e.g. using a ... |
We are initiating a Spring + Primefaces project and the first problem we have encountered concerns storing the XHTML pages into the WEB-INF folder.
When we use a faces form in a view located inside the WEB-INF folder, then the commandButton does not execute the managed bean method.
<h:form id="loginForm">
<p:comma... |
Say we have a list of Task entities, and a ProjectTask sub type. Tasks can be closed at any time, except ProjectTasks which cannot be closed once they have a status of Started. The UI should ensure the option to close a started ProjectTask is never available, but some safeguards are present in the domain:
public class ... |
I'm resizing an image based on a non-integral conversion factor (a bmp image, in fact). I understand how resizing works, just non with a decimal number. For instance, if the factor were 2, I would simply write the individual pixels twice to the output file. You can't really write 1.5 pixels if the factor were, say, ... |
I would like to port a large Win32 DLL to native linux in C++. I don't think I can use Wine for a DLL like mine, because users of the DLL would then also have to be in Wine, and then they would all whine... As a Windows C++ programmer, I don't (yet) have any familiarity with the GUI front-end services in linux, but i... |
I am a bit confused as to what I am/am not allowed to do with a LGPL Library that I intend on using in a small scale commercial C++ Application that I am developing. My current understanding, although I don't know if I am correct, is that I am permitted use the library without releasing the source to the rest of my app... |
In a few months, a friend will establish his startup software company, and I will be the software architect with one additional developer. Though we have no real day-to-day experience with agile methods, I have read much "overview" type of material on them, and I firmly believe they are a good - if not the only - way t... |
I hope you can confirm or disprove whether I understand this correctly. I know for certain that Java Applets can have hardware acceleration and I wonder if this is the only known way to have graphics hardware acceleration in web pages or is there another way?
|
As I have already asked here, I have to implement a Multi-Platform Map application. Now I have Mapstraction as an option which uses Javascript to implement the desired functionality. My question is, "Is there any reason/benefit to implement such a library (let say, Adapters) in Server-side (in my case, PHP)?"
As these ... |
What is the best method to use and share variables between functions in non object-oriented program languages?
Let's say that I use 10 parameters from DB, ID and 9 other values linked to it. I need to work with all 10 parameters in many functions. I can do it next ways:
1. call functions only with using ID and in ever... |
For example if I have code that contains parts of code rewritten from code found here or on Stack Overflow or other Creative-Commons licensed code, can my final code be licensed with an Apache License?
|
I understand Objective-C categories and how they become useful, but I always have a hard time explaining the concept to other programmers that are not familiar with Objective C.
Maybe I'm just bad at explaining things, but I was thinking at another way to explain it by comparing to similar features offered by other (m... |
Can code licensed under a clause like this:
Redistribution of this work, with or without modification, is permitted if
Bob Joe is attributed as the original author or licensor of
this work, but not in any way that suggests that Bob Joe endorses
you or your use of the work.
be used in a project using GPL, or does this ... |
Inspired by this answer:
Liskov Substitution Principle
requires
that
Preconditions cannot be strengthened in a subtype.
Postconditions cannot be weakened in a subtype.
Invariants of the supertype must be preserved in a subtype.
History constraint (the "history rule"). Objects are regarded as being modifiable only... |
We have a dispute regarding who owns which tasks when it comes to the CSS on our live site.
Our designer argues that he is not responsible to log-in to word press and modify the css or use ftp for any changes because that's not his job description while developer argues that since it is css, it belongs to designer and ... |
My team follows the Scrum development cycle. We have received feedback that our unit testing coverage is not very good.
A team member is suggesting the addition of an external testing team to assist the core team, but I feel this will backfire in a bad way.
I am thinking of suggesting pair programming approach. I have ... |
I am currently reviewing a code base and noticed that a majority of the calls (along with DB connections) are just buried inside the PHP scripts. I would have assumed that like other languages they would have developed some sort of data access layer (Like I would do in .Net or Java) for all of the communication to the ... |
I'm currently planning on implementing API for HgLab and the obvious role model for me here is GitHub.
My API obviously won't be an exact copy due to inherent differences between Mercurial and Git and due to different tasks GitHub and HgLab solve, but similarity will be quite clear.
How ethical of me will it be to copy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.