language-agnostic

seo for search form

Hi all, I have a shopping site that works a little bit differently than the rest: the only way to get to the products that you want is by search, my client asked not to display links to categories of products. I'm worried about search engine optimization because crawlers won't be able to get to the products or the views. Oh, didn't i m...

Should services ask for credentials at each request?

I wonder what is the optimal authentication method for services and webservices: user/password is sent on each request user/password is sent once to obtain an authentication code that will be sent on each request Is there any alternative? Which is better? Why? ...

Is it possible to make 1 pc camera work at 2 different modes simultaneously?

By mode here I mean video width,height and FPS(frame per second) I guess maybe some kinda driver can manage to do this? ...

I once read that static classes are very difficult and even impossible to debug. Is this true and why?

I once read that static classes are very difficult and even impossible to debug. Is this true and why? If an example would help, here is a PHP class I use to access a database (I don't think this is a PHP-specific question, though): <?php class DB { private static $instance; private function __construct() { } public stat...

General approach to reading lnk files

Several frameworks and languages seem to have lnk file parsers (C#, Java, Python, certainly countless others), to get to their targets, properties, etc. I'd like to know what is the general approach to reading lnk files, if I want to parse the lnk in another language that does not have said feature. Is there a Windows API for this? ...

Gradual migration to a new database schema. ¿Suggestions?

(This question is about the best way to temporarily and programatically keep new records of two databases in sync, having very different schemas, and ignoring the old -outdated and no longer required- records.) I work on a company that provides TV programming information for guides, newspapers and websites. I have an old system that ha...

are there tutorials on how to name variables?

as you can probably tell from my previous posts i have horrific naming conventions. do you know of any tutorials dealing with how to name stuff? ...

Substring search algorithms (very large haystack, small needle)

I know there are already several similar questions here, but I need some recommendations for my case (couldn't find anything similar). I have to search a very large amount of data for a substring that would be about a billion times smaller (10 bytes in 10 billion bytes). The haystack doesn't change, so I can bear with large precomputati...

Is prepending salt to the password instead of inserting it in the middle decreases security?

Hi, I've read somewhere that adding a salt at the beginning of the password before hashing it is a bad idea. Instead, it is much more secure to insert it somewhere in the middle if the password. I don't remember where I've found this, and cannot neither find any other articles saying the same thing, nor understand why this may increase...

Configuration parameters in file or DB?

What will be best practice for this? ...

What's the next step for a developer?

Recently, I feel that I've reached a wall I need to vault over to continue improving myself. I was reading the book Pro ASP.Net MVC2 written by Steve Sanderson and he holds your hand throughout the chapters, all the while introducing Dependancy Injection and abstract interfaces. I realized this is completely new for me and very hard for...

Algorithm for calculating result of multi-choice quiz

I'm struggling with the edge cases of an algorithm for calculating the result of an A, B, C style quiz. The quiz is made up of an arbitrary number of questions, each having exactly 3 answers corresponding to A, B and C. Each question is displayed on its own with a continue button, once all questions have been answered the result is disp...

How to calculate the angle of a vector from the vertical?

Hey, Im trying to find out the angle (in degrees) between two 2D vectors. I know I need to use trig but I'm not too good with it. This is what I'm trying to work out (the Y axis increases downward): I'm trying to use this code at the moment, but it's not working at all (calculates random angles for some reason): private float calcAng...

On a Windows Mobile device, does it make sense to cache data "in memory"?

I'm writing a Windows CE application, and I want to play a sound (a short wav file) when something happens. Since this sound will be played often, my first instinct was to load the wav file into a memory stream and reuse that stream instead of reading the file every time. But then it occured to me that these Windows Mobile devices only ...

Library/data structure for handling huge data

I have some huge binary driver logs (around 2-5GB each, and probably around 10x as much after converting them to a readable form) and I need to write a tool that would allow me to sequentially browse, sort, search and filter them effectively (in order to find and resolve bugs). Each log entry has few attributes like: time-stamp, type, m...

Why is it bad to use goto?

Possible Duplicate: GOTO still considered harmful? I just came across some C# code that had a goto statement in it (which I didn't even know C# supported). I only vaguely remember hearing about goto statements in one of my college classes. I seem to remember my professor saying it should never be used but I don't remember wh...

Dynamic programming idiom for combinations

Consider the problem in which you have a value of N and you need to calculate how many ways you can sum up to N dollars using [1,2,5,10,20,50,100] Dollar bills. Consider the classic DP solution: C = [1,2,5,10,20,50,100] def comb(p): if p==0: return 1 c = 0 for x in C: if x <= p: c += comb(p-x) ...

What's needed for NLP?

Hello, assuming that I know nothing about everything and that I'm starting in programming TODAY what do you say would be necessary for me to learn in order to start working with Natural Language Processing? I've been struggling with some string parsing methods but so far it is just annoying me and making me create ugly code. I'm lookin...

Generate a random vector inside a rectangle but not a circle?

I have a rectangle, and a circle inside that rectangle (that sits around the center of the rectangle). I want to generate a random 2-component vector that falls inside the rectangle, but not the circle. How can I do it? Edit: I'd prefer a method that i can use to generate a vector that meets these constraints without brute-forcing it. ...

Graphs - find common data

Hi! I've just started to read upon graph-teory and data structures. I'm building an example application which should be able to find the xpath for the most common links. Imagine a Google serp, my application should be able to find the xpath for all links pointing to a result. Imagine that theese xpaths were found: /html/body/h2/a /ht...