Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

dim

HTTP Compression to Increase Data Transmission Speed on IIS Server
Wednesday, 29 February 2012 08:27
HTTP Compression Technique is one of the factor that increases the speed of the time that is this technique makes the data transmission speed between the Server and Clients significantly high. Appropriate HTTP Accept-encoding header should be sent from the Client for the compressed HTTP transmission otherwise it will be ignored and the normal data transmission will takes place

To enable the HTTP Compression on IIS Server, follow the below instructions
1. Click on the Start button
2. Click on Administrative Tools
3. Click on Server Manager
4. Expand the Roles from the Server Manager
5. Click on the Web Server (IIS)
6. Scroll until Role Services
7. Click on Add Role Services
8. From Add Role Services Wizard, select the Compression Type and then click on Next
9. Confirm the Installation
10. Click on Close button on the Result page

C# Configuration

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
private static void Main()
{
using (ServerManager serverManager = new ServerManager())
{
Configuration config = serverManager.GetApplicationHostConfiguration();
ConfigurationSection httpCompressionSection = config.GetSection("system.webServer/httpCompression");
ConfigurationElementCollection dynamicTypesCollection = httpCompressionSection.GetCollection("dynamicTypes");

ConfigurationElement addElement = dynamicTypesCollection.CreateElement("add");
addElement["mimeType"] = @"application/msword";
addElement["enabled"] = true;
dynamicTypesCollection.Add(addElement);

ConfigurationElement addElement1 = dynamicTypesCollection.CreateElement("add");
addElement1["mimeType"] = @"application/vnd.ms-powerpoint";
addElement1["enabled"] = true;
dynamicTypesCollection.Add(addElement1);

ConfigurationElement addElement2 = dynamicTypesCollection.CreateElement("add");
addElement2["mimeType"] = @"application/vnd.ms-excel";
addElement2["enabled"] = true;
dynamicTypesCollection.Add(addElement2);

serverManager.CommitChanges();
}
}
}


VB.NET Configuration

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample

Sub Main()
Dim serverManager As ServerManager = New ServerManager
Dim config As Configuration = serverManager.GetApplicationHostConfiguration
Dim httpCompressionSection As ConfigurationSection = config.GetSection("system.webServer/httpCompression")
Dim dynamicTypesCollection As ConfigurationElementCollection = httpCompressionSection.GetCollection("dynamicTypes")

Dim addElement As ConfigurationElement = dynamicTypesCollection.CreateElement("add")
addElement("mimeType") = "application/msword"
addElement("enabled") = True
dynamicTypesCollection.Add(addElement)

Dim addElement1 As ConfigurationElement = dynamicTypesCollection.CreateElement("add")
addElement1("mimeType") = "application/vnd.ms-powerpoint"
addElement1("enabled") = True
dynamicTypesCollection.Add(addElement1)

Dim addElement2 As ConfigurationElement = dynamicTypesCollection.CreateElement("add")
addElement2("mimeType") = "application/vnd.ms-excel"
addElement2("enabled") = True
dynamicTypesCollection.Add(addElement2)

serverManager.CommitChanges()
End Sub

End Module

If you have enabled HTTP Compression with in your hosted network, you can see the difference that how data transmission has improved its speed from normal transmission

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/mltSsNXjBl4/14825

 
Execute script file of sql server from vb.net code
Saturday, 28 January 2012 01:48
// Execute script file of sql server from vb.net code



Public Shared Function ExceuteScriptFile(ByVal ScriptFilePath As String, Optional ByVal MyConnectionKey As String ) As Integer
Dim db As Database
Dim MyServer As String = AppSettings("Server")
Dim MyUserName As String = AppSettings("userid")
Dim MyPassword As String = AppSettings("password")
Dim MyDbName As String = AppSettings("DBName")

Dim ScriptExeceute As New Process
Dim osqlParams As String = ""
db = DatabaseFactory.CreateDatabase(MyConnectionKey )
ScriptFilePath = """" + ScriptFilePath + """"
osqlParams = String.Format("-S {0} -U {1} -P {2} -d {3} -i ", MyServer, MyUserName, MyPassword, MyDbName)
ScriptExeceute.StartInfo.FileName = "sqlcmd.exe"

Try
ScriptExeceute.StartInfo.Arguments = osqlParams & ScriptFilePath
ScriptExeceute.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
ScriptExeceute.Start()
ScriptExeceute.WaitForExit()
Catch ex As Exception

