Username and Password Verification in Vb.net - arrays

id like to clarify something before i start explaining the problem. Im a college student who’s just gotten into programming, with no previous background. Till yet, ive not touched functions or any other complex stuff, just have been working with your common loops i.e for..next, if..else..endif, while..endwhile and do..until. Basically the most basic usage of visual basic.
My assignment has been to use parallel arrays and produce a code that inputs and stores usernames and passwords, and then asks for a username and verifies its existence and then asks for the corresponding password and confirms it to grant access, otherwise denies access.
Below is the code i devised.
enter image description here
Okay. So it works fine with the inputs and all but when the for loop starts, it asks for username input and in addition to accepting wrong usernames that i have not entered in the previously asked and saved array lists, it also outputs the ‘username found’ before asking for password for the wrong usernames. What changes do i need to do to it to make it work?

Related

gremlin query involving edge property quantity checks

I have this schema for the graph database.
I need to find users who have picked calls from all calls labels that it is connected to, for program X.
I am quite new to gremlin and my vocabulary is limited.
I want to find a way to check if the number of incoming edges to users with picked == yes is the same as the total number of incoming edges to the user for a given program X. (that is, if every edge from program X to user via calls contains picked==yes)
I am unable to count twice in the same query and compare those values to decide if user satisfies criteria. My approach is as follows:
g.V().hasLabel("User").filter(inE().count().is(neq(0))).filter(inE().outV().in().has("program","name","X")).filter(inE().has("connected","yes").has("picked","no").count().is(eq(0))).values("name")
Essentially, I am removing all cases that I know do not lead to my expeced result (null nodes in User, Users who connected but did not pick up). This does not generate the right output when I tested it against manual examination result.
Thanks!
From the description alone I would say that this is your query:
g.V().hasLabel('User').
filter(project('a','b').
by(inE().has('picked','yes').count()).
by(out().has('program','X').count()).
where('a',eq('b')))
If that doesn't return the expected result, then please provide a snippet that creates a small sample graph along with the expected result.

Alexa DateSlot Morgen vs. Morgan

We are building a german alexa skill where one of our intents uses a DateSlot. If we ask with the name of a Day (e.g. Dienstag, Mittwoch), Alexa understands our input and correctly call our api with this day. If we ask for "morgen" (stands for tommorrow), Alexa understands "morgan" and can not map the input to a date and so Alexa asks for a different input.
How can we ensure, that Alexa interprets our voice input as a german word and not as an english word?
Not sure about German vs. English, but we ran into a similar issue with slot types. We originally did not understand that slot types are not a finite list of inputs, but training values. We ended up using the JaroWinklerDistance method in the natural package. We made a list of out expected slot types to attempting matching against and went with the best match. Our slot types were for car makes, types, and colors. So you can imagine the invalid values we had coming in.
Possibly you can do something similar by making a new intent to capture your known invalid values and do the natural.JaroWinklerDistance matching. You would need to add more utterances to match your DateSlot utterances which expect another slot with 'morgen' and other values you incorrectly receive. Then, with you intent handing, detect the string value and match through your known list of values. You can always fail out if something entirely unexpected happens, as it does now when you receive 'morgan'. We had to play with the threshold for the best match to determine if we used it or not.
Or, you can build up a list of items you constantly get and map them to valid values. We also had a slot that expected 1, 2, 3, 4, or 5. During development we were getting too, four, two, to, etc... We ended up mapping these known values in a list and translating them to what we expected. For this situation we had a fairly limited list of values we had to translate for, but it worked well.

Generating 4-Digit Passwords, But Skipping Bad Words

We have an application that will be generating 4-digit random strings for guest WiFi usage. So you walk into a hotel, get your room key and your WiFi password. I want to make these generated passwords as simple as possible to save calls to the helpdesk, but not so simple that they are so easily guessed.
The problem is that inevitably you'll end up with passwords like "POOP" or "DICK". I think a simple solution is so to have a database table of the "forbidden" words, and upon generation check it against the database first to make sure it isn't a banned word.
I have looked at probably dozens of filtered/banned/censored word lists, but I can't find one that is sufficiently detailed so as to include things like DIKK and P00P, and I don't exactly want to use my time today to try to think of every possible offensive 4-letter combination and type them all out manually.
Does anyone have a good resource/word list that would contain these "potentially-offensive" strings?
First I wrote this as a comment. But then I realized it actually answers your question about skipping offensive words:
Consider generating random strings without vowels. You won't get any actual english word. You will both avoid words like 'tree' or 'fukc'
I suggest you to use numbers too, will be "more secure" and you will eliminate this problem

Why does simple email obfuscation work so well?

For example replacing # with at. At least one study demonstrated its effectiveness:
To our surprise, none of the crawlers that visited our departmental research and course and research web pages led to any spam on email addresses containing the at.
Another experiment demonstrated the same thing, showing that using at and dot reduced spam by two orders of magnitude.
The first study speculated that spammers obtain enough plain-text email addresses to ignore the obfuscated ones. But parsing at in addition to # should be trivial. Why don't spammers account for such simple obfuscation?
I am no expert...but it intuitively makes sense that the # symbol is much less commonly used in non-email-related speech. The # sign is what set an email address apart from all the other text. If you simply use at, it blends in with normal English.
At is a pretty common word after all :P I'm sure its still possible to parse out the "at" version of an email, but just much more difficult of a regex.
Why would they bother if they can find hundreds of thousands of plaintext ones? Additionally, what if a email had the word at or dot? like dottie#gmail.com - with a simple find and repalce would change it to .ie#gmail.com

Does Anyone Use Address Line 2

So it's a standard in basically every address form out there and I'm questioning why?
Address Line 2. It's in every form that asks for address details. It's never actually seemed necessary to me. It requires another field in the database and all the goofy maintenance that goes with it. Every time you use an address, you have to concatenate it and 99% of the time line 2 is empty. The other 1% of the time you could've just put it into line 1.
Instead of calling it line 2, couldn't it be called something with clearer semantics... like "apartment number"?
It ruins the semantics of the whole address concept. You don't really know what you have in either field. Except maybe that the concatenation of the two fields results in a "plain old address". But "Line 1" and "Line 2" themselves don't really have any meaning. Is something "supposed" to go in each respectively? I've never seen it. Why don't we have address line 3 while we're at it?
I've been thinking about it and realized that as a result, I don't really trust the address data in my database. The whole field is flaky in general because you can't really do validation on it (some addresses have roads and a house number, others have streets and avenues). Except these days you could do something like validate the field against a geolocation api. But simply because of the "Line 2" thing, you can't really be certain what you're doing. Should I combine the (line 1 + line 2), then validate? What do I do with the users original input if I'm correcting them ("did you mean xxx")? Do I just say, "yah, address line 2 doesn't really do anything... I just took your validated input and dumped it into line 1." Why am I even giving the end user (and myself) the chance to be confused.
The way I see it, the field should either be an address (street + house number), or if we're going to split things up, do it properly and ask for the road and house number independently.
Allowing loose data input is never a good idea. If you must support a multi-line address, use 2 text boxes called address1 and address2. Do not use a non-structured input format (textarea) to collect structured information (an address).
Actually, in rare cases a user might even want to have a third address line. The best solution to this is to use a <textarea> that will accept newlines for a more complex address and store the address exactly as entered in the database.
Address line one is sometimes used by companies for an attention name, which makes address line 2 necessary for the address itself. Imagine something like:
Name: Microsoft
Address 1: Att.: Bill Gates
Address 2: One Microsoft Way
...
It isn't always an apartment number. It could be a floor (single house, multiple residences), or other things.

Resources