I am building a spelling game in visual studio, but I don't know how to check the users input with my pre-coded 'database' of words - visual-studio-2012

I am currently building a spelling game in Visual Studio Express 2012 and I need help. I have already coded all the words that are going to be there, and a random number generator. The number generator will be invisible in the final product but basically every number corresponds to a word. The code is something like this:
Dim r as New Random r.next(1,21)
If lblRandomNumber.text="1" then txtRandomWord.text="Adduct"
I have coded for 20 words, using the same code. My problem now is that I don't know how to check the users input with the predefined words, and that is what I'm asking for your help with. I know my code will work because when I inserted a new textbox, used the same code
(if lblRandomNumber.text="1" then txtUserInput.text= "adduct"), and then said coded "if txtUserInput.text=txtRandomWord.text Then msgbox.text("well done").
After clicking the word generate button a few times (to get the number 1) a message box finally came up and said "well done".
My question is, how would I return the users input to the computer and have the computer check that input with the other words in my "database" of words.
I know it is not a database of words but I don't know what else to call it.
Not all of my code is precisely right here as I don't currently have access to my program. If you could help me out I would be very thankful,
Oisin.

Related

How to generate a password from given string and length in VB

I want to generate a fixed password based from a given string (a clue) with a certain length.
For example, from the word 'school' and '10' character length, I would like to generate a fixed password, lets say 'ihskm28s9a'. So everytime I entered the cue word and the length, it will always gives me a fixed results, which is 'ihskm28s9a', not generated all over again.
I am nubie in programming so I choose VB as my my starter language since easier for me to understand it.
Thank you very much and sorry if I said something badly.

? A very long list of URL's to scrape, how do i take a break then continue?

Ive been wondering this for a while. I have several different very long lists of items to scrape, analyze, and save to my computer. The problem is, this is my only computer and i take it with me on the go, for example. so i dont always have an internet connection. (Or an array of other reasons that would interrupt a long scrape.) Is there any sortof protocol or library that can help me pause my program and pick up where i left off at a later date? Sorry if im being vague.
My only idea was to create a folder in my directory for every page i scrape, and have the program check if that file exists before performing the scrape and analysis, using:
for item in List_Items
if not os.path.exists(os.path.dirname(mypath + item + '/complete/')):
scrape(item)
analyze(item)
save(item)
try: os.makedirs(os.path.dirname(mypath + item + '/complete/'))
except: pass
This was also beneficial, because i could open several instances of the same program to get the job done faster. But it gets a little tedious putting the same code into every program, because its got to change a little each time. Maybe if there were certain guidelines i can follow or maybe a tool i can use to help me do it? I really dont even know what to look for...thats why ive been wondering about it for so long.
Why don't you just save last successful index on file? And execute program like this:
start = read_start_index()
scrape_list(start,...)
Or even write a list of successful elements and every time check if new item is in it.

Xpages: is it possible to allow user to select multiple values and display dynamic result depends on user’s selection in Domino Designer 9.0.1?

