Skip to content

ats-min.com

Daily memo what I learned

  • python
  • Django
  • CheckIO
  • JavaScript
  • Web Service
  • Linux
  • Else
    • Network
    • git
    • Salesforce
    • VBScript

Python: Multiple Assignment by Generator Comprehensions

Generator comprehensions return generator in single assignment variable, but in multiple assignment it doesn’t return generators. # generator comprehension gen = ((x for x in [1, 2, 3])) gen >><generator object <genexpr> at 0x7f92b4e33500> # returns not generator but each…

atsmin2015年3月30日2015年3月30日 python No Comments
Python: Multiple Assignment by Generator ComprehensionsRead more

Python: List Comprehensions are better

Using List Comprehensions, we don’t have to write ‘lamda’ expressions to map or filter values and the code is simpler. dct_lst = [{‘key1’: 1, ‘key2’: 2}, {‘key1’: 2, ‘key2’: 3}] # using list comprehension result = [x[‘key2’] * 10 for x…

atsmin2015年3月29日2015年3月29日 python No Comments
Python: List Comprehensions are betterRead more

Linux: Check process restarted

To check whether a process was restarted, look ‘/var/run/{process name}.pid’ file’s timestamp. # before % ll /var/run/apache2/apache2.pid -rw-r–r– 1 root root 5 March 22 11:10 /var/run/apache2/apache2.pid # restart % sudo service apache2 restart * Restarting web server apache2 # the…

atsmin2015年3月22日2015年3月22日 Linux No Comments
Linux: Check process restartedRead more

Linux: grep \ or $

$ cat file aaa bbb\ccc bbb$ccc $ grep \\\\ file bbb\ccc $ grep ‘\\’ file bbb\ccc $ grep \\$ file bbb$ccc $ grep ‘\$’ file bbb$ccc

atsmin2015年3月5日2015年3月6日 Linux No Comments
Linux: grep \ or $Read more

Recent Posts

  • Powershell : JSON as commandline args
  • libvirt : firewall blocks forwarding
  • LXC : login failed
  • Xen : Nested VM
  • Raspberry Pi : Create SWAP volume on LVM

Recent Comments

    Archives

    • December 2021
    • September 2021
    • May 2021
    • September 2019
    • January 2019
    • February 2018
    • October 2017
    • July 2017
    • May 2017
    • April 2017
    • January 2017
    • December 2016
    • November 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • November 2014
    • October 2014
    • September 2014
    • July 2014
    • June 2014
    • May 2014

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    Copyright © 2023 ats-min.com. Theme by Colorlib Powered by WordPress