Yo había creado bloques de la misma altura con jquery (es muy sencillo) pero esta función lo hace de modo genérico (se le pasa la lista de elementos).
Visto en Sentido Web
function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); group.height(tallest); }
Ejemplo de llamada:
$(document).ready(function() { equalHeight($(".recent-article")); equalHeight($(".footer-col")); });
Para introducir un video de youtube, manteniendo el código de la página como xhtml válido debemos modificar el código que nos presenta youtube de la forma…
<object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U"> </param> <embed src="http://www.youtube.com/v/7_6B6vwE83U" type="application/x-shockwave-flash" width="425" height="350"> </embed> </object>
A esta otra
<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/7_6B6vwE83U"> <param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U" />< /object>
Private Sub WriteFile(ByVal FileName As String, ByVal data As String) If File.Exists(FileName) Then File.Delete(FileName) Dim swFile As StreamWriter = File.CreateText(FileName) swFile.Write(data) swFile.Flush() swFile.Close() End Sub Private Function ReadFile(ByVal FileName As String) As String Dim ret As String = "" If File.Exists(FileName) Then Dim TheFile As System.IO.StreamReader = New StreamReader(FileName, System.Text.Encoding.Default) ret = TheFile.ReadToEnd() End If Return ret End Function
Private Function ReadStringResource(ByVal resource As String) As String Dim asm As Assembly = Assembly.GetExecutingAssembly() Dim stream As Stream = asm.GetManifestResourceStream(resource) Dim streamReader As StreamReader = New StreamReader(stream) Dim ret As String = streamReader.ReadToEnd Return ret End Function
Dim diskClass As New System.Management.ManagementClass("Win32_LogicalDisk") Dim disks As System.Management.ManagementObjectCollection = diskClass.GetInstances() Dim disk As System.Management.ManagementObject Dim space As System.UInt64 = 0 For Each disk In disks If disk("Description").ToString = "Local Fixed Disk" Then If disk("Description").ToString = "Local Fixed Disk" Then space += CType(disk("FreeSpace"), System.UInt64) End If Next disk
Ejecutar shell y capturar la salida
Dim p As New Process p.StartInfo.UseShellExecute = False p.StartInfo.RedirectStandardOutput = True p.StartInfo.Arguments = "x.txt y.txt" p.StartInfo.WorkingDirectory = "E:\winnt\system32" p.StartInfo.FileName = "xcopy " p.Start() Dim sr As IO.StreamReader = p.StandardOutput Dim sb As New System.Text.StringBuilder("") Dim sinput As String = "" Do Until sinput = "-1" sb.Append(sr.ReadLine() & ControlChars.CrLf) sinput = sr.Read Loop Return sb.ToString
Este ejemplo usa el app.config
Dim aConfig As Configuration.ConfigurationSettings Try Dim MailFrom As New MailAddress(aConfig.AppSettings("EmailFrom")) Dim MailTo As New MailAddress(aConfig.AppSettings("EmailTo")) Dim mailMsg As MailMessage = New MailMessage(MailFrom, MailTo) mailMsg.IsBodyHtml = True mailMsg.Priority = MailPriority.Normal mailMsg.Subject = "Subject for the mail" mailMsg.Body = ReadStringResource("Mail.htm") Dim SmtpMail As New Net.Mail.SmtpClient Dim theCredential As New Net.NetworkCredential("usuario", "contraseña") SmtpMail.Credentials = theCredential SmtpMail.Host = aConfig.AppSettings("EmailServer") SmtpMail.Send(mailMsg) Catch ex As Exception Console.WriteLine(ex.Message) End Try
SQL Query Analyzer tiene la posibilidad de ejecutar stored procedures con teclas rápida Ctrl + n (donde n es un número)
Esto se hace en Tools -> Customize
Entonces si agrego en Ctrl+4 por ejemplo el texto sp_select, al presionar ctrl+4 lo va a ejecutar
Si ejecutan el siguiente script en la base master, cada vez que seleccionen un texto (tanto en la parte de instrucciones t-sql) como en el área de resultados, aparecerá un select con el contenido de la tabla
CREATE procedure sp_select (@tabla AS varchar(200) ) AS declare @a AS varchar(300) SET @a = 'select * from ' + @tabla exec (@a) go
Espero que les sea de utilidad
Busca URLs en un texto y las convierte en un enlace con la URL como texto enlazable y sin title.
function SnTurls(texto) SnTurls = texto Set regx = New RegExp regx.Pattern = "http:\/\/[a-z]+\.[a-z]+\.[a-z]+\/" set matchs = regx.Execute(texto) for each match in matchs SnTurls = Replace(SnTurls, match, "<a href=""" & match & """>" & match & "</a>") next end function
Cómo compactar el espacio de transacciones asociado a una base de datos.
USE master BACKUP LOG DataBaseName WITH NO_LOG GO USE Cisa2005 DBCC SHRINKFILE(DataBaseName_log,1) GO