Memory, files, network connections, I/O devices and other objects that have to be acquired and then released within a program. Please do not use this tag to ask questions about educational resources such as tutorials, books, websites or classes. Those are off-topic on Programmers.

learn more… | top users | synonyms

0
votes
4answers
181 views

How do I elegantly store tabular data in code?

Let's say I want to store date which cannot be changed by the user in code. For example, my application supports ten types of reports, and I want to store metadata about it. Usually, I'd use a ...
-1
votes
1answer
57 views

How costly is DB data transfer as compared to data storage?

I've seen a number of answers (1, 2, 3) where they state that storage is cheap. So when designing a DB structure, it shouldn't be a main concern, or at least it doesn't rank very high in the list of ...
0
votes
1answer
81 views

When should I consider using a string table resource over a string constant in my Win32 application?

I've written a fair bit of Win32 desktop apps as hobby projects throughout my career but I've never used resources of the type string table in any of them; usually I either hard-code strings or build ...
2
votes
2answers
219 views

Does RESTful response always return a 404 and empty content when an array is expected but the result is empty?

I worked with Ruby on Rails and RESTful api before and now with Django Rest framework. For this question let's say we only consider the case of JSON but not XML. It seems that when we expect an ...
4
votes
1answer
183 views

Is it better not to .close() inside API method body when passed a Reader or InputStream?

There are plenty of similar questions that have been answered. Example here. However, they all have both the Reader and the InputStream within the same scope or method body, and so suggest to close ...
3
votes
2answers
134 views

How do I model a sortable resource in sql database? [closed]

I encounter this issue when I create REST API. I cannot tell the exact scenario, but let's say it is for a website that has category and product resources. Each category has many products and both ...
6
votes
2answers
888 views

Should Java 8 Stream instances always be close()'d?

Quoth the Javadoc: Streams have a BaseStream.close() method and implement AutoCloseable, but nearly all stream instances do not actually need to be closed after use. Generally, only streams whose ...
8
votes
4answers
2k views

Will the Database connection be closed if we yield the datareader row and not read all the records?

While understanding how yield keyword works, I came across link1 and link2 on StackOverflow which advocates the use of yield return while iterating over the DataReader and it suits my need as well. ...
1
vote
1answer
48 views

Fill widget with data retrieved from internet

I want to retrieve data from internet and show them into a widget. In particular, I've a widget with a QComboBox containing some service from which I can retrieve a list of exchange markets. When I ...
3
votes
1answer
109 views

How to deal with relative paths in out of source build?

An out of source build is a build which can be in any directory other than the source directory I have a project which contains relative paths to some resource files, needed at runtime, which are ...
1
vote
0answers
88 views

Pointers vs IDs for “context-specific” functions

I need to be able to load, use, and free resources from a single monolithic object. I have two requirements: 1. That the resource loaded is owned by the object that created it and 2. All objects in a "...
3
votes
0answers
143 views

Is there a language for defining restful web services? [closed]

I'm implementing a restful service automation tool for client applications. Basically, the tool takes a config file that defines restful resources, and creates some DTOs and resource classes for ...
1
vote
1answer
275 views

Why would we need to rollback twice before closing in a finally block?

I'm trying to implement the change in database connection closing suggested in this question's answers. More than once, I've come across this block of code at the end of my try blocks: try { -...
7
votes
3answers
2k views

Is there an issue with closing our database connections in the “Finally” block of a Try statement?

I'm doing some refactoring for our application, and trying to reduce the number of issues reported in our ISO Scan (a static code analysis tool based on HP Fortify). Right now, what I'm trying to ...
4
votes
3answers
410 views

How do you find out what resources are unmanaged?

Looking through the .NET documentation, specifically the WebRequest class, I don't see any information indicating that I should wrap an instantiation of it in a using statement. Even the provided ...
1
vote
1answer
71 views

What's the proper name for the type of security where we secure resources by ownerrship?

