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 week ago
  • mysql upgrade data
    1 week 5 days ago
  • backup
    1 week ago
  • gentoo simple install
    8 months 2 weeks ago
  • ca sign cert
    8 months 3 weeks ago
  • time machine backup to samba
    9 months ago
  • expect auto input message for cmd
    9 months 1 week ago
  • Send input str direct to tty
    9 months 1 week ago
  • python http server support ipv6
    9 months 2 weeks ago
  • WireGuard connect
    10 months 3 weeks ago

Recent comments

  • female viagra nz 1 minute 1 second ago
  • avana 164 1 minute 47 seconds ago
  • Otherwise, thu.xzvm… 2 minutes 22 seconds ago
  • best price cialis 20 mg 2 minutes 45 seconds ago
  • The gsh.ibjf.leptonstar.com… 2 minutes 50 seconds ago
  • cymbalta vs lyriaa
    cymbalta…
    3 minutes 27 seconds ago

Footer menu

Show — Footer menu Hide — Footer menu
  • Contact