Friday, June 20, 2008

Hydrochlorothiazide With Adderall

Collections searches. What is the best way?

few days ago I felt the need to implement research about generic collections and began to find some method that allows me to search a generic collection type List (of T) to what I found the find method, but with very little help on him, and I turned & # 237; the ever useful newsgroup in which I received the help they need from one of the friends that there are always willing to help.

Well in short after seeing that was difficult but a bit scratched the method to implement the find command in the collection because it uses pointers to functions and global variables to the form, I use another class that is the SortedList (Of TKey, TValue) that vendríaa be ordered as a generic collection whose main feature is its easy and clean implementation. He also had the option of using the old for a sequential search for the collection, but this seemed somewhat outdated and inelegant , and was therefore to begin my research into search forms in a collection.

After testing with 1000000 of objects in a collection list (of T) and another SortedList (Of TKey, TValue) that the best way to work with many the old object is for or for each, if though I believe so, it turns out that although the SortedList (Of TKey, TValue) is much faster when do the search, is extremely inefficient in the time of loading, in my case, the uploaded million objects en 12 minutos!!! si, 12 minutos, mientras que la carga en una colección list(of T) tardó 3 segundos!!! increíble la diferencia no?. Eso si la búsqueda en el sortedlist no llegaba a un milisegundo mientras que en la list(of T) tardaba 80milisegundos con los for y entre 900 y 1100 milisegundos con el método find, la verdad que me sorprendió el resultado. Las pruebas las hice en una notebook pIV  de2.4Ghz con 512MB de memoria, me aseguré de buscar el último elemento de la colección.

Todos son muy fáciles de comprender, tal vez el mas "vuelteado" is using the find method because it uses global variables to form predicate and an object becomes a kind of pointer to the search function.

Well I spend my code that did the testing if you will see the implementation of these search methods

We call it a Winform frmColeccionesGenericas in which they placed 4 buttons each with a label below to show results (leave names by default), Each button is a type of load-search in a collection & # 243; n. Then go the codebehind and copied it, the following list is the full form

Public Class frmColeccionesGenericas

'global variable form to be used with the method , all find
Dim s_NombreABuscar As String

'global variable' Issue of items in the collection
Private nElementos As Integer = 1000000

'with the find method
Private Sub Button1_Click ( ByVal sender As System.Object, ByVal As and System.EventArgs) Handles Button1.Click Dim

ini As Date Dim
order As Date Dim
diff As TimeSpan

'---------------------carga la coleccion

ini = Now

Dim l As New List( Of cPersona)
For i As Integer = 1 To nElementos

        l.Add(

New cPersona(i, "John" & i, "321" & i)) Next

order = Now

fin.Subtract diff = (ini)

I . Label1.Text = "Time Charge" & diff.Minutes & ":" & diff.Seconds & " " & diff.Milliseconds

Load the collection
'---------------------
'Create a Predicate object that points to the role fBuscador
Dim

fBuscador As New Predicate (Of cPersona) (AddressOf Search)

'form variable
s_NombreABuscar = " , John " & nElementos

'----
search
ini = Now
Dim p As cPersona = l.Find (fBuscador) end = Now

fin.Subtract diff = (ini)

I . Label1.Text & = vbCrLf & "Time Search" & diff.Minutes & ":" & diff.Seconds & ":" & diff.
Milliseconds End Sub

Private

Function Search (ByVal person As cPersona) As Boolean

If persona.Nombre.ToLower = s_NombreABuscar. ToLower Then

Return True

Else

Return False

End If

End Function