I work on a REST API that mixes two types of security: First you have standard role-based security - so we have multiple roles such as administrator, read-only user, super user user, etc. Then we ...
0
votes
1answer
44 views

How to distribute copyrighted resources with and open source project?

I would like to create an open source GPLv3 project that will work with other resources that are under different types of copyright (e.g. free to use, but must not sell). Because of this, I can't ...
0
votes
1answer
77 views

What is the correct answer of given problem?

Consider a system having m resources of same type and 3 process A,B and C have peak demands of 3,4 and 6 respectiveley. What should be the value of m such that the deadlock will not occur ? My ...
5
votes
2answers
2k views

To include a resource ID in the payload or to derive from URI

Designing an API, we've come up against the question of whether a PUT payload should contain the ID of the resource being updated. This is what we currently have: PUT /users/123 Payload: {name: "...
3
votes
7answers
226 views

What if any languages treat undisposed resources as an error? [closed]

I've seen lots of code like the following example. It's in Python, but the same mistake is made in all languages with managed resources: f = open('foo.txt', 'rb') for line in f: print line That's ...
1
vote
0answers
48 views

Structuring Resource Files

In .NET we've got Resource files which are great for allowing providing translations across your application. In the past I've seen these resource files grow into monolithic unmaintainable lists of ...
1
vote
1answer
2k views

Can GC.SuppressFinalize cause performance problems?

I'm being asked to implement IDisposable on objects that are 100% managed resources, which contain no streams, and no large resources. I understand the importance of properly disposing of large ...
6
votes
3answers
1k views

How should I unit test a bitmap modifying method?

My Sprite class has a method: private void updateWithBitmap(Bitmap b, int x, int y) This will 'lay on top' the bitmap that's passed in, the top left corner of the passed in bitmap being at the x,y ...
1
vote
2answers
117 views

What's the most flexible way to ship changeable resources such as icons for an application?

We're currently upgrading some components of our application to new technologies such as C# using WPF and MVVM. Since we try to avoid past mistakes that have been made in our now legacy applications, ...
0
votes
1answer
959 views

Android DB With Some Multi-Language Data

I have a SQLite Database in my Android app with a "Question" table, among others. That table contains "default" or "pre-loaded" data (in this case the questions asked by the app). Some of its columns ...
17
votes
4answers
3k views

Why are string resources generally kept external to the code and not inside the code?

Generally, on many platforms, I'm writing my string resources to a .resx or .xml file, and then I'm getting them using some platform-dependent approach. That is, on iOS, I'm getting them via NSBundle....
1
vote
1answer
276 views

MVC Widget optimization when accessing CSS and Resources

So we're trying to re-imagine our web solution in an MVC fashion. Going from an old webforms based solution to working with ASP.NET MVC with a bootstrap main menu and adding functionality in the forms ...
2
votes
1answer
2k views

What is the accepted practice for string resource management in java?

In Android, final strings are stored in a strings.xml file, which makes it easy to update text, reuse strings and to translate an app to a different locale -- because everything is in one place. ...
1
vote
3answers
865 views

Is it OK to use email as an identifier in a RESTful URI?

I'm working with a team building a RESTful web service, and our current implementation utilizes the user's email as a unique identifier for the user resource, yielding URIs like the following: https:/...
1
vote
2answers
351 views

taxonomy of software project resourcing models

I would like to understand the impact of different resourcing models for software projects. First, I would like to identify the different resourcing approaches that are used to resource software ...
1
vote
1answer
2k views

What is the limit on REST API resource levels

When designing a REST API, how deep should the resources levels go? For example; If I have the following database tables: Companies: ID, Name Employees: ID, Name, CompanyID Tasks: ID, Name, ...
0
votes
1answer
265 views

How to configure these REST API Resources [closed]

I'm still in the design phase of my REST API, and I'm a bit stuck on how to configure the resources. The API will be consumed by mobile devices (Android, iOS, and Windows). Communication through HTTPS....
23
votes
5answers
4k views

Why can't Java/C# implement RAII?

