expression, e, print, p, po
(lldb) print ... = (lldb) p ... = (lldb) expression -- ... = (lldb) e -- ...
Evaluate an expression on the current thread. Display any returned value with LLDB defalt formating.
- Usage
- (lldb) e
- (lldb) expression
extension UIImage{ | |
func merge(mergewith: UIImage) -> UIImage { | |
UIGraphicsBeginImageContextWithOptions(size, false, 0.0) | |
let actualArea = CGRect(x: 0, y: 0, width: size.width, height: size.height) | |
let ratioMerge: Double = Double(mergewith.size.height / mergewith.size.width) | |
let widthMerge = size.height / ratioMerge | |
let mergeX = (size.width / 2) - (widthMerge / 2) |
function banarySearch(key, arr, min, max, callBack) { | |
if (min >= max) { | |
return undefined; | |
} | |
const midIndex = parseInt(min + (max - min) / 2, 0.0); | |
const result = callBack(arr[midIndex]); | |
if (result > key) { | |
return banarySearch(key, arr, min, midIndex, callBack); | |
} else if (result < key) { |
// recursive | |
func binarySearch<T>(key: Int, arr: [T], range: Range<Int>? = nil, _ callBack: (T) -> Int) -> Int? { | |
var rangeDefault: Range<Int> | |
if let r = range { | |
rangeDefault = r | |
} else { | |
rangeDefault = 0..<arr.count | |
} | |
if rangeDefault.lowerBound >= rangeDefault.upperBound { | |
return nil |
(from : https://simplifiedthinking.co.uk/2015/10/03/install-mqtt-server/ ) | |
Installing Brew | |
The Mosquitto MQTT Server can be easily installed using Homebrew. If it’s not installed on your system already, then a quick visit to the homepage will give you all you need to get going. Homebrew is an OS X Package Manager for installing and updating non-Mac OS X utilities that are more commonly found in other variants of Linux. To install the basic package manager run the following command. | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
Installing Mosquitto MQTT |
package main | |
import "encoding/json" | |
import "fmt" | |
type Person struct { | |
Name string `json:"name"` |
# when you try to start docker | |
# sudo systemctl start docker | |
# and the output is: Failed to start docker.service: Unit docker.service is masked. | |
# | |
# | |
# ls -la /etc/systemd/system | grep docker | |
# see for /dev/null if there is | |
systemctl unmask docker.service | |
systemctl unmask docker.socket | |
systemctl start docker.service |
# when you try to start docker | |
# sudo systemctl start docker | |
# and the output is: Failed to start docker.service: Unit docker.service is masked. | |
# | |
# | |
# ls -la /etc/systemd/system | grep docker | |
# see for /dev/null if there is | |
systemctl unmask docker.service | |
systemctl unmask docker.socket | |
systemctl start docker.service |
/** | |
* Definition for singly-linked list. | |
* type ListNode struct { | |
* Val int | |
* Next *ListNode | |
* } | |
*/ | |
func mergeTwoLists(list1 *ListNode, list2 *ListNode) *ListNode { | |
var dummy = new(ListNode) | |
var p = dummy |
docker logs --since=2022-07-05T17:30:00Z help-check-bot-cn |