End Try
Return 0
End Function

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/tcVwUBCikIk/14505

 
export data fro grid view to excel in asp.net
Saturday, 28 January 2012 01:44
// export data fro grid view to excel in asp.net


Private Sub ExportDataToExcel(ByVal myDataTable As DataTable)
Dim fileName As String = ""
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
fileName = "MyFile"
Response.AddHeader("Content-Disposition", "filename=" & fileName & DateTime.Now.Ticks & ".xls")
Response.Charset = ""
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
Dim myGrid As New GridView
myGrid.AllowPaging = False
myGrid.DataSource = myDataTable
myGrid.DataBind()
myGrid.RenderControl(htw)
Response.Write(sw.ToString())
Response.End()
myGrid.Dispose()
End Sub

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/gwnHQ5Yr_a8/14503

 
[DarkGDK.Net] Matrix Smoothing
Tuesday, 16 August 2011 09:34
// description of your code here
A matrix smoothing function for DarkGDK.Net, found over at The Game Creators. I'm mostly posting it on here to show it to some people in boredom, but what the hey.


Public Sub SmoothMatrix(ByVal Target As DarkGDK.Basic3D.Matrix, ByVal MaxTileX As Integer, ByVal MaxTileZ As Integer, ByVal Times As Integer)
Dim T As Integer
Dim X As Integer
Dim Z As Integer

Dim a As Long
Dim b As Long
Dim c As Long
Dim d As Long
Dim e As Long
Dim f As Long
Dim g As Long
Dim h As Long

Dim Total As Long
Dim Avg As Long

' DarkGDK.Text.SetColor(Color.Yellow)

For T = 1 To Times
For X = 0 To MaxTileX
For Z = 0 To MaxTileZ

a = Target.GetHeight(X - 1, Z + 1)
b = Target.GetHeight(X, Z + 1)
c = Target.GetHeight(X + 1, Z + 1)
d = Target.GetHeight(X + 1, Z)
e = Target.GetHeight(X + 1, Z - 1)
f = Target.GetHeight(X, Z - 1)
g = Target.GetHeight(X - 1, Z - 1)
h = Target.GetHeight(X - 1, Z)

If X <> 0 And X <> MaxTileX And Z <> 0 And Z <> MaxTileZ Then
Total = a + b + c + d + e + f + g + h
Avg = Total / 8
End If

If X = 0 And Z = 0 Then
Total = b + c + d
Avg = Total / 3
End If

If X = MaxTileX And Z = MaxTileZ Then
Total = f + g + h
Avg = Total / 3
End If

If X = 0 And Z <> 0 Then
Total = b + c + d + e + f
Avg = Total / 5
End If

If Z = 0 And X <> 0 Then
Total = a + b + c + d + h
Avg = Total / 5
End If

If X = MaxTileX And Z <> MaxTileZ Then
Total = a + b + f + g + h
Avg = Total / 5
End If

If Z = MaxTileZ And X <> MaxTileX Then
Total = d + e + f + g + h
Avg = Total / 5
End If

Target.SetHeight(X, Z, Avg)
Target.Update()

' DarkGDK.Text.ShowText(0, 0, "Average Height : " + Str(Avg))
' DarkGDK.Text.ShowText(0, 20, "Total Height : " + Str(Total))
' DarkGDK.Text.ShowText(0, 40, "T : " + Str(T) + "/" + Str(Times) + " X : " + Str(X) + " Z : " + Str(Z))
DarkGDK.Core.Sync()
Next Z
Next X
Next T
End Sub

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/Mt3eI7lADG8/13537

 
automated trading - code vba 2
Wednesday, 30 March 2011 17:44
// description of your code here


Private Function Slope(y1 As Double, y2 As Double, y3 As Double) As Double
Dim xm_x As Double
Dim xm_y As Double
Dim xm_xy As Double
Dim xm_x2 As Double

Dim x1 As Double, x2 As Double, x3 As Double
x1 = 1#
x2 = 2#
x3 = 3#

xm_xy = (x1 * y1 + x2 * y2 + x3 * y3) / 3#
xm_x = (x1 + x2 + x3) / 3#
xm_y = (y1 + y2 + y3) / 3#
xm_x2 = (x1 * x1 + x2 * x2 + x3 * x3) / 3#

Slope = (xm_xy - xm_x * xm_y) / (xm_x2 - xm_x * xm_x)
End Function

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/bBbP9fKPSow/13081

 


Taxonomy by Zaragoza Online