The tag has no wiki summary.

learn more… | top users | synonyms

21
votes
10answers
3k views

When I test out the difference in time between shifting and multiplying in C, there is no difference. Why?

I have been taught that shifting in binary is much more efficient than multiplying by 2^k. So I wanted to experiment, and I used the following code to test this out: #include <time.h> #include ...
19
votes
4answers
16k views

Is Python Interpreted or Compiled?

This is just a wondering I had while reading about interpreted and compiled languages. Ruby is no doubt an interpreted language, since source code is compiled by an interpreter at the point of ...
2
votes
3answers
125 views

Most efficient way to store this collection of moduli and remainders?

I have a huge collection of different moduli and associated with each modulus a fairly large list of remainders. I want to store these values so that I can efficiently determine whether an integer is ...
0
votes
0answers
20 views

Are Components ideal for packaging and reusing find() requests?

I find myself loading several models over and over again throughout my application. Instead of typing the code to load the model, run a find, would it be reasonable to put that code in a method and ...
0
votes
1answer
61 views

How can I approach creating an efficient algorithm for maximizing value with these specific constraints?

I'm having trouble coming up with an approach that isn't n^2 for this problem. Here's a contrived, simplified version I've come up with: Let's say you're a company that needs 4 employees to launch in ...
3
votes
2answers
64 views

Trivially Sortable Encoding for Arbitrary-Precision Decimals

I'm looking for a reasonably(*) space-efficient way to encode arbitrary-precision decimals (e.g. BigDecimal), such that when sorting the bit-pattern of the encodings lexicographically, the numbers ...
1
vote
1answer
25 views

Custom Domain or Attribute Reference Table or Both?

I'm designing my first real database and I'm weighing the pros and cons of how to enforce uniformity in my data. My first option is to create a custom domain and program my UI to only allow certain ...
2
votes
5answers
254 views

Simplicity-efficiency tradeoff

The CTO called to inform me of a new project and in the process told me that my code is weird. He explained that my colleagues find it difficult to understand due to the overly complex, often new ...
1
vote
3answers
188 views

Is there a difference in resource allocation & efficiency between a web app and a compiled one? [closed]

I'm a web developer. I feel like I develop less resource-intensive functionality often times, because I have this feeling that if I ask too much of the web app (animation, calculation, connections, ...
-1
votes
1answer
91 views

How to code efficiently? [duplicate]

I often compare my code to others and I find their solution more efficient and shorter than mine. Although both solutions work, I can't help it but wonder if mine is not adequate enough. As a result, ...
0
votes
1answer
52 views

Replacing string comparisons with dictionary lookups

Given 2 strings s1 and s2, if I do a simple equality check , it is considered to be O(n) when calculating algorithm efficiency. So, if I am using a brute force approach for the rotated substring ...
0
votes
1answer
112 views

How to Learn Doing it Right Way? [closed]

I am self taught web developer. I do not have any computer science degree from university. I know HTML5, CSS3, Javascript, PHP and some Python. But I am having difficulties about being efficient. When ...
7
votes
2answers
274 views

What is an efficient algorithm for randomly assigning a pool of objects to a parent using specific rules

