Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
QuestionPlay DVD and cut a Video in WPF Pin
Alessio Elia2-Feb-12 9:46
Alessio Elia2-Feb-12 9:46 
AnswerRe: Play DVD and cut a Video in WPF Pin
Dean Oliver3-Feb-12 6:52
Dean Oliver3-Feb-12 6:52 
QuestionHow would you store this data (interview question) Pin
SledgeHammer012-Feb-12 8:28
SledgeHammer012-Feb-12 8:28 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 8:30
sitebuilderLuc Pattyn2-Feb-12 8:30 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 8:32
SledgeHammer012-Feb-12 8:32 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 8:42
sitebuilderLuc Pattyn2-Feb-12 8:42 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:07
SledgeHammer012-Feb-12 9:07 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 9:30
sitebuilderLuc Pattyn2-Feb-12 9:30 
SledgeHammer01 wrote:
I'm not getting your idea

which one? I offered 3 ideas.

Here is the gist of the third and simplest one:
private static Dictionary<string, long) plates;
private static string alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";

public static bool Exists(string plate) {
    string lead=plate.SubString(0,6);
    if (!plates.ContainsKey(lead)) return false;
    long bitmask=plates[lead];
    int index=alphabet.IndexOf(plate[6]);
    return (bitmask & (1L<<index))!=0;
}


You might notice it requires just one 6-char string and one long to hold information about 36 consecutive plates.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.

GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:45
SledgeHammer012-Feb-12 9:45 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 10:01
sitebuilderLuc Pattyn2-Feb-12 10:01 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 10:08
SledgeHammer012-Feb-12 10:08 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 10:22
SledgeHammer012-Feb-12 10:22 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 10:33
sitebuilderLuc Pattyn2-Feb-12 10:33 
GeneralRe: How would you store this data (interview question) Pin
harold aptroot2-Feb-12 10:35
harold aptroot2-Feb-12 10:35 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 10:51
sitebuilderLuc Pattyn2-Feb-12 10:51 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 11:45
SledgeHammer012-Feb-12 11:45 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 8:35
SledgeHammer012-Feb-12 8:35 
GeneralRe: How would you store this data (interview question) Pin
CCodeNewbie3-Feb-12 5:58
CCodeNewbie3-Feb-12 5:58 
QuestionRe: How would you store this data (interview question) Pin
Luc Pattyn3-Feb-12 6:01
sitebuilderLuc Pattyn3-Feb-12 6:01 
AnswerRe: How would you store this data (interview question) Pin
CCodeNewbie3-Feb-12 6:05
CCodeNewbie3-Feb-12 6:05 
GeneralRe: How would you store this data (interview question) Pin
Luc Pattyn3-Feb-12 6:06
sitebuilderLuc Pattyn3-Feb-12 6:06 
GeneralRe: How would you store this data (interview question) Pin
CCodeNewbie3-Feb-12 9:37
CCodeNewbie3-Feb-12 9:37 
AnswerRe: How would you store this data (interview question) PinPopular
Eddy Vluggen2-Feb-12 8:43
professionalEddy Vluggen2-Feb-12 8:43 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:01
SledgeHammer012-Feb-12 9:01 
GeneralRe: How would you store this data (interview question) Pin
jschell2-Feb-12 9:10
jschell2-Feb-12 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.