Question: Why can't Java/C# implement RAII? Clarification: I am aware the garbage collector is not deterministic. So with the current language features it is not possible for an object's Dispose() ...
1
vote
1answer
545 views

Operating systems theory — using minimum number of semaphores

This situation is prone to deadlock of processes in an operating system and I'd like to solve it with the minimum of semaphores. Basically there are three cooperating processes that all read data ...
0
votes
3answers
134 views

Choosing the right resources [duplicate]

Once I heard that a good book on any programming language cannot be short, so the number of pages is the first criterium when choosing a tutorial. The statement was half a joke, but it has some truth ...
0
votes
1answer
232 views

What is the one or the few major changes from Java 6 to Java 7, couldn't JBoss do that already with Java 5? [duplicate]

A buddy said today that one change between v6 and v7 is that v7 will close for instance database connection "automatically" but couldn't JBoss do that already with Java 5? I've seen "JBoss is closing ...
6
votes
6answers
14k views

What are the alternatives to resx file

I am developing a Windows application and I want to store all the text for labels, radio buttons, buttons, check boxes and column headers of grids at one place. I have tried using a class file, an xml ...
12
votes
5answers
2k views

How to migrate my thinking from C++ to C#

I am an experienced C++ developer, I know the language in great details and have used some of its specific features intensively. Also, I know principles of OOD and design patterns. I am now learning C#...
10
votes
1answer
2k views

How to convince boss to buy Visual Studio 2012 Professional [closed]

The main advantage is the use of ReSharper and other add-ons but we need to make a convincing argument for the purchase of Visual Studio 2012 Professional. We are currently using Visual Studio 2012 ...
0
votes
2answers
585 views

Object Orientation done right with PHP [closed]

I've started to work with web development using PHP as server side programming language. In that time I didn't know the benefits of object orientation and had a hard time trying to write more ...
34
votes
8answers
3k views

Is memory management in programming becoming an irrelevant concern?

Background I revisited an old (but great) site I had not been to for ages - the Alioth Language Shootout (http://benchmarksgame.alioth.debian.org/). I started out programming in C/C++ several years ...
8
votes
3answers
3k views

Building a string translation database for multiple (in-house) projects

At our company we have an existing translation ms-sql table wich stores strings like this: Id | Key | Language | Value 1 | hello-world | nl-BE | Hallo Wereld 2 | hello-world | en-GB |...
4
votes
8answers
1k views

Creating an in-house single source software development team

Our company wants to create a single department for all software development efforts (rather than having software development managed by each business unit). Business units would then "outsource" ...
4
votes
2answers
4k views

Are there any algorithms for resource scheduling of courses-teachers-classes?

I'm developing an application to help school principals in dedicating teachers to classes and courses over the hours of a week (scheduling). The scenario is roughly something like this: User enters ...
7
votes
3answers
407 views

Is there a 'design pattern' type listing of common algorithms? [closed]

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, ...
0
votes
3answers
1k views

Get system info from C program?

I'm writing a little program in C that I want to use to output some system stats to my HD44780 16x2 character display. The system I'll be working with is a Debian ARM system and, although irrelevant, ...
4
votes
2answers
765 views

Java Transaction Service without the application server

Is it possible to have a Java standalone application (no application server attached) that exposes some operations that a client can call and be the one to manage the transactions? I was thinking ...
0
votes
2answers
434 views

SQLite resources or any other storage concept for mobile applications?

I would like to know what storage concepts are used for mobile or handheld devices, where an app is operated on?. AFAIK one of them is SQlite. Can anyone shed a light on this concept? perhaps links ...
37
votes
2answers
4k views

What is the proper way to do REST?

Everybody nowadays does SOA, even if some don't actually understand what is all about. So they do it wrong. Using that as an analogy I know what REST is (or at least I think I do) and want to do some ...
1
vote
4answers
271 views

Resource/Thread Allocation and Deadlock

Here is the question I'm having trouble with: Give the resource graph and determine whether a deadlock state results. Assume that when a thread requests an available or unallocated resource, the ...