Achieve A List With All Possible Combinations Of Letters?
Sep 9, 2009
I was wondering how to achieve a list with all possible combinations of letters. Now there are some nice examples on the Internet, however, I'd like to have the following:
Let's assume you have 3 letters (A, B, C), and have a limit length of 3, then it should display this list:
A
B
C
AA
[Code].....
Now, this would be fine with recursive calls I think, but I find it really difficult to think how to code that and how the computer will execute the code. It would be easier if all possibilities had a length of 3, but here that isn't the case.
View 30 Replies
ADVERTISEMENT
Aug 3, 2009
I am writing an application in which we have a Product Module, Now instead of defining individual products, we want to just state the Size Ranges in Width, height and different size scale available, and then automatically generate a list of products with all the Size combinations. I cant figure how to do this.Ill give an example.This is how we define a product
Product[code].....
If i had a fixed number of Size types i would just run For loops within for loops and inside the inner most for loop write an Add Item statement with Index of evry selected item, however since the Size types are dynamic, i need to write a recursive loop, and i just cant figure how to.
View 7 Replies
Jul 13, 2009
I would like a function generate all of the k-combinations of elements from a List of n elements. Note that I am looking for combinations, not permutations, and that we need a solution for varying k (i.e., hard-coding the loops is a no-no).
I am looking for a solution that is a) elegant, and b) can be coded in VB10/.Net 4.0.
This means a) solutions requiring LINQ are ok, b) those using the C# "yield" command are not.
The order of the combinations is not important (i.e., lexicographical, Gray-code, what-have-you) and elegance is favored over performance, if the two are in conflict.
(The OCaml and C# solutions here would be perfect, if they could be coded in VB10.)
View 5 Replies
Jan 20, 2010
I am working on the old hangman game. I am up to a part were I have to use a sort button to alphabetically sort the letters already guessed that are showing in the list.
I have found this code:
Array.Sort(strLettersGuessed)
lblGuessed.Text = ""
For i = 0 To strLettersGuessed.Length - 1
lblGuessed.Text = lblGuessed.Text + strLettersGuessed(i) + ", "
[Code] .....
The problem I am having is where the flow chart asks us "is the letter at counter < the letter at counter -1? In my above code I am trying to answer this with this line:
If intCounter < strLettersGuessed.Length - 1 Then
I have tried about 50 different things in place of intCounter as well as strLettersGuessed.Length -1 and nothing seems to work. Sometimes I get an error stating can't be infinite, etc or I get no error at all but the sort button doesn't work.
View 12 Replies
Apr 2, 2012
I'm keeping track of some things that are numbered and others that are lettered; while NumericUpDown is perfect for selecting numbered things, I need an analogue for selecting lettered things. The obvious choice would be a listbox that just contains all the letters of the alphabet. But I need to show only the appropriate range of letters, so if I want to use a listbox, I need to write a function that populates the listbox with the first n letters of the alphabet; if n > 26, it should continue with aa, ab, and so on. How do I do this?
View 17 Replies
Aug 28, 2011
I save the bus Information in the two-dimensional array.As follows:
array 0 1 2 3 ..............................
0 106 A B C ..............................
1 102 D A E ..............................
[code]....
Array(x,0) are bus lines,behind its are place.Now I want go to the E form the A(pass 106),but A can't direct to E.But A can pass 102 to E.So line is [106-102].How can I achieve the bus transfer?
View 3 Replies
May 26, 2011
How to achieve my ToolStrip design the same as the picture below?
View 5 Replies
Apr 14, 2009
Most of our development is done in vb.net (not my choice) and one frequently used code pattern uses an 'On Error GoTo' followed by a 'Resume Next' so that all database fields can be read with a DirectCast() and any DBNull values are just ignored.
The current code would be
On Error GoTo error_code
oObject.Name = DirectCast(oReader.Item("Name"), String)
[code].....
View 6 Replies
Feb 11, 2009
I know I'm being quite pedantic here. But, what is the right way to get a true 50/50-chance with a generated random number? Say, to simulate the flip of a coin. [code] I know this difference is close to nothing, but I'm doing some calculations on bell curves, in such a way that it requires true 50/50-chance.
View 33 Replies
Jul 27, 2011
I want a modal screen on startup of the computer, so that user forces to make some action on that screen. Also I want to disabled close button of the screen, It should cover entire Desktop.How to achieve using winform/webform? is parent/child form is the only solution fro this/?
View 1 Replies
Sep 10, 2009
[code]What should i pass to achieve block the F12 key..
View 7 Replies
Sep 23, 2011
I found this example:
<telerik:RadDatePicker
ID="RadDatePicker1"
runat="server">
[Code]....
Ideally I don't want the FieldConfig class to be a visual class but it's ok if it is.
View 1 Replies
May 23, 2011
I have a class that uses a BackGroundWorker to download a single file using HttpWebRequest and HttpWebResponse
Downloading single file works.
But if I make two objects of that class and start downloading 2 different files simultaneously, there is nothing produced. Execution exits after getResponse() without any error or exception.
Is there any way to achieve simultaneous file download?
View 6 Replies
Jun 16, 2009
I am trying to achieve the look of the attached image using string.Format and PadLeft/PadRight but I have no success with it, anyone who could offer some help?
EDIT:The font I used is not mono-spaced and I am not inclined to use a mono-spaced font for this.
View 4 Replies
Jan 22, 2009
dim prc1,prc2 as Process
dim f,f1 as form
dim aHandle,bHandle as IntPtr
[code].....
View 4 Replies
Jan 22, 2009
dim prc1,prc2 as Process
dim f,f1 as form
dim aHandle,bHandle as IntPtr
[code]....
View 19 Replies
Apr 26, 2011
We have developed a vb.net application using multi-threaded listener concept and a dedicated thread for each folder to monitor. With that we simultaneously keep track of the incoming files in each folder.Currently, we are facing an issue whenever we receive multiple files of bulk volume, parallel processing of the files getting delayed with thread concept or failing sometimes.We need to implement the same logic with some other concept avoiding multi-hreading. Or is it possible to achieve performance tuning with the same thread concept?
View 2 Replies
Feb 10, 2011
Is it possible to use WPF in WinForms, to implement the idea used in this question. I am trying to create a semi-transparent panel.
View 3 Replies
Aug 17, 2009
I�m trying to achieve mouse movements with SendInput.
There is code that got from Pinvoke, [URL]
<DllImport("user32.dll", SetLastError = True)> _
Private Shared Function SendInput(ByVal nInputs As Integer, ByRef pInputs As InputLanguage,
[Code].....
View 4 Replies
May 19, 2009
How would I achieve a drop shadow effect around all edges of my Form?
View 9 Replies
Dec 7, 2010
Update to my Question the best way to achieve acceptable security is to use ASP.NET Web Site Administration Tool the following is only a demo to use session but it is NOT RECOMMENDED for professional use. follow the advice of PhillFox to achieve better results
[Code]...
View 2 Replies
Mar 30, 2012
When developing ASP.NET websites (using VB.NET web forms) - a lot of my time is spend writing CSS files and they always seem to get messy (code duplication) and very long.
All I want to achieve is to be able to manipulate the CSS using VB.NET code in the following ways:
Use an integer variable to store my "golden" number 7 and use that for width, padding, margin etc where needed
Use string variables to store my "golden" hex color codes e.g. "#44C5F2" and use them for color, background-color, border-color etc. where needed Use an integer variable to set the height of an element and have four child elements each with height: mynum / 4
I just want to use basic VB.net number and string manipulation in order to create a CSS file on the fly.
I understand that the end product - the CSS file shouldn't change much - it should at most change on a daily basis otherwise caching couldn't be used.[code]...
View 3 Replies
Apr 9, 2009
I am having a perl script through which i achieve is split or output from text file for each single ID , the output text file will contain data of that ID and the anme of the file will be ID.txt so if i am having one main file containing 100 or 200 ID's and for each ID's may be 10000 or more lines i would like to have 100 or 200 files containing data for each single ID which i am able to achieve from perl but is it possible from vb.net
open(TH,"myfile.txt")|| die print "not open1";
open(THG,">error.txt")|| die print "not open2";
open(INFO,">myfileAll.txt")|| die print "not open3";
$gt='0';
$flag=0;
[Code]...
View 1 Replies
Oct 28, 2009
I want simply to generate rapidly combinations of 16 take by2 using linq.So I want to display me the combinations only not arrangements:1,2 (not 2,1 because there are combinations)...1,16 2,3 (not 3,2) because they are combinations..2,16..Comb of 16 take by 2 makes 120 so 120 combinations will be displayed on screen.[code]So my question is how to display rapidly on screen the combinations of 16 take by 2 using this Enumerable class of Visual Basic .NET(the 120combinations in fact)
View 9 Replies
Aug 16, 2011
I am facing problem while in detecting the multiple key combinations ..here is my cod
Private Function keyboardCallBack(ByVal nCode As Integer, ByVal wParam As Integer, ByVal lParam As IntPtr) As IntPtr
[code].....
View 1 Replies
May 26, 2011
How can I write all possible combinations to the console? For example, if user enters abc, then it will write aaa, aab, aac, abb, abc, acc, bbb, bbc, ccc.
Here's some code:
Dim abc() As String = {"a", "b", "c"} '
Sub Main()
Console.WriteLine("Enter the amount of characters")
[Code]....
View 3 Replies
Dec 28, 2010
I think what I'm trying to do is considered a permutation but I could be wrong. I've come across several examples of how to permutate a string as follows:
Permutations of {A B C}: {A B C}, {A C B}, {B A C}, {B C A}, {C A B}, {C B A}
What I'm needing are results similar to this (using the same input) with a repeat of each item to create a list of all possible combinations: {A A A}, {A A B}, {A A C}, {A B A}, {A B B}, {A B C}, {A C A}, {A C B}, {A C C}...and so on.
Below is some code that I found that almost gets me there with an exception of the repeated values:
'Generates all possible combinations from a series of words
Public Function PermutateString(ByVal input_string As List(Of String), Optional ByVal Base As String = "") As List(Of String)
Dim i As Long
[CODE]...
View 1 Replies
May 26, 2010
I'm trying to send Ctrl+A to Notepad but nothing is happening. Code for the button:
[Code]...
View 1 Replies
Sep 8, 2009
How can I bind a key combination to my vb.net application? I know it has SOMETHING to do with the registry, but I have no earthly idea what or how to go about doing this. I want the user to be able to hit those keys when the app is open and have it execute my function, but not while the app is closed.
View 3 Replies
May 30, 2009
I am trying to generate all possible 3 or 4 digit combinations from 0 to 9. I will be outputting them to a text file but I just need help with actually generating them.
View 7 Replies