language-agnostic

Interview Question, What do they want to accomplish?

I was on a technical job interview today, and it was time to give me some programming exercises. I finally came to the last question: Given the numbers: 116 104 105 115 32 105 115 32 99 111 114 114 101 99 ? What is the next number? To really understand my mindset, I encourage you to stop reading, and really try to figure out what th...

Of all the major languages used in academia and business, which one is the most productive, and why?

As the question says, which language is easiest and most productive for you, and importantly why? Given that the reason why should be convincing it could have a definitive conclusion, and is therefore a valid question. I am looking for suggestions with regard to learning languages generally, and whether to pick up one language over anot...

Extending a class: doing this within the class or using observers?

I need to extend a class (in C++, but this question is language-agnostic I think), with functionality that can be implemented in two different ways: by simply adding the logic to the class itself by adding observer logic to the class and putting the logic in an observer, outside the class There are advantages and disadvantages in bot...

Where/what level should logging code go?

I'm wondering where logging code should go. For example, should my repository log it's own errors? Or should I log all errors from the UI/controller? Are there any general deisgn principles about this, or does anyone have link to a good article or somesuch. ...

Using pen strokes with fuzzy tolerance algorithm as encryption key

How can I encrypt/decrypt with fuzzy tolerance? I want to be able to use a Stroke on an InkCanvas as key for my encryption but when decrypting again the user should not have to draw the exact same symbol, only similar. Can this be done in .NET C#? --- Update (9 sep) --- What I ideally want is an encryption algorithm that would accept ...

Problem coming up with an array function

Let's say I have an increasing sequence of integers: seq = [1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 4 ... ] not guaranteed to have exactly the same number of each integer but guaranteed to be increasing by 1. Is there a function F that can operate on this sequence whereby F(seq, x) would give me all 1's when an integer in the sequence equals x an...

How to capture HTML of redirect page before it redirects?

I am trying to read the HTML of a page that contains a non-delayed redirect. The following snippet (C#) will give me the destination/redirected page, not the initial one I need to see: using System.Net; using System.Text; public class SomeClass { public static void Main() { byte[] data = new WebClient().DownloadData("http:/...

How to deal with internal company frameworks and SW factories?

Based on my own experience and on experience of my friends I see that many companies have some strange ideas to develop their own frameworks and SW factories (builds skeleton of application for you). These ideas are usually based on belief that own framework will be much better than anything else available. How to deal with such ideas an...

Best way to keep the user-interface up-to-date?

This question is a refinement of my question http://stackoverflow.com/questions/3161392/different-ways-of-observing-data-changes. I still have a lot of classes in my C++ application, which are updated (or could be updated) frequently in complex mathematical routines and in complex pieces of business logic. If I go for the 'observer' ap...

In logging what is the conceptual difference between Level.INFO and Level.DEBUG

This question is language-agnostic. What is the difference between the enumerated levels. In applications I've seen many INFO messages that seemed DEBUG info to me and vice-versa. ...

Books or Tutorials that explain Calculus from a programming perspective

K I'm a self taught programmer and been so for a couple of years. But in order to go beyond the programming scab work (entry lvl, Tester, Web Dev, Commercial App Dev; of which I am more than grateful for) and go beyond conventional programming gigs. (I.E. R&D, Embedded Devices, Scientific Computing and the like ) I'm going for a BS in Co...

Do you use tense when naming methods of boolean return type?

So, when you are writing a boolean method, do you use tense, like "has" or "was", in your return method naming, or do you solely use "is"? The following is a Java method I recently wrote, very simply .. boolean recovered = false; public boolean wasRecovered() { return recovered; } In this case, recovered is a state that may or ...

Suggestions for first Linux programming project?

What would you suggest as a starting project for learning essential Linux programming skills? I don't mean just coding something in Linux, but really Linux specific stuff, in the spirit of having something tangible to show in a job interview where Linux skills are required. Also stories on how you got started with Linux coming from othe...

Different ways to reference yourself?

The handle to yourself is called different things in OOP languages. The few I've come across so far: this (e.g. Java, C#) Me (e.g. VB, vba) self (e.g. Python) Anyone know any others? ...

Possible to intercept "unminimize" event on windows?

Is it programmatically possible to intercept the maximize/restore event on Windows such that when you click on a minimized button on the taskbar, it asks you for a password? Update: To clarify, I'm asking if it is possible systemwide. For example, I may pick a browser/im/editor window that I want to secure if I need to walk away from th...

language neutral interview

what exactly does language neutral interview mean? do they just check for my OOPs/Other concepts or actually check how good my programming skills are? during the interview what exactly is expected out of me? any ideas? -Ivar ...

Types of Errors during Compilation and at Runtime

I have this question in a homework assignment for my Computer Languages class. I'm trying to figure out what each one means, but I'm getting stuck. Errors in a computer program can be classified according to when they are detected and, if they are detected at compile time, what part of the compiler detects them. Using your ...

sequence comparison with moved blocks detection

I need to compare 2 sequences and find an edit distance. Edits can include deletion and insertion operations (with modification weight 1 per symbol), and block move operations (with weight 0.1 per symbol) For example: A B C D E F G H F G H A B C Y D X E Block FGH was moved here. Is there any existing algorithm to solve this task efficien...

How to find repeating sequence of characters in given array

my problem is to find the repeating sequence of characters in the given array. simply, to identify the pattern in which the characters are appearing. example: for the examples in the above image the output for the First array should be "JAMESON" Second array should be "RON" Third array should be "SHAMIL" Fourth ar...

OOP / Pattern: Customizing layout based on environment

I have an app that has subtle differences depending on where it's being viewed. Variations to business logic & view styles are fine - this is all handled through dependency injection & CSS respectively. However, where I'm coming unstuck is with small variations on view layout / elements. For example - if a user is running our applicat...