'with
SortedList Private Sub
Button2_Click ( ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Button2.Click

Dim ini As Date
Dim end The
Date Dim diff The TimeSpan

'--- load Justice ordered

Dim the The New SortedList (Of String , CPerson)
Dim p The CPerson
ini = Now
For and The Integer = 1 To nElementos

p =

New cPersona (i, "John" & i, "321" & i)

l.Add (p.Nombre, p)

Next

order = Now
fin.Subtract diff = (ini)

I . Label2.Text = "Duration:" & diff.Minutes & ":" & diff.Seconds & ":" & diff.Milliseconds

---
collection searches

ini = Now
p = l (

"John" & nElementos) end = Now

diff = fin.Subtract (ini)
I . Label2.Text & = vbCrLf & " ; Time Search: " & diff.Minutes & ":" & diff.Seconds & ":" & diff.Milliseconds

End Sub

'with a
for
Private Sub Button3_Click ( ByVal sender As System.Object, ByVal and As System . EventArgs) Handles Button3.Click

Dim ini The Date
Dim end The
Date Dim diff The TimeSpan

' ---- Justice load

Dim the The New List (Of CPerson)
Dim p The CPerson
ini = Now
For

i As Integer = 1 To nElementos

p =

New cPersona (i, "John" & i, "321" & i)
l.Add (p)

Next

order = Now
fin.Subtract diff = (ini)

I . Label3.Text = "Load Time" & diff.Minutes & ":" & diff.Seconds & ":" & diff.Milliseconds

'--- busca elements
being
= Now Dim s As String = "John" & nElementos
For to As Integer = 1 To nElementos

p = l(i)

If p.Nombre = s Then

      Exit For

End If

Next

fin = Now
diff = fin.Subtract(ini)

Me .Label3.Text &= vbCrLf & "Time Search" & diff.Minutes & ":" & diff.Seconds & ":" & diff. Milliseconds

End Sub

'with a' for each
Private Sub Button4_Click ( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Dim ini As Date
Dim fin As Date
Dim diff As TimeSpan
Dim l As New List( Of cPersona)
Dim p As cPersona
ini = Now For
i As Integer = 1 To nElementos

p =

New cPersona (i, "John" & i, "321" & i)
l.Add (p)

Next

order = Now
fin.Subtract diff = (ini)

I . Label4.Text = "Time de Carga " & diff.Minutes &" "& diff.Seconds &" "& diff.Milliseconds

ini = Now

Dim s As String = "Juan" & nElementos
For Each p In l

If p.Nombre = s Then

Exit For End
If

Next

order = Now
fin.Subtract diff = (ini)

I . Label4.Text & = vbCrLf & "Time Search" & diff.Minutes & ":" & diff.Seconds & ":" & diff.Milliseconds

End Sub

'Class to fill the collection
Class cPersona

Private nCode As Integer
Private sname As String
Private sTelefono As String

Public Property Cod() As Integer
Get

Return nCod

End Get
Set ( ByVal value As Integer )

nCod = value

End Set
End Property

Public Property Nombre() As String
Get

Return sNombre

End Get
Set ( ByVal value As String )

sNombre = value

End Set
End Property

Public Property Telefono() As String
Get

Return sTelefono

End Get
Set ( ByVal value As String )

sTelefono = value

End Set
End Property

Public Sub New ( ByVal n_Cod As Integer , ByVal s_Nombre As String , ByVal s_Telefono As String )

nCod = n_Cod
sTelefono = s_Telefono Sname = s_Nombre

End Sub

End Class

End Class

Well that's it for today

Salu2
Sergio

Wednesday, June 18, 2008

Movies Salieri On Line

localhost does not work but if the ip 127.0.0.1

Hello

few days ago I had a problem and that almost makes me reinstall the computer, but thanks to friends the aspnet newsgroup (microsoft.public.es.dotnet.aspnet) I managed to correct the problem. It turns out that without knowing how IIS awoke one morning with no desire to work, any address placed in the IE as http://localhost/loQueSea not getting anywhere and after & # 233; s expect a lot of time left a message saying the site was unavailable or the address did not exist, not even a html page or the default site that brings the iis, nothing, nothing! I happened to try the ip 127.0.0.1 instead of localhost and it worked, it worked but with the mentioned ip or the ip did my dhcp. Well after more than 2 days of searching the Internet how to fix this I answered in the newsgroup with the solution, which was to run the following commands

first open a command window and in the folder C: \\ Inetpub \\ AdminScripts, do the following

cscript adsutil.vbs set w3svc/1/serverbindings "127.0.0.1:80: localhost"

then the folder the framework, C: \\ WINDOWS \\ Microsoft.NET \\ Framework \\ v2.0.50727 have to run the following commands


aspnet_regiis-u aspnet_regiis-i aspnet_regiis-ga
NombreDeTuComputadora \\ ASPNET

Summarizing all previous commands was to re-associate the ip to localhost aspnet 2.0 then uninstall then reinstall and third place you permissions to aspnet user machine

here are some Linsker explaining step commands

Adsutil.vbs Using the Administration Script (IIS 6.0)

Description Adsutil and MetaEdit tools used to modify the Metabas

and in relation to other command

Well I hope you like my
help
Salu2
SergioT

Wednesday, June 4, 2008

Fluttering Lower Stomach Implantation

ContextSwitchDeadLock Error debuging

Hello

That errorcito scrub it, do not know if they ever came out but I did lose several hours, before wandering into what it means for truth is an issue I comment a bit thick "solution"

must turn off a checkbox that corresponds to MDA (managed debugging assistant) of ContextSwitchDeadLock name.

Debug / Exceptions / Managed debuging assistants.

Turn off the check box corresponding ContextSwitchDeadLock

By default option does not appear in the submenu Debug Exceptions, if that is the case añadanlo by:

Go to View / Toolbars / Customize

Once there

in the left pane and select Debug from the options on the right will be exceptions, take the option and drag to the debug menu

Well now a small & # 241; to explain this, is that the MDA are assistants and aids used in the debug in coordination with the CLR, they generate informational messages run-time events and from what I understand the error that occurs in this case is that the debugger throws this exception and finding threads in the Implementation n being debugged that appear to be hung and not return any message, and the MDA, not knowing the state generates this exception. On the other hand I read it a problem in a COM component that the application is doing burreras hehe Early · Solutions · put them in quotes because if you actually realize the problem is not solved but if it prevents the Debug throw the error, the problem is most likely due to a COM component that is not communicating properly with the MDA and thus it throws the exception. Well

finally here's a few links in case you want to read more about this error, which is a rarity and if anyone thinks confused over this and wants to leave me a comment, will be welcome

http://msdn.microsoft.com/es-es/library/d21c150d (VS.80). aspx

http://msdn.microsoft.com/es-es/library/ms172233 (VS.80 ). aspx

Salu2
SergioT

Monday, June 2, 2008

Soul Silver Chaining Shiney

2005

Hello

Here I send a link to the cumulative update of VSS, it will solve several problems of which one happened to me is the fact of the timeout in the download and update sources via HTTP when the files are relatively large

Well there is the link

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8a1a68d8-db11-417c-91ad-02aab484776b

In this other link can more details regarding the source control

http://blogs.msdn.com/richardb/archive/2007/12/11/sourcesafe-2005-update-is-available-for-download.aspx


salu2 Sergio

Sunday, June 1, 2008

Fibrids Back And Foot Pain

VSS Update for Internet via HTTP

Hello

The 2005 version of Visual SourceSafe has the option to access a database from anywhere in the world via HTTP so easy and simple, then I will describe how to configure VSS to share a DB to allow access via Iinternet.

to use the following scenario a server 2003 in which BD is the VSS and we will be an XP machine, both must have the VSS installed. There are 2 ways to configure Internet access from one is using SSL (secure socket layer) and the other without using SSL, the latter is easier to configure but also less secure because the information is transferred as plain text and is therefore susceptible to theft.

For both types of access should be installed, configured and published on IIS on a computer

Let

access without SSL

  • First of all must share the folder in which it was created BD SourceSafe, for this just open a browser windows and folder sharing, you have to take into account the access permissions to that folder via LAN for users who will have access to the database. Suppose that our database is in the folder D: \\ ss \\ mydb
  • Now that we have shared the DB on the LAN administrator open up the VSS (SSAdmin) and open the database but with UNC address \\ \\ mymachine \\ mydb
  • Once we open the database with management the option is enabled UNC Server \\ Settings No, let's go to that opcióny Check to "Enable SourceSafe for this computer" and also "Enable SourceSafe Internet for this database "then place the IP or DNS name of the team's web server, which is supposed to have IIS up and running.
  • VSShttp1
  • Pressing accept elsiguiente receive warning
  • VSShttp2
  • Press NO to continue working without SSL
  • That would be everything you need, now let's try if all is well we test access from the Internet by opening an IE and putting the IP of the site indicated inthe Settings, call the webservice that is automatically configured on our IIS, something similar to the following:
    http://205.150.152.001/SourceSafe/VssService.asmx


  • If all is well see a window asking for a valid user on the server, there must give the name and password of a valid user of the server that has access to the shared folder count is the BD server, you must have read / write permissions. One very important thing to understand here is that if we do not use SSL, the WAS (Web Service) VSS uses impersonation which means that the user provided when the Explorer we requested must have read / write permissions to the folder of the BD and it MUST be created as user in the VSS database, finally you must activate the option & # 243; n "Use network name for the user's Session start automatically" is at Tools / Options / General, this is set up well by default. Well if this is true will fail WAS but one in which we see that actually is responding, we realize that this error is entitled as follows: "Error application server in '/ SourceSafe'. "

Well now that you have everything properly configured on the server, go to the remote machine that seeks access to the database. Well this is the most simple and consists of the following: Open the

  • VS2005, go to Tools / Options / Source Control / Selection of complement and there ; selects Microsoft Visual SourceSafe (internet) and in the following figure
  • VSShttp3
  • Now go to Tools / Options / Source Control / Configuration complement, place the name of the user who has access to the database and the server, then click Advanced and destickee the option to use SSL, as inthe following figure:
  • VSShttp4

Well that's it for configuration, now we only tested for example by opening a solution that we already have in the database. For this there is a procedure "Special" is the comment below: Let us open

  • VS2005 Let
  • Open Project and then set to "SourceSafe (Internet)"
  • 's select "Add SourceSafe database, a wizard that will ask the IP or domain name (in my example http://205.150.152.001 ) and folder shared ( \\ \\ mymachine \\ mydb ), to give the following, if the connection does ask for a username and password on the target machine, the user must provide, if properly authenticate us ask us to give a name to the conexióny ready.
  • Now only select the project you want to open in the BD and ready brazen VS2005 project will start in our project default folder which is set to (tools / options / projects and solutions / general / VS projects location)

I commented that I use this way and it really works well is f & # 225; easy to use and its configuration is not no big deal, just be careful with permissions to the folders in the database and make sure your domain users using the BD est & # 225, n created as users of the BD

Well that's all for now, I hope to guide them up soon!, I describe another access via SSL

salu2 SergioT