I need some expert answers to help me determine the most efficient algorithm in this scenario. Consider the following data structures: type B { A parent; } type A { set<B> children; ...
0
votes
3answers
186 views

Least Change Problem with Thousands of Denominations

In a hypothetical economy there are currency units that can represent thousands of different values. So, for example there might be coins worth 1c, 3c, 5c, 7c, 7.5c, 80c, 8001.5c etc. Given a list of ...
0
votes
1answer
39 views

lots of images and ajax, or better solution?

I have a control where the user can select a value for the x and y axis from 2 dropdowns, and then there is a 4 by 4 grid (an image) which will show what their selections correspond to (updating ...
4
votes
3answers
3k views

Quickest way to split a delimited String in Java

I am building a Comparator that provides multi-column sort capability on a delimited String. I am currently using the split method from String class as my preferred choice for splitting the raw String ...
0
votes
2answers
274 views

Quick algorithm to find matches between two arrays

I'm faced with the following problem: I have an array which is produced by the parsing of a yaml file which contains patterns in the following structure. "Programming books" Title: a ...
0
votes
1answer
58 views

How to prevent re-checking already-checked data?

I have a class with a validId($id) method that is called by the constructor and by public function load($id). The method queries the database to see if the id exists and returns true/false. The ...
9
votes
5answers
586 views

Can a pure-functional solution to this problem be as clean as the imperative?

I have an exercise in Python as follows: a polynomial is given as a tuple of coefficients such that the powers are determined by the indexes, e.g.: (9,7,5) means 9 + 7*x + 5*x^2 write a function to ...
0
votes
1answer
101 views

Are expensive operations for a user bad for other users?

Let's say user A does something expensive (regarding CPU and/or memory), which takes a few seconds. Concurrently, user B needs a very small amount of computing time. In this case, will the computing ...
1
vote
2answers
150 views

Making an algorithm more efficient

I have a question about the efficiency of an algorithm: You have a list of x,y points Now I want to get all the points that are up to 5 units away from a reference x,y point How do you calculate it ...
0
votes
1answer
102 views

Is creating a separate pool for each individual png image in the same class appropriate?

I'm still possibly a little green about object-pooling, and I want to make sure something like this is a sound design pattern before really embarking upon it. Take the following code (which uses the ...
1
vote
3answers
398 views

Storing a value vs calling reference for repeated use in Java

I have an old habit of avoiding calling references multiple times, both for easier to read/maintain code, and for possible efficiency. But I'm wondering which is more efficient (memory, performance, ...
4
votes
2answers
558 views

How much logic can be put into an object-pooling factory class before it does more harm than good?

The main language I'm interested in doing object pooling in is AS3, which is known to need it in many cases. In the past I've always made a brand new factory class for every type I was going to try ...
6
votes
5answers
410 views

Maintaining good form while learning new technologies

I find that I have to learn new technologies fairly regularly as a contractor in order to keep competitive. However, I also find that (not only, but especially) in these circumstances, I tend to end ...
8
votes
4answers
2k views

Is try-finally expensive

In case of code where you have to do a resource cleanup before exiting a function, is there a major performance difference between these 2 ways of doing it. Cleaning the resource before every return ...
2
votes
2answers
258 views

When is a code considered tight and how does it increase efficiency of the code?

I have read many times that insertion sort has tight code and hence the hidden constant factor in its asymptotic complexity is smaller. I just read yesterday that quick sort has tight code just like ...
7
votes
5answers
615 views

Interrupting Work Productivity: The Name? [closed]

Certainly it is a productivity killer when a developer is constantly interrupted by other workers, bosses, etc - but it is even worse when the developer is constantly interrupted by his or her own ...
5
votes
4answers
478 views

How do you keep track of what stage you are at in a program? [closed]

Like many, I'm developing a couple of applications on my own (not at the same time) to eventually sell. But I also have websites to run, college work and a social life etc., so often I can forgot what ...
18
votes
7answers
2k views

Does modular programming affect computation time?

Everyone says that I should make my code modular, but isn't it less efficient if I use more method calls rather than fewer, but larger, methods? What is the difference in Java, C, or C++ for that ...
6
votes
6answers
3k views

Why is binary search,which needs sorted data, considered better than linear search?

I have always heard that linear search is a naive approach and binary search is better than it in performance due to better asymptotic complexity. But I never understood why is it better than linear ...
3
votes
1answer
180 views

Processing every leaf under a node in a tree efficiently

Short version: In a tree (non-binary) with many levels of children, where each node can have multiple leaves, what is the best way to tally leaves that meet a certain condition given a node? Long, ...
11
votes
3answers
571 views

Do teams get more productive by adding more developers? [duplicate]

Suppose you've got a project that is running late. Is there any proof or argument that teams become much more productive by adding more people? I am looking for answers that can be supported by facts ...
37
votes
9answers
3k views

Why not have a High Level Language based OS? Are Low Level Languages more efficient?

Without being presumptuous, I would like you to consider the possibility of this. Most OS today are based on pretty low level languages (mainly C/C++) Even the new ones such as Android uses JNI & ...
1
vote
1answer
297 views

Can web apps allow fast data-typists to “type-ahead”?

In some data entry contexts, I've seen data typists, type really fast and know so well the app they use, and have a mechanic quality in their work so that they can "type ahead", ie continue typing and ...
19
votes
4answers
534 views

Educational, well-written FOSS projects to read, study or discuss [closed]

Before you say it: yes, this "question" has been asked other times. However, I could not fine many of such questions and not that easily, and those I found had similar results. What I'm trying to say ...
41
votes
10answers
2k views

Is there any hard data on the (dis-)advantages of working from home? [closed]

Is there any hard data (studies, comparisons, not-just-gut-feel analysis) on the advantages and disadvantages of working from home? My devs asked about e.g. working from home one day per week, the ...
8
votes
6answers
2k views

Are There Any Programming Focused Notebooks? [closed]

I know that engineering paper exists, but are there any companies that make programmer-specific notebooks for notes/pseudo-code/designs? Paper is my preferred way of outlining things, so the addition ...
1
vote
7answers
408 views

Cold, neutral attitude to programming languages - sign of a pro developer or not [closed]

A profesional developer Zed Shaw says this: Which programming language you learn and use doesn't matter. Do not get sucked into the religion surrounding programming languages as that will only ...
-1
votes
4answers
150 views

Give advice from experienced to beginner programmer on reinventing my wheel(solution) [duplicate]

i ve just tried to do coding bat exercise. There are posted solutions to the problem i tried to solve. However, I was stubborn, i ignored them and tried to code it up my own way(basically reinventing ...
7
votes
4answers
744 views

regular, average programmer - scared of geeks and their skills [closed]

Just like in any other field, 90% of workers do trivial routine things and only less than 10% actually do the most difficult things. Most programmers in the industry are average, and so am I. There ...
0
votes
1answer
165 views

Efficient way to find highest value from predicates

I have predicate, that enumerates through backtracking list of values. I want to find highest value from this list. For example: ranked_move(X,Y,R) :- between(0,10,Y), between(0,10,X), ...
4
votes
5answers
1k views

What is a good measure of testing/tester efficiency?

I am about to participate in a discussion with management regarding measuring our testing efficiency as a QA organization. The main reason behind this is that half of our team is contracted out and ...
1
vote
2answers
434 views

Is there a device still being sold that requires efficient programming? What is it? [closed]

Edit: As a lot of you have pointed out, efficient can mean a lot of things. I guess when I say that the device 'requires efficient programming', I mean that the device does not have lots of memory or ...
7
votes
5answers
261 views

Programming principles with regard to software (computational) efficiency and the use of variables

I'm classically trained psychologist, not a programmer, so sometimes the more advanced aspects of programming escape me, in particular regarding program efficiency and/or certain best practices, in ...
2
votes
1answer
226 views

How to communicate inefficiency before it's implemented?

This is a problem I come across pretty often. Basically we are using an application to make art content. Often times this requires writing custom tools for it. Sometimes you run into parts of the ...
3
votes
1answer
320 views

Aggregate Root and Lots of Data Efficiency

It's more of a scenario, but it isn't far fetched at all. Let's say I have an Aggregate Root (AR) Warehouse which it's used to manage product stock. The Product itself is an AR in a different bounded ...
0
votes
1answer
869 views

Retrieving hierarchy of tree-nodes stored in relational database

I have a hierarchical ADT that I want to store in a database. Nodes have exactly one parent element that is a node as well. Multiple nodes can have the same parent node. My current approach uses an ...
2
votes
1answer
263 views

Effective handling of variables in non-object oriented programming

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 ...
1
vote
2answers
145 views

Using replacement to get possible outcomes to then search through HUGE amount of data

I have a database table holding 40 million records (table A). Each record has a string a user can search for. I also have a table with a list of character replacements (table B) i.e. i = Y, I = 1 ...