Skip to main content
Home
Lepton
Little sharing more harvest

Main navigation

Show — Main navigation Hide — Main navigation
  • Home

bash 判断字符串

Submitted by lepton on Wed, 05/11/2016 - 16:24

Tags

  • bash

判断字符串是否为整数

[[ "${str}" =~ ^-?[[:digit:]]*$ ]]  //正则表达式 不能加引号

expr match "$str" "^-\?[0-9]*$"

判断字符串 包含 123

[[ "${str}" == *"123"* ]]

  • Read more about bash 判断字符串
  • Add new comment

osx获取 键盘 鼠标 输入

Submitted by lepton on Tue, 05/10/2016 - 17:49

Tags

  • osx
  • cocoa

获取osx下的键盘输入

NSKeyDown事件需要 申请权限

(System Preferences → Security & Privacy → Accessibility)

 

    NSDictionary *dict=@{(__bridge NSString *)kAXTrustedCheckOptionPrompt:@YES};
    BOOL istrue=AXIsProcessTrustedWithOptions((__bridge CFDictionaryRef)dict);
    NSLog(@"%d",istrue);

方法1 cocoa

  • Read more about osx获取 键盘 鼠标 输入
  • Add new comment

Pagination

  • First page « First
  • Previous page ‹ Previous
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Current page 6
Subscribe to

Recent content

  • mysql backup
    1 year 11 months ago
  • mysql upgrade data
    1 year 11 months ago
  • backup
    1 year 11 months ago
  • gentoo simple install
    2 years 7 months ago
  • ca sign cert
    2 years 7 months ago
  • time machine backup to samba
    2 years 8 months ago
  • expect auto input message for cmd
    2 years 8 months ago
  • Send input str direct to tty
    2 years 8 months ago
  • python http server support ipv6
    2 years 8 months ago
  • WireGuard connect
    2 years 9 months ago

Recent comments

  • Hot sexy porn projects,… 1 second ago
  • Daily updated super sexy… 10 seconds ago
  • Discriminating ptz.wvoo… 1 minute 27 seconds ago
  • Diet: vep.xjvf.leptonstar… 1 minute ago
  • Unfortunately wla.gdge… 1 minute 45 seconds ago
  • Also, gob.riec.leptonstar… 1 minute 51 seconds ago
  • drug markets onion bitcoin… 1 minute 54 seconds ago
  • deep web drug url darknet… 1 minute ago
  • Daily updated super sexy… 1 minute 55 seconds ago

Footer menu

Show — Footer menu Hide — Footer menu
  • Contact