I would like to ask is it possible to allow user to select multiple values and display dynamic result depends on user’s selection in Domino Designer 9.0.1?
We are required to develop a web application using xpages.
Here is is the background of web application:
Each member has a current group
Each group are required to join some specific activities
Member can choose future group and check the activity is joined or not join
That means use member in current group’s latest activity status (joined or not join) to compare the future group (find which activity is joined or not join)
The sample pictures about the application will be like the following
For user's selection: the user can choose multiple members with related current group and the user can choose the future group for each member for the comparison.
After click the Submit button, the result shows to the user
Here is the question: is it possible to do this in Domino Designer 9.0.1?
The reason we ask is we haven't find similar sample on the internet yet and we don't know whether it is possible to do in the Domino Designer 9.0.1.
Grateful if someone can provide advice on this issue please. Thank you very much.
Update:
We apologize for our misleading question. We are absolutely not asking someone to write code for us.
We are not able to upgrade to Domino 9 at the moment and we are currently writing some code using 8.5.2.
However we have a concern that if we write a lot of complex code in the application, it will be a trouble for our colleagues to do the maintenance for program.
Also assume we write a lot of complex code in the application and the program works, what about if the user has new requirements base on the current function for the program? We believe the code will be much complex and hard for someone who handle this task to understand the logic of the program.
Thus, for the future development and the program maintenance. Is the latest version more flexible to develop and maintain or just not much difference to accomplish.
Sorry for the inconvenience we have made.
Thank you for your time.
Update 2
For the coding of the program, we have the following experiment.
Option Public
Option Declare
Sub Initialize
Print |Content-Type:application/text/html|
Print "<tr><td>Result<br></td></tr>"
Print "<br>"
Print "<br>"
Print "<table border = 1><tr><th>Member</th><th>Test 001</th><th>Test 002</th><th>Test 003</th></tr></table>"
Print "<table border = 1><tr><th>Activity</th><th>Joined</th><th>Joined</th><th>Joined</th></tr>"
Print "<tr><td>Activity 1</td><td>No</td><td>Yes</td><td>No</td></tr>"
Print"<tr><td>Activity 2</td><td>No</td><td>Yes</td><td>No</td></tr>"
Print "<tr><td>Activity 3</td><td>Yes</td><td>No</td><td>No</td></tr>"
Print "<tr><td>Activity 4</td><td>No</td><td>No</td><td>Yes</td></tr>"
Print "<tr><td>Activity 5</td><td>Yes</td><td>No</td><td>No</td></tr>"
Print "<tr><td>Activity 6</td><td>No</td><td>No</td><td>Yes</td></tr></table>"
End Sub
Those code just hard code only, it will open in html format.
Due to the data will change depends on user's selection, we cannot guarantee the size of the table and hard to define data to locate in which cell.
We are currently studying how to make those code dynamically, make it more flexible.
Thank you.
The tool you need in XPages are custom objects either in JavaScript or Java (that's way less scary than it sounds) and one repeat control for the rows. If the number of columns are dynamic too, then you need 2 repeat controls.
The layout reminds me a lot of the table walker example (I wrote) as part of IBM's original XPages 8.5.0 training exercises. You need to check them out.
In particular look at Exercise 23. The data source, multi value fields might not fit your case, but the dynamic table does.
Good luck and let us know how it goes.

Text only Data Validation

I know there was a similar question asked but I couldn't manipulate that code. What I need is Data validation that will make sure the user ONLY enters 2 characters and both of them have to be text. I keep running into trouble because the system allows when I type w1. Any help would be greatly appreciated
Data Validation only 2 characters long and both characters must be text
Don't know whether it is the best way, but try it:
=AND(LEN(A1)=2,LOWER(LEFT(A1,1))>="a",LOWER(LEFT(A1,1))<="z",LOWER(RIGHT(A1,1))>="a",RIGHT(LEFT(A1,1))<="z")

converting alla textinput control to uppercase in application

Dear All We had developed a hr application(winform) which consist of almost 98 forms .And its in testing in our organisation .
But the problem now is the management wants all the data inputs to be in UPPERCASE .we had not set any character casing in any of our controls and now its almost very hazardous to change the character casing to all controls
Can anyone suggest any idea to do restrict the input to uppercase only ?.I had tried some thing at the Program.cs file.but it seems not working
Also tried to overide textbox.textchanged event it seems to be a foolish idea any more ideas please considering us as new bie in development
Although this is a weird requirement, you could use LINQ to "upper-text" all TextBox-Controls:
var allTxt = from form in Application.OpenForms.Cast<Form>()
from txt in form.Controls.OfType<TextBoxBase>()
select txt;
foreach (var txt in allTxt)
txt.Text = txt.Text.ToUpper();
Application.OpenForms returns all open forms owned by the application and TextBoxBase is the base class of text-controls(TextBox, RichTextBox). Enumerable.OfType filters for TextBoxBase.
Note that this doesn't search recursively for controls. Only the top control-container is searched currently. If you need a recursive search implement something like this.
Have a look at the KeyPreview event, it may allow you to control all input for the app, regardless of where the focus is.
I would say that by far the best solution would be to replace all the textboxes with your own implementation of the textbox - making changes like this more simple, but if that's not practical, KeyPreview should work.

Resources