Herbee

bot software development

TSQL: user defined function split

CREATE FUNCTION [dbo].[udfSplit](@text nvarchar(max), @delimiter char(1) = ‘ ‘)

RETURNS @Strings TABLE ( position int IDENTITY PRIMARY KEY, value nvarchar(max) )

AS

BEGIN

DECLARE @index int

SET @index = -1

WHILE (LEN(@text) > 0)

BEGIN SET @index = CHARINDEX(@delimiter , @text)

IF (@index = 0) AND (LEN(@text) > 0)

BEGIN

INSERT INTO @Strings VALUES (@text) BREAK

END

IF (@index > 1)

BEGIN

INSERT INTO @Strings VALUES (LEFT(@text, @index – 1))

SET @text = RIGHT(@text, (LEN(@text) – @index))

END

ELSE

SET @text = RIGHT(@text, (LEN(@text) – @index))

END

RETURN

END

parameters:

@text: text to split

@delimiter: character

returns:

table with columns position und value

SELECT * FROM [OLReweAbf].[dbo].[udfSplit] (‘test’,'t’)

position value
1 es

example:

Update LBFulfillmentKNORueckmeldungAuftrag

SET PaketGew = (select sum(cast([value] as bigint)) from [dbo].[udfSplit](PaketGew,’:'))

WHERE VersandartID LIKE ‘LKW%’ AND PaketGew LIKE ‘%:%’ AND TrackingNr is NULL

new: Herbee´s design t-shirts shop

“Altstadtcafe – speaker ‘n wings on leaves”

white girlie tee classic . we carry t-shirts in all colors and sizes. Stunning at Herbee Shirts.

test

click here to find more new designs on Herbee Shirts shop

copybot – copyrights and content creation in Second Life

It seems that the copybot is still a topical subject and there is an other guy selling a new one, which can be found with the keywords “CopyBot SLBot Backup Tool”
It allows the user to create a replication of an object, including textures, that is fully permissive.

On Friday, April 11th, 2008 laurap linden stated the following:
“CopyBot Infringement – A Terms of Service Violation
Finally, to reiterate our policy on CopyBot: Any use of it to make infringing copies of our customers’ e-houses violates the Terms of Service and may result in suspension or banning of Second Life accounts. If you believe that a Resident has used CopyBot (or a similar application) to make infringing copies of your content, please file an abuse report and provide as much information as you can to support your claim. Although technology can’t prevent the copying of data drawn on your screen, we don’t tolerate Residents who seek to profit from infringing use of CopyBot.
We’re sometimes asked why Residents are allowed to have or sell copying devices. The answer is that there are legitimate uses of a copying mechanism. It’s the infringement that we don’t allow and won’t tolerate.”

“If you DO think someone has copied something you made and is violating your copyright by profiting from the copying then you do have the option of using the DMCA process to file a complaint. It’s a difficult process, but it is one that we’re willing to help enable because we agree that copying is a disincentive to creation.
The DMCA process provides you with the channel to protect your investment. It’s to your benefit to review the government’s rules for filing a copyright and protecting it, posted at http://www.copyright.gov/title17/92chap5.html. More government-provided information on copyrights can be found here: http://www.copyright.gov.”

see also blog entries from Cory Linden: OpenGL, Copying, and Stealing
and Robin Linden: <a href=” https://blogs.secondlife.com/community/features/blog/2006/11/14/copyrights-and-content-creation-in-second-life”>Copyrights and Content Creation in Second Life

new ISP

I changed ISP: installed KabelDeutschland today and the result is not so bad ^^
hmmm … the upload could be better :/

web Instant Messenger for Second Life

i found it today: web|SIM – Instant Messenger for Second Life

it´s from a german guy: SL Name Keane Koga

“You can register at a terminal inworld and get a free premium access for 31 days.
(freebie tarif from 1L$ per month)

With the registration you´ll get the web|SIM-HUD.
With this HUD you are able to send IMs from SL to his website.
The SL password is not needed for web|SIM !”

get imported namespaces of a schema and their schema location


''' <summary>
''' get all imported namespaces of a schema and their schema location
''' </summary>
''' <param name="oSchema">schmema</param>
''' <returns>Dictionary(imported namespace, schema location) </returns>
''' <remarks></remarks>
Function RecurseExternalSchemas(ByVal oSchema As XmlSchema) As Dictionary(Of String, String)
Dim oResult As New Dictionary(Of String, String)
For Each oExternal As XmlSchemaExternal In oSchema.Includes
If oExternal.GetType() Is GetType(XmlSchemaImport) Then
Dim import As XmlSchemaImport = CType(oExternal, XmlSchemaImport)
If Not oExternal.SchemaLocation = Nothing Then
oResult.Add(import.Namespace, oExternal.SchemaLocation)
Else
oResult.Add(import.Namespace, String.Empty)
End If
End If
If Not oExternal.Schema Is Nothing Then
RecurseExternalSchemas(oExternal.Schema)
End If
Next
RecurseExternalSchemas = oResult
End Function

..:: Whereever you go, stay in touch. Download toolbar now! It´s free, private and secure. ::..

how to check if a column in a datareader exists

”’ <summary>
”’ checks if a column in a datareader exists
”’ </summary>
”’ <param name=”reader”>SqlDataReader</param>
”’ <param name=”sColumnName”>columnname</param>
”’ <returns>true, column exists else false</returns>
”’ <remarks></remarks>
Public Function ColumnExists(ByVal reader As SqlDataReader, ByVal sColumnName As String) As Boolean
reader.GetSchemaTable().DefaultView.RowFilter = “ColumnName= ‘” + sColumnName + “‘”
Return (reader.GetSchemaTable().DefaultView.Count > 0)
End Function

..:: Whereever you go, stay in touch. Download toolbar now! It´s free, private and secure. ::..

a recursive walk through XPathNavigator

Sub RecursiveWalkThroughXpath(ByVal oNavigator As XPathNavigator)
Select Case oNavigator.NodeType
Case XPathNodeType.Element
If oNavigator.Prefix = String.Empty Then
Console.WriteLine(“<{0}>”, oNavigator.LocalName)
Else
Console.Write(“<{0}:{1}>”, oNavigator.Prefix, oNavigator.LocalName)
Console.WriteLine(vbTab + oNavigator.NamespaceURI)
End If
Case XPathNodeType.Text
Console.WriteLine(vbTab + oNavigator.Value)
End Select

If oNavigator.MoveToFirstChild() Then
Do
RecursiveWalkThroughXpath(oNavigator)
Loop While (oNavigator.MoveToNext())

oNavigator.MoveToParent()
If (oNavigator.NodeType = XPathNodeType.Element) Then
Console.WriteLine(“</{0}>”, oNavigator.Name)
End If
Else
If oNavigator.NodeType = XPathNodeType.Element Then
Console.WriteLine(“</{0}>”, oNavigator.Name)
End If
End If
End Sub

..:: Whereever you go, stay in touch. Download toolbar now! It´s free, private and secure. ::..

CLR stored procedure to create a external schema (xsd) or a xml file including schema from a SQL Server table

<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub spLBgenerateInstallscript( _
ByVal sTablename As String, _
<Out()> ByRef iReturnvalue As SqlInt32)

Dim oCommand As SqlCommand
Dim oDom As New Xml.XmlDocument
Dim oDom2 As New Xml.XmlDocument
Dim oReader As Xml.XmlReader
Dim sXML As String = String.Empty
Dim oSB As New StringBuilder
Dim sOutputfilename As String

Using oConnection As New SqlConnection(“context connection=true”)
Try

oConnection.Open()
oCommand = oConnection.CreateCommand
oCommand.CommandText = “SELECT * FROM ” & sTablename & ” FOR XML AUTO, TYPE, XMLSCHEMA, ELEMENTS, ROOT (‘” & sTablename & “‘)”
oCommand.CommandType = CommandType.Text
oReader = oCommand.ExecuteXmlReader

oReader.Read()
Do While oReader.ReadState <> Xml.ReadState.EndOfFile
sXML &= oReader.ReadOuterXml()
Loop
oReader.Close()
oDom.LoadXml(sXML)

Dim schema As Xml.XmlNode = oDom.ChildNodes(0).FirstChild

Dim mynode As Xml.XmlNode = oDom2.ImportNode(schema, True)
oDom2.AppendChild(mynode)

‘write schema only
sOutputfilename = “C:\” & sTablename & “_” & String.Format(“{0:” & “yyyyMMddHHmmss” & “}”, Now)
oDom2.Save(sOutputfilename & “.xsd”)

‘write xml with inline schema
oDom.Save(sOutputfilename & “.xml”)

iReturnvalue = 0

Catch SQLex As Exception

#If DEBUG Then
EmitDebugMessage(“spLBgenerateInstallscript exeption SQLex: ” & SQLex.Message)
#End If
iReturnvalue = 1

Finally

If oConnection.State <> ConnectionState.Closed Then
oConnection.Close()
End If

End Try
End Using

End Sub

..:: Whereever you go, stay in touch. Download toolbar now! It´s free, private and secure. ::..

sample XmlReader Validation Handler

”’ <summary>
”’ XmlReader Validation Handler
”’ </summary>
”’ <param name=”sender”></param>
”’ <param name=”e”></param>
”’ <remarks>not used, not ready</remarks>
Sub oXmlReaderSettingsValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)
If e.Severity = XmlSeverityType.Warning Then
Console.Write(“WARNING: “)
Console.WriteLine(e.Message)
ElseIf e.Severity = XmlSeverityType.Error Then
Console.Write(“ERROR: “)
Console.WriteLine(e.Message)
End If
End Sub

..:: Whereever you go, stay in touch. Download toolbar now! It´s free, private and secure. ::..

Older entries »