Por motivos de perdida de pc . necesito si alguien tiene esta versión y me la pueda ceder ya no encuentro la descarga por ningún lado
de antemano muchas gracias
Luis
de antemano muchas gracias
Luis
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúSub Combinacion()
i = 1
For b1 = 1 To 61
For b2 = b1 + 1 To 62
For b3 = b2 + 1 To 63
For b4 = b3 + 1 To 64
Cells(i, 1) = b1
Cells(i, 2) = b2
Cells(i, 3) = b3
Cells(i, 4) = b4
Range("E1") = i
i = i + 1
Next
Next
Next
Next
End Sub
Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
Dim intCol As IEnumerable(Of Integer) = {2, 6, 10, 11, 17, 20, 24, 34}
Dim pairsCol As IEnumerable(Of String) =
From value1 As Integer In intCol
From value2 As Integer In intCol
Select String.Join(Environment.NewLine, (
From value3 As Integer In intCol
Where (value1 <> value2) AndAlso
(value1 <> value3) AndAlso
(value2 <> value3) AndAlso
(value3 > value2) AndAlso
(value2 > value1)
Select String.Format("{0:00}, {1:00}, {2:00}",
value1, value2, value3)))
Dim ClearRep As New List(Of String)
For Each pairs As String In pairsCol
For Each line As String In pairs.Split({Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
ListBox4.Items.Add(line)
Next line
Next pairs
MessageBox.Show(ListBox1.Items.Count)
End Sub
Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
Dim Elementos As IEnumerable(Of Integer) = {1, 4, 5, 8, 33, 44, 45, 68, 98}
Dim EleX As Integer = 0
Dim EleX1 As Integer = 0
Dim EleX2 As Integer = 0
Dim EleX3 As Integer = 0
Dim EleX4 As Integer = 0
ListBox4.Items.Clear() 'Limpia el ListBox
For I1 As Integer = 0 To Elementos.Count - 1 : EleX += 1
For I2 As Integer = EleX To Elementos.Count - 1
For I3 As Integer = EleX To Elementos.Count - 2
For I4 As Integer = EleX To Elementos.Count - 3
For I5 As Integer = EleX To Elementos.Count - 4
For I6 As Integer = EleX To Elementos.Count - 5
If Elementos(I2) <> Elementos(I3) And Elementos(I3) <> Elementos(I2) < Elementos(I4) < Elementos(I5) Then
ListBox4.Items.Add(String.Format(Format1, Elementos(I1), Elementos(I2), Elementos(I3), Elementos(I4), Elementos(I5), Elementos(I6)))
End If
Next
Next
Next
Next
Next
Next
MessageBox.Show("Combinaciones: " & ListBox4.Items.Count)
End Sub
'//QUITAR ELEMENTOS REPETIDOS --------------------funciona bien con otra funcione con esta me da error
Dim nuevaLista As New List(Of Integer)
For Each elemento In ListBox4.Items
nuevaLista.Add(elemento)
Next
nuevaLista = nuevaLista.Distinct.ToList() 'elimina repetidos
nuevaLista.Sort() 'Ordena la lista
ListBox4.Items.Clear() 'limpia el listbox (no funciona con DataSource)
'ListBox4.DataSource= Nothing 'usar solo si es se usó datasource para llenar el listbox
For Each Elemento As String In nuevaLista
ListBox4.Items.Add(Elemento)
Next
'****************combinaciones FUNCIONA DE p**a MADRE
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
Dim input As Integer() = (Result1)
Dim output As New List(Of Integer)
For i As Integer = 0 To input.Length - 1
For j As Integer = 0 To input.Length - 1
If input(i) <> input(j) AndAlso input(i) < 5 Then
Dim result As Integer = (input(i) * 10 + input(j))
output.Add(result)
End If
Next j
Next i
Me.ListBox8.Items.AddRange(output.Cast(Of Object).Distinct().ToArray)
End Sub
Return If(Value < MAX, Value, Rand.Next(0, MAX))
'--combis para reparar nesecita un boton y un trxbox TRABAJANDO EN ELLO AHORA
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
' Dim intCol As IEnumerable(Of Integer) = {2, 3, 4, 7}
Dim intCol As IEnumerable(Of Integer) = (Result1) '<---aca convierto las variables que trae los numeros pueden ser del 1 al 9
' lo que nesecito es formar combinaciones pares y que no pase del numero 50
Dim pairsCol As IEnumerable(Of String) =
From value1 As Integer In intCol
From value2 As Integer In intCol
Select String.Join(Environment.NewLine, (
From value3 As Integer In intCol
Where (value1 <> value2) AndAlso
(value1 <> value3) AndAlso
(value2 <> value3)
Select String.Format("{0:00}, {1:00}, {2:00}",
value1, value2, value3)))
For Each pairs As String In pairsCol
For Each line As String In pairs.Split({Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries).Distinct().ToArray
' MsgBox(pairs.Count)
' MsgBox(line.Count)
Me.ListBox3.Items.Add(line)
Next line
Next pairs
End Sub
Dim Rand As New Random
' Concateno, y...
' Elimino duplicados, y...
' Selecciono los números inferiores a MAX, y...
' Convierto los números mayores a MAX a números aleatorios entre 0 y MAX.
Dim Result As IEnumerable(Of Integer) =
(Result1.Concat(Result2).Concat(Result3).Concat(Result4).Concat(Result5)).
Distinct.
Select(Function(Value As Integer)
Return If(Value < MAX, Value, Rand.Next(0, MAX))
End Function)
' Dim intCol As IEnumerable(Of Integer) = {2, 3, 4, 7}
Dim intCol As IEnumerable(Of Integer) = (Result1)
Dim Result As IEnumerable(Of Integer) =
(Result1.Concat(Result2).Concat(Result3).Concat(Result4).Concat(Result5)).
Distinct.
Select(Function(Value As Integer)
Return If(Value < MAX, Value, Rand.Next(0, MAX))
End Function)
ListBox7.Items.AddRange(Result.Cast(Of Object).ToArray)
ReadOnly Property Num1 As Int32
Get
Return CInt(TextBox1.Text)
End Get
End Property
Result1 = {Num1 + 1, Num1 + 3} _
.Distinct().ToArray ' Elimino duplicados
Dim Elementos As IEnumerable(Of Integer) = {1, 3, 4, 5, 8, 13, 34, 55, 84, 99}
Dim EleX As Integer = 0
Dim EleX2 As Integer = 0
ListBox1.Items.Clear() 'Limpia el ListBox
For I1 As Integer = 0 To Elementos.Count - 1 : EleX += 1
For I2 As Integer = EleX To Elementos.Count - 1
For I3 As Integer = EleX To Elementos.Count - 1
If Elementos(I2) <> Elementos(I3) And Elementos(I3) > Elementos(I2) Then
ListBox1.Items.Add(String.Format("{0:00}, {1:00}, {2:00}", Elementos(I1), Elementos(I2), Elementos(I3)))
End If
Next
Next
Next
MessageBox.Show("Combinaciones: " & ListBox1.Items.Count)
Dim Bz986 As IEnumerable(Of Integer) =
(
From Value As Integer In split(12).Concat(split(15).Concat(split(16)))
Where (Value <= MAX AndAlso Value > 0)).Distinct
Dim selectedValues11 As IEnumerable(Of Integer) =
From value As Integer In Bz909
Group By CStr(value).Last Into Group
Select Group.First()
Take(16())
Dim Sl986 As IEnumerable(Of Integer) = Bz986
Dim SM986 As List(Of Integer) = Bz986.Take(16).ToList
SM986.Sort()
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
ListBox1.Sorted = True
ListBox1.Sorted = False
Dim i As Integer
Dim count = ListBox1.Items.Count
For i = ListBox1.Items.Count - 1 To 0 Step -1
ListBox1.Items.Add(ListBox1.Items(i))
Next
For i = 0 To count - 1
ListBox1.Items.RemoveAt(ListBox1.SelectedItem)
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim intCol As IEnumerable(Of Integer) = {20, 24, 34, 37}
Dim pairsCol As IEnumerable(Of String) =
From value1 As Integer In intCol
From value2 As Integer In intCol
Select String.Join(Environment.NewLine, (
From value3 As Integer In intCol
Where (value1 <> value2) AndAlso
(value1 <> value3) AndAlso
(value2 <> value3)
Select String.Format("{0:00}, {1:00}, {2:00}",
value1, value2, value3)))
For Each pairs As String In pairsCol
For Each line As String In pairs.Split({Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries).Distinct().ToArray
' MsgBox(pairs.Count)
' MsgBox(line.Count)
Me.ListBox1.Items.Add(line)
Next line
Next pairs
End Sub
Dim intCol As IEnumerable(Of Integer) = {1, 3, 4, 5, 8, 13, 24, 35, 44, 49 ,55 ,77 ,88}
Dim pairsCol As IEnumerable(Of String) =
From value1 As Integer In intCol
Select String.Join(Environment.NewLine, (
From value2 As Integer In intCol
Where (value2 <> value1)
Select String.Format("{0:00}, {1:00}", value1, value2)))
For Each pairs As String In pairsCol
Console.WriteLine(pairs)
Console.WriteLine("------")
MessageBox.Show(pairs)
Next
End Sub
Public Class Form1
Dim NumElementos As IEnumerable(Of Integer) =
{0, 3, 4, 5, 8}
{01, 13, 34, 55, 84}
Sub Combinaciones()
For k = 2 To NumElementos
i = i + 1
For j = k To NumElementos
Next j
Next k
End Sub
End Class
Private Sub TextBox6_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox6.Validating
If (Int(TextBox6.Text) < 0 Or Int(TextBox6.Text) > 45) Then
MsgBox("Numero mayor que 45 en casilla 6 introduzca numero correcto")
End If
End Sub
Imports System.IO
Public Class Form1
Private TextBoxes As TextBox() = {Nothing}
Private N1 As Int32()
Private Result1 As Int32()
Private _textBox As Object
Private Property TextBox(ByVal TextBoxCount As Short) As Object
Get
Return _textBox
End Get
Set(ByVal value As Object)
_textBox = value
End Set
End Property
ReadOnly Property Num1 As Int32
Get
Return CInt(TextBox1.Text)
End Get
End Property
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Result1 = {Num1} _
Dim rutaFichero As String
Dim i As Integer
rutaFichero = Path.Combine(Application.StartupPath, "hts.txt")
Dim fichero As New IO.StreamWriter(rutaFichero)
fichero.Close()
End Sub
'--------------------------------
Private Sub PaginasBlokeadasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaginasBlokeadasToolStripMenuItem.Click
Process.Start(Path.Combine(Application.StartupPath, "C:\WINDOWS\system32\drivers\etc\hosts"))
End Sub
Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click
If MessageBox.Show("Esta seguro que desea Cerrar ", "Cerrar Stop Spam ", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
Me.Close()
End If
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim valuesInt As IEnumerable(Of Integer) =
{0, 3, 4, 5, 8}
{01, 13, 34, 55, 84} <---------usar esto ????
Dim pairs As IEnumerable(Of KeyValuePair(Of Integer, IEnumerable(Of Integer))) =
Form1.GetPairs(valuesInt, maxValue:=90)
For Each pair As KeyValuePair(Of Integer, IEnumerable(Of Integer)) In pairs
' ListBox1.Items.Add(String.Format("Key: {0,-4} Values: {1}", pair.Key, String.Join(", ", pair.Value)))
Next pair
Public Shared Function GetPairs(ByVal col As IEnumerable(Of Integer),
Optional ByVal maxValue As Integer = Integer.MaxValue) As IEnumerable(Of KeyValuePair(Of Integer, IEnumerable(Of Integer)))
If (col.Max >= 10) Then
Throw New ArgumentException(paramName:="col", Message:="El valor máximo de la colección debe ser un valor inferior a 10.")
Else
Return From value As Integer In col
Select New KeyValuePair(Of Integer, IEnumerable(Of Integer))(
key:=value,
value:=From index As Integer In col
Where (index <> value) AndAlso (CInt(value & index) <= maxValue)
Select CInt(value & index))
End If
Public Class Form1
Dim maxo As Integer = 7
Dim valuesInta As IEnumerable(Of Integer)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim valuesInt As IEnumerable(Of Integer) =
{0, 1, 2, 3, 4, 5, 6, 9}
Dim pairs As IEnumerable(Of KeyValuePair(Of Integer, IEnumerable(Of Integer))) =
Form1.GetPairs(valuesInt, maxValue:=80)
For Each pair As KeyValuePair(Of Integer, IEnumerable(Of Integer)) In pairs
ListBox1.Items.Add(String.Format("Key: {0,-4} Values: {1}", pair.Key, String.Join(", ", pair.Value)))
Next pair
MsgBox(String.Join(", ", pairs(0).Value))
MsgBox(String.Join(", ", pairs(1).Value))
MsgBox(String.Join(", ", pairs(2).Value))
MsgBox(String.Join(", ", pairs(3).Value))
Dim M1 As IEnumerable(Of Integer) = pairs(0).Value.ToList
Dim juntos2 As List(Of Integer) = M1
juntos2.Sort()
Me.ListBox2.Items.AddRange((From value As Integer In M1).Cast(Of Object).ToArray)
Dim M2 As IEnumerable(Of Integer) = pairs(1).Value.ToList
Dim juntos3 As List(Of Integer) = M2
juntos3.Sort()
'Me.ListBox2.Items.AddRange((From value As Integer In M1).Cast(Of Object).ToArray)
Dim M3 As IEnumerable(Of Integer) = pairs(2).Value.ToList
Dim juntos4 As List(Of Integer) = M3
juntos4.Sort()
Dim M4 As IEnumerable(Of Integer) = pairs(3).Value.ToList
Dim juntos5 As List(Of Integer) = M4
juntos5.Sort()
End Sub
Public Shared Function GetPairs(ByVal col As IEnumerable(Of Integer),
Optional ByVal maxValue As Integer = Integer.MaxValue) As IEnumerable(Of KeyValuePair(Of Integer, IEnumerable(Of Integer)))
If (col.Max >= 10) Then
Throw New ArgumentException(paramName:="col", Message:="El valor máximo de la colección debe ser un valor inferior a 10.")
Else
Return From value As Integer In col
Select New KeyValuePair(Of Integer, IEnumerable(Of Integer))(
key:=value,
value:=From index As Integer In col
Where (index <> value) AndAlso (CInt(value & index) <= maxValue)
Select CInt(value & index))
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cols As IEnumerable(Of IEnumerable(Of String)) =
From col As IEnumerable(Of Integer) In {juntos2, juntos3, juntos4, juntos5}.Distinct.ToList Where (col.Count() = maxo)
Group By String.Join("", col).AsEnumerable
Into(Group)
Select From value As Integer In Group.First.Distinct
Select value.ToString(format:="0#")
Me.ListBox2.Items.AddRange((From cols As IEnumerable(Of String) In cols Select String.Join(", ", col)).ToArray) [color=red]<-----ACA ME DA EL ERROR[/color]
' MsgBox(cols.Count)
End Sub
End Class
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim valuesInt As IEnumerable(Of Integer) =
{0, 1, 4, 6, 2, 8, 7}
Dim pairs As IEnumerable(Of KeyValuePair(Of Integer, IEnumerable(Of Integer))) =
From value As Integer In valuesInt
Select New KeyValuePair(Of Integer, IEnumerable(Of Integer))(
key:=value,
value:=From index As Integer In valuesInt
Where index <> Integer.Parse(CStr(value).Last)
Select CInt(value & index))
For Each pair As KeyValuePair(Of Integer, IEnumerable(Of Integer)) In pairs
ListBox1.Items.Add(String.Format("Key: {0,-4} Values: {1}", pair.Key, String.Join(", ", pair.Value)))
Next pair
End Sub
End Class
Dim pru As IEnumerable(Of Integer) =
Dim arregloSumasa() As Integer = {1, 2, 3, 4, 5}
Dim split As IEnumerable(Of IEnumerable(Of Integer)) =
SplitIntoParts(collection:=arregloSumasa, amount:=1, fillEmpty:=True)
Public Shared Function SplitIntoParts(Of T)(ByVal collection As IEnumerable(Of T),
ByVal amount As Integer,
ByVal fillEmpty As Boolean) As IEnumerable(Of IEnumerable(Of T))
Return From index As Integer In Enumerable.Range(0, CInt(Math.Ceiling(collection.Count() / amount)))
Select If(Not fillEmpty,
collection.Skip(index * amount).Take(amount),
If((collection.Count() - (index * amount)) >= amount,
collection.Skip(index * amount).Take(amount),
collection.Skip(index * amount).Take(amount).
Concat(From i As Integer
In Enumerable.Range(0, amount - (collection.Count() - (index * amount)))
Select DirectCast(Nothing, T))))
End Function
Dim Bz1 As IEnumerable(Of Integer) =
(
From Value As Integer In split(1).Concat(split(2).Concat(split(3)).Concat(split(4)).Concat(split(5)))
Where (Value <= MAX AndAlso Value > 0)).Distinct
Dim Sl1 As IEnumerable(Of Integer) = Bz1
Dim SM1 As List(Of Integer) = Bz1.toList
SM1.Sort()
Me.ListBox2.Items.AddRange((From value As Integer In SM1 Where value <> 0).Cast(Of Object).ToArray)
Dim split As IEnumerable(Of IEnumerable(Of Integer)) =
SplitIntoParts(collection:=alia1, amount:=2, fillEmpty:=True)
Dim Lnumbers As List(Of IEnumerable(Of Integer)) = { SM18, SM17, SM16, SM14....,}.Distinct.ToList
For Each col As IEnumerable(Of Integer) In Lnumbers
ListBox23.Items.Add(String.Join(", ", From value As Integer In col
Select If(value.ToString.Length = 1I,
value.ToString.Insert(0I, "0"c),
value.ToString)))
Next col
Dim Lnumbers As List(Of Integer) = rsalmlals2
For Each Lnumber As Integer In Lnumbers
ListBox1.Items.Add(String.Join(" "c, Lnumbers.Cast(Of Integer)))
Next Lnumber
If Resultados.Count < 30 Then
Resultados = Resultados.Concat(Enumerable.Repeat(Of Integer)(0, (30 - Resultados.Count)))
End If
If Resultados.Count < 30 Then
Resultados = numerosFaltantesdelRango
End If
Dim se As IEnumerable(Of Integer) = Resultss
Dim li As List(Of Integer) = se
li.Sort()
Me.ListBox7.Items.AddRange(li.Cast(Of Object).ToArray)
Dim values1 As integer
Dim values2 As integer
[color=red] Dim compuesto As Integer <-- a esta variable llegaria los datos de cualquiera de las dos anteriores[/color]
Dim Re As IEnumerable(Of Integer) =
(values).
Distinct.
Select(Function(values As Integer)
If values <= 35 Then
Return values
Else
Return values2
End If
End Function)
ReadOnly MAX As Integer = 99
Dim Rand As New Random
Dim ReAsult2255e As IEnumerable(Of Integer) =
(splits(1).Concat(splits(3).Concat(splits(5).
Distinct.
Select(Function(Value As Integer)
Return If(Value < MAX, Value, Rand.Next(1, MAX))
End Function))))
Dim seAlecctedValues231 As IEnumerable(Of Integer) = ReAsult2255e
Dim liste3 As List(Of Integer) = ReAsult2255e.Take(10).ToList
liste3.Sort()
ListBox12.Items.AddRange(liste3.Cast(Of Object).ToArray)
' ----------------------------------------------------------------------
Dim Rand1 As New Random
Dim AReAAsult2255e As IEnumerable(Of Integer) =
(splits(3).Concat(splits(10).Concat(splits(11).Concat(splits(12).
Distinct.
Select(Function(Value As Integer)
Return If(Value < MAX, Value, Rand1.Next(1, MAX))
End Function)))))
Dim seAlecctedValues231A As IEnumerable(Of Integer) = AReAAsult2255e
Dim listeA3 As List(Of Integer) = AReAAsult2255e.Take(10).ToList
listeA3.Sort()
ListBox13.Items.AddRange(listeA3.Cast(Of Object).ToArray)