LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-05-2013, 11:42 AM   #16
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124

Quote:
Originally Posted by danielbmartin View Post
I tested the improved ruby solution 20 times and found no instances of any character appearing twice in succession.
You have interpreted "consecutive" differently to the way I have. To me, it means that no character is followed by the next character in the 0-F sequence.

In your first example, 5A2C74CD74, there are the consecutive characters 'C' and 'D'.
 
Old 04-05-2013, 12:40 PM   #17
danielbmartin
Senior Member
 
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,881

Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
Quote:
Originally Posted by psionl0 View Post
You have interpreted "consecutive" differently to the way I have. To me, it means that no character is followed by the next character in the 0-F sequence.

In your first example, 5A2C74CD74, there are the consecutive characters 'C' and 'D'.
We'll have to hear from the OP to decide this question.

Security experts discourage repeat characters because such passwords are insecure. A person whose "lucky number" is 7 might be tempted to establish a password such as 7777777777. For that matter, the easy-to-remember password 1234567890 is also insecure.

If your interpretation is correct, that makes this programming task more challenging.

Should we also prohibit downward increments such as 9876543210? How about "flip-flop" passwords such as 6969696969?

Daniel B. Martin
 
Old 04-05-2013, 08:31 PM   #18
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by danielbmartin View Post
We'll have to hear from the OP to decide this question.
I suspect we will be waiting a long time.

It's interesting how often that happens with noobs when they only get hints instead of a complete program as an answer to their query. However, I still prefer to offer some hints instead of accusing them of looking for answers to their "homework" (they might be genuine).

Quote:
Originally Posted by danielbmartin View Post
If your interpretation is correct, that makes this programming task more challenging.
Actually, my psuedo-code handled it quite readily. I tested it using "blassic" (the quickest way) and none of the passwords it generated have 2 consecutive characters. Here are 10 outputs it generated:
Code:
48EED0D330
E9FC287F54
52E0BA28A3
D2B04D92F5
BE4E6C8111
13DB65B29F
E92C7BE426
488B46A7DD
C952FBD170
DFC5A77930

Last edited by psionl0; 04-05-2013 at 08:39 PM.
 
Old 04-05-2013, 09:04 PM   #19
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Quote:
none of the passwords it generated have 2 consecutive characters
Well not going left to right
 
Old 04-05-2013, 09:42 PM   #20
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
I might have had an overly narrow interpretation of "never have 2 consecutive characters side by side" but it is easy enough to modify the non_consecutive() function to incorporate ascending order, descending order and even equal characters if that is what the user wants. In a proper consultation process, you would go around loops like this several times until you have a specification that is just what the user wanted.

ETA it took me 10 minutes to modify non_consecutive() as above. The results look a lot more random now:
Code:
C508C1AD35
C63B6030AF
681B941AEA
42D1814BDF
B7C815C38E
64A06F24AD
6EB51C6C58
81FD26A59A
4B74DA4B36
27306C1CEA

Last edited by psionl0; 04-05-2013 at 11:32 PM.
 
Old 04-06-2013, 04:04 AM   #21
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Well I can admit it took me longer than 10 minutes, but I am still learning this language (and I made some silly mistakes along the way )
Code:
24F96AEB70
C73E861B0A
E39DA85C26
9ECF753B06
A1E0D2F847
D136FC94A0
9EA683BF27
F5164D8EA0
AE95B6C370
8D3FAE5190
A1B52E48D3
 
Old 04-07-2013, 12:18 AM   #22
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by grail View Post
Well I can admit it took me longer than 10 minutes, but I am still learning this language (and I made some silly mistakes along the way )
I'm not surprised. I've found with these OOP languages that by the time I have found a suitable class library, learned how to use it and how to extend it to do what I want, I could have coded the whole thing from scratch in assembly language several times over.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate SPECIAL alphanumeric WORDLIST - no characters appearing more than X times Stanley_212 Programming 4 01-20-2013 07:46 PM
Generate SPECIAL alphanumeric wordlist!!! Output! sapto Programming 6 02-14-2012 08:08 AM
Generate SPECIAL alphanumeric WORDLIST with a total amount of consonants, number, ut0ugh1 Programming 2 10-26-2011 02:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration