This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from aioconsole import ainput | |
from viam.components.base import Base | |
from viam.logging import DEBUG | |
from viam.proto.common import Vector3 | |
from viam.robot.client import RobotClient | |
from viam.rpc.dial import Credentials, DialOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ag -l make_option | while read -r FILE; do cat $FILE | sed -i -e '/option_list/d' -e '/import make_option/d' -e 's/ make_option/parser.add_argument/g' -e 's/),\s*$/)/g' -e '0,/^\s*)\(,\|\)\s*$/{/^\s*)\(,\|\)\s*$/d}' -e '/args = "/d' $FILE; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
from __future__ import division | |
from argparse import ArgumentParser, Action | |
from os.path import splitext | |
from itertools import izip_longest | |
class FileSplitter(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function ConcatRangeIf(Rc As Range, Criterion As String, Rv As Range, Optional Delimiter As String) | |
' Concatenate cells into a single string specified by a given criteria or condition | |
Dim C As Collection: Set C = New Collection ' Collection of values to be included in final string | |
Dim Ac() As Variant: Ac = Rc ' Criterias | |
Dim Av() As Variant: Av = Rv ' Values | |
Dim i As Long | |
Dim j As Long | |
For i = LBound(Ac, 1) To UBound(Ac, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function CollectionToArray(C As Collection, Optional StartIdx As Long, Optional Size As Long) As Variant | |
' Convert a collection into an array | |
Dim A() As Variant | |
Dim Ci As Variant ' Collection element | |
Dim i As Long | |
' Make sure Size is not less than collection size | |
If Size < C.Count Then Size = C.Count | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Map(F As String, ByVal A As Variant) As Variant | |
' Map function F across 1-Dimensional Array | |
Dim i As Long | |
For i = LBound(A) To UBound(A) | |
A(i) = Application.Run(F, A(i)) | |
Next i | |
Map = A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function CollectionToString(C As Collection, Optional Delimiter As String, Optional TrailingDelimiter As Boolean) As String | |
' Join a collection into a single string | |
' OPTIONAL: choose delimiter and specify whether to include a trailing delimiter (e.g. "a;b;c" vs "a;b;c;", where ";" is the delimiter) | |
' Transfer collection to array | |
CollectionToString = Join(CollectionToArray(C, 0, C.Count + IIf(TrailingDelimiter, 1, 0)), Delimiter) ' See Referenced Gists below | |
End Function | |
Function CollectionToArray(C As Collection, Optional StartIdx As Long, Optional Size As Long) As Variant |