JFLHV
Copy files to private space Google Pixel
updated
0:00 Demo
0:50 File Structure
2:19 Automation Code
3:45 Program Structure
0:00 InputSender
0:13 Type characters
1:48 Navigation keys
2:35 Extended keys
InputSender Download:
codeproject.com/Articles/5264831/How-to-Send-Inputs-using-Csharp
private void PressCombo(ushort code1, ushort code2)
{
InputSender.SendKeyboardInput(new InputSender.KeyboardInput[]
{
new InputSender.KeyboardInput
{
wScan = code1,
dwFlags = (uint)(InputSender.KeyEventF.KeyDown | InputSender.KeyEventF.Scancode)
},
new InputSender.KeyboardInput
{
wScan = code2,
dwFlags = (uint)(InputSender.KeyEventF.KeyDown | InputSender.KeyEventF.Scancode)
}
});
}
InputSender Download:
codeproject.com/Articles/5264831/How-to-Send-Inputs-using-Csharp
private void LeftDrag(Point start, Point end)
{
InputSender.SetCursorPosition(start.X, start.Y);
InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftDown
}
});
Thread.Sleep(100);
InputSender.SetCursorPosition(end.X, end.Y);
InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftUp
}
});
}
InputSender Download:
codeproject.com/Articles/5264831/How-to-Send-Inputs-using-Csharp
private void LeftClick(int x, int y)
{
InputSender.SetCursorPosition(x, y);
InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftDown
}
});
Thread.Sleep(100);
InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftUp
}
});
}
Public Declare Auto Function HideCaret Lib "user32" (ByVal hWnd As IntPtr) As Boolean
Win32
-------------------
Private Declare Function GetForegroundWindow Lib "user32" () As IntPtr
Private Declare Auto Function GetWindowText Lib "user32" (ByVal hWnd As System.IntPtr, ByVal lpString As System.Text.StringBuilder,
ByVal cch As Integer) As Integer
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As UInteger, ByVal dx As UInteger, ByVal dy As UInteger, ByVal dwData As UInteger,
ByVal dwExtraInfo As Integer)
Const MOUSEEVENTF_LEFTDOWN As UInteger = &H2
Const MOUSEEVENTF_LEFTUP As UInteger = &H4
Const MOUSEEVENTF_RIGHTDOWN As UInteger = &H8
Const MOUSEEVENTF_RIGHTUP As UInteger = &H10
Regex function
--------------------------
Regex.Replace(str, "[+^%~(){}]", "{$0}")
Sendkeys Codes
---------------------------
docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys
0:00 Summary of automation tasks
0:20 Wait for active window
1:22 Sendkeys functions
2:45 Mouseclicks
3:32 Demo UI to run scripts
These games were being installed by the phone company through the Mobile Services Manager system app which had to be disabled
Windows 10
.NET Framework 4.6.1
Windows Forms
'Here is code that sets the days for a 6x7 calendar grid. It does not account for exceptions if trying to subtract from the minimum year and month
Private Sub SetDays()
Dim firstDayofMonth As DateTime
Dim column As Integer
Dim firstDayofGrid As DateTime
Dim gridDate As DateTime
firstDayofMonth = New Date(_Year, _Month, 1)
column = CInt(firstDayofMonth.DayOfWeek)
firstDayofGrid = firstDayofMonth.AddDays(column * -1)
gridDate = firstDayofGrid
For rowIndex = 0 To 5
For colIndex = 0 To 6
_Days(rowIndex, colIndex) = gridDate
gridDate = gridDate.AddDays(1)
Next
Next
Return
End Sub
'Here is the code I used to populate all the days of the month
Private Sub PopulateCalendar()
Dim lbl As Control
Dim lblName As String
lbl = MonthYearContainer.Controls.Find("LblMonthYear", False).First
lbl.Text = String.Format("{0} {1}", MonthName(_CalendarInfo.Month), _CalendarInfo.Year)
For rowIndex = 0 To 5
For colIndex = 0 To 6
lblName = String.Format("LblDayOfMonth{0}{1}", rowIndex, colIndex)
lbl = Me.Controls.Find(lblName, True).First
lbl.Text = _CalendarInfo.DayInMonth(rowIndex, colIndex)
If _CalendarInfo.IsActiveMonth(rowIndex, colIndex) Then
lbl.ForeColor = Color.Black
Else
lbl.ForeColor = Color.Gray
End If
If _CalendarInfo.IsToday(rowIndex, colIndex) Then
lbl.ForeColor = Color.Red
End If
Next
Next
End Sub
Dim months As New List(Of String)
Dim lowTemps As New List(Of Integer)
Dim highTemps As New List(Of Integer)
months.AddRange(New String() {"Jan", "Feb", "Mar", "Apr"})
lowTemps.AddRange(New Integer() {37, 41, 49, 56})
highTemps.AddRange(New Integer() {56, 61, 69, 77})
Chart1.Titles.Add("Monthly Average Temperature")
Chart1.Series.Clear()
Chart1.Series.Add("Low")
For i = 0 To months.Count - 1
Chart1.Series("Low").Points.AddXY(months(i), lowTemps(i))
Next
Chart1.Series.Add("High")
For i = 0 To months.Count - 1
Chart1.Series("High").Points.AddXY(months(i), highTemps(i))
Next
----------------------------------------------------------
Dim temps As New List(Of AverageTemperature)
temps.Add(New AverageTemperature("Jan", 22, 37))
temps.Add(New AverageTemperature("Feb", 24, 39))
temps.Add(New AverageTemperature("Mar", 31, 46))
temps.Add(New AverageTemperature("Apr", 41, 57))
Chart1.DataSource = temps
Chart1.Titles.Add("Monthly Average Temperature")
Chart1.Series(0).Name = "Low"
Chart1.Series(0).XValueMember = "Month"
Chart1.Series(0).YValueMembers = "LowTemp"
Chart1.Series.Add("High")
Chart1.Series(1).XValueMember = "Month"
Chart1.Series(1).YValueMembers = "HighTemp"
-------------------------------------------------
Public Class AverageTemperature
Public _month As String
Public _lowTemp As Integer
Public _highTemp As Integer
Public Sub New(m As String, low As Integer, high As Integer)
_month = m
_lowTemp = low
_highTemp = high
End Sub
Public Property Month As String
Get
Return _month
End Get
Set(value As String)
_month = value
End Set
End Property
Public Property LowTemp As Integer
Get
Return _lowTemp
End Get
Set(value As Integer)
_lowTemp = value
End Set
End Property
Public Property HighTemp As Integer
Get
Return _highTemp
End Get
Set(value As Integer)
_highTemp = value
End Set
End Property
End Class
Also helps avoid these issues
- Verifying data storage components are installed
- Getting tableadapter to display in the toolbox
- Build error when project name is the same as a file name.
Helpful tips shown:
1. Keep old versions of modified and deleted files.
2. Format a path with spaces
3. Use the modify-window option to stop unchanged files from being copied every run
Here is the command:
rsync -abv --modify-window=2 --backup-dir="/Users/User1/Desktop/History/ $(date +\%Y\%m\%d_\%H\%M\%S)" --delete /Users/user1/Desktop/Src\ Files/ /Volumes/KINGSTON/Dest/
Make sure the quotes around the backup directory are vertical. Slanted quotations failed to run for me
Applying the effect in iMovie: 0:04
Creating the images in Keynote: 2:46
Filter to bring out detail of text: 3:37
RemoveAll inline simple
fIlteredWords.RemoveAll (Function(str) str.Contains(filter)=False)
RemoveAll AddressOf existing function
fIlteredWords.RemoveAll (AddressOf ContainsVowel)
RemoveAll inline existing function 2 parameters
filteredWords.RemoveAll (Function(str) ContainsAllChars(str, filter)=False)
Public Function ContainsVowel(ByVal str As String)
Dim vowels As Char() = {"a", "e", "i", "o", "u"}
For Each c As Char In str
If vowels.Contains(c) Then
Return True
End If
Next
Return False
End Function
Public Function ContainsAllChars(ByVal str As String, ByVal chars As String)
For Each c As Char In chars
If str.Contains(c) = False Then
Return False
End If
Next
Return True
End Function
Android version 10.
Enabling music controls on the lock screen does require additional swipe up to unlock phone after face unlock.
Works for music apps I use:
+ Google Play Music
+ Pandora
+ YouTube Music (Device Files)
www.any-video-converter.com
5 second pause at 0:00
#tips
1. Hold the command key when dragging items to prevent snapping to yellow guidelines
2. Hold the shift key when dragging items to only move horizontally or vertically
3. Left and right arrow keys move the video back or forward one frame
4. Keyframe at full screen for better accuracy dragging items
Circle
Ellipse
Hexagon
Octagon
Pentagon
Rectangle
Rhombus
Square
Trapezoid
Triangle
- Office 2016 Professional
- Windows 10
Visual Studio Community 2017
.NET Framework 4.6.1
Windows 10
Code below.
'Angled brackets not allowed so replace "GREATER_THAN'
'Calculate age from birthdate
Private Function Age(ByVal birthdate As DateTime) As String
Dim ageDays As Integer
Dim ageMonths As Integer
Dim ageYears As Integer
ageDays = DateDiff("d", birthdate, Now)
ageMonths = DateDiff("m", birthdate, Now)
'Reduce month by 1 if birthdate day not yet reached
If birthdate.Day GREATER_THAN Now.Day Then
ageMonths = ageMonths - 1
End If
'Calculate years (Do not round value up)
ageYears = Math.Truncate(ageMonths / 12) 'can use \ operater as well
If ageYears GREATER_THAN 0 Then
Return ageYears.ToString + Plural(ageYears, " Year")
ElseIf ageMonths GREATER_THAN 0 Then
Return ageMonths.ToString + Plural(ageMonths, " Month")
Else
Return ageDays.ToString + Plural(ageDays, " Day")
End If
End Function
'Return plural form of text if value not = 1
Private Function Plural(value As Integer, text As String)
If Math.Abs(value) = 1 Then
Return text
Else
Return text + "s"
End If
End Function
iMovie version 10.1.12
Visual Studio Community 2017
.NET Framework 4.6.1
Windows 10
Partial Code:
---------------------
'Indicates current contact panel to add controls to
Private _CurrentContactPanelName As String = Nothing
'Used to give unique control names such as label1, label2 etc
Private _ContactPanelsAddedCount As Integer = 0
'Add contact panel to flow layout panel
Public Sub CreateContactPanel()
Dim contactPanel As Panel
contactPanel = New Panel()
'Set panel properties
With contactPanel
.BackColor = Color.White
.Size = New Size(420, 50)
.Name = "pnlContact" + (_ContactPanelsAddedCount + 1).ToString
End With
'Add panel to flow layout panel
flpMain.Controls.Add(contactPanel)
'Update panel variables
_CurrentContactPanelName = contactPanel.Name
_ContactPanelsAddedCount += 1
End Sub
'Add new delete button to contact panel
Private Sub CreateContactDeleteBtn(ByVal panelName As String)
Dim contactDeleteButton As Button
contactDeleteButton = New Button
'Set button properties
With contactDeleteButton
.AutoSize = False
.Size = New Size(90, 30)
.BackColor = Color.Silver
.ForeColor = Color.Black
.Location = New Point(300, 10)
.Name = "btnContactDelete" + (_ContactPanelsAddedCount).ToString
.Text = "Delete"
End With
'Add button to panel
For Each controlObject As Control In flpMain.Controls
If controlObject.Name = panelName Then
controlObject.Controls.Add(contactDeleteButton)
End If
Next
'Add handler for click events
AddHandler contactDeleteButton.Click, AddressOf DynamicButton_Click
End Sub
'Remove handlers and contact panel
Public Sub DynamicButton_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim parentPanelName As String
parentPanelName = Nothing
'Remove handler from sender
For Each controlObj As Control In flpMain.Controls
For Each childControlObj As Control In controlObj.Controls
If childControlObj.Name = sender.name Then
RemoveHandler childControlObj.Click, AddressOf DynamicButton_Click
parentPanelName = childControlObj.Parent.Name
End If
Next
Next
'Remove contact panel
For Each controlObj As Control In flpMain.Controls
If controlObj.Name = parentPanelName Then
flpMain.Controls.Remove(controlObj)
controlObj.Dispose()
End If
Next
End Sub
Const MOUSEEVENTF_LEFTDOWN As UInteger = &H2
Const MOUSEEVENTF_LEFTUP As UInteger = &H4
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As UInteger, ByVal dx As UInteger, ByVal dy As UInteger, ByVal dwData As UInteger, ByVal dwExtraInfo As Integer)
Public Sub LeftClick()
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
Thread.Sleep(100) 'Wait required
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
Tip 1: The default password (serial number) can be changed in the network tool. Other series may have a default password of canon
Tip 2: The serial number was 9 characters
Tip 3: The USB connected printer may show as a duplicate printer even after it's disconnected so restart or delete printer to avoid trying to print to the incorrect printer.
Read from specified path and save to current directory
dir /s /b “C:\Program Files” greaterthanarrow filename.txt
Save to specified path.
dir /s /b “C:\Program Files” greaterthanarrow “E:\My Info\filename.txt”
Read from current directory
dir /s greaterthanarrow filename.txt
Show summary and header info
dir /s “C:\Program Files” greaterthanarrow filename.txt
Show only files using the attribute option /a
dir /s /b /a:-d “C:\Program Files” greaterthanarrow filename.txt
.Net Framework 4.6.1
Windows Forms App
Visual Studio Community
Windows 10
----------------------
Imports Microsoft.Win32
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AddHandler SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged
End Sub
Private Sub SystemEvents_PowerModeChanged(ByVal sender As Object, ByVal e As PowerModeChangedEventArgs)
Select Case e.Mode
Case PowerModes.Suspend
txtSuspend.Text = Now
Case PowerModes.Resume
txtResume.Text = Now
End Select
End Sub
End Class
Google Drawings link to create simple graphics:
http://docs.google.com/drawings
- HH:MM:SS format
- Black background
- White font
- Font type: AvantGarde BK BT
Code:
------------------------
Public Class ListViewItemComparer
Implements IComparer
Private col As Integer
Private order As SortOrder
Public Sub New()
col = 0
order = SortOrder.Ascending
End Sub
Public Sub New(column As Integer, order As SortOrder)
col = column
Me.order = order
End Sub
Public Function Compare(x As Object, y As Object) As Integer Implements System.Collections.IComparer.Compare
Dim returnVal As Integer
Try
' Attempt to parse the two objects as DateTime
Dim firstDate As System.DateTime = DateTime.Parse(CType(x, ListViewItem).SubItems(col).Text)
Dim secondDate As System.DateTime = DateTime.Parse(CType(y, ListViewItem).SubItems(col).Text)
' Compare as date
returnVal = DateTime.Compare(firstDate, secondDate)
Catch ex As Exception
' If date parse failed then fall here to determine if objects are numeric
If IsNumeric(CType(x, ListViewItem).SubItems(col).Text) And
IsNumeric(CType(y, ListViewItem).SubItems(col).Text) Then
' Compare as numeric
returnVal = Val(CType(x, ListViewItem).SubItems(col).Text).CompareTo( _
Val(CType(y, ListViewItem).SubItems(col).Text))
Else
' If not numeric then compare as string
returnVal = [String].Compare(CType(x, _
ListViewItem).SubItems(col).Text, CType(y, ListViewItem).SubItems(col).Text)
End If
End Try
' If order is descending then invert value
If order = SortOrder.Descending Then
returnVal *= -1
End If
Return returnVal
End Function
End Class
' Value to track which column was previously sorted
Dim sortColumn as Integer = -1
Private Sub Listview1_ColumnClick(sender As Object, e As System.Windows.Forms.ColumnClickEventArgs) Handles Listview1.ColumnClick
' If current column is not the previously clicked column
' Add
If Not e.Column = sortColumn Then
' Set the sort column to the new column
sortColumn = e.Column
'Default to ascending sort order
Listview1.Sorting = SortOrder.Ascending
Else
'Flip the sort order
If Listview1.Sorting = SortOrder.Ascending Then
Listview1.Sorting = SortOrder.Descending
Else
Listview1.Sorting = SortOrder.Ascending
End If
End If
'Set the ListviewItemSorter property to a new ListviewItemComparer object
Me.Listview1.ListViewItemSorter = New ListViewItemComparer(e.Column, Listview1.Sorting)
' Call the sort method to manually sort
Listview1.Sort()
End Sub
End Class


