Programming

Swift Detect Node Overlap

Detect if nodes overlap
if enemy.contains((car.position)) {
// code
}

Audio with Swift

Audio
Add audio delegate
Pasted Graphic 1
Create audioPlayer public variable
Pasted Graphic
Create music function
Pasted Graphic 2
To prevent below error on play, be sure Music0.m4a is added to Build Phases
Pasted Graphic 4
https://stackoverflow.com/questions/41775563/bundle-main-pathforresourceoftypeindirectory-returns-nil
Pasted Graphic 3

Swift Nil Check

Useful Nil Name Check

// verify name not nil
if ((node.name?.isEmpty) != nil) {
// exclude already clicked items
// only player circle
if node.name == "player" {
// change node position
node.position = location

//turn off player gravity field
let player = childNodeWithName("player") as! SKShapeNode
player.physicsBody?.dynamic = false
player.physicsBody!.fieldBitMask = PhysicsCategory.player
player.physicsBody?.dynamic = true
}
}

VB.net Images in SQL

Writing image to SQL, reading image from SQL
https://www.codeproject.com/Articles/437937/Save-and-Retrieve-Image-from-a-SQL-Server-Database

VB.net Stop String at Character

Stop String at Character
Dim timeStr = stringArr(arrIndex).IndexOf(" ")

WMI Command Prompts

WMI Command Prompts
https://msdn.microsoft.com/en-us/library/aa822854(v=vs.85).aspx
Enable:
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes
Disable:
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=no

VB.net Replace Character in String

Replace word or character in string
txt.Text = txt.Text.Replace("'", ControlChars.Quote)

VB.net Color DGV

When coloring DGV, header backcolor:
Pasted Graphic