PHP/Go do only once

    <?php
    
    //...
    private function ensureTransactionStarted()
    {
        if (!$this->transactionStarted) {
            $this->em->beginTransaction();
            $this->transactionStarted = true;
        }
    }
    //...

函数式编程

 public static void main(String[] args) {
        Function<String,String> f1=(str -> {
            return str+"!";
        });

        Function<String,String> f2=(str -> {
            return str+"$";
        });

        /*阅读方法: 先调用f2 再f1 最后,传入的参数是114
        114$!
        */
        String res1 = f1.compose(f2).apply("114");

        String res2 = f1.compose(f2).andThen(f2).apply("114");


        System.out.println(res2);
    }

install plugin for WordPress Developing on WP-CLI

$ wp plugin install debug-bar query-monitor log-deprecated-notices monster-widget developer theme-check --activate

Just for testing

package com.atguigu.composite;

import java.util.ArrayList;
import java.util.List;

public class College extends OrganizationComponent {

	//List 中 存放的Department
	List<OrganizationComponent> organizationComponents = new ArrayList<OrganizationComponent>();

	// 构造器
	public College(String name, String des) {
		super(name, des);
	}

	// 重写add
	@Override
	protected void add(OrganizationComponent organizationComponent) {
		organizationComponents.add(organizationComponent);
	}

	// 重写remove
	@Override
	protected void remove(OrganizationComponent organizationComponent) {
		organizationComponents.remove(organizationComponent);
	}

	@Override
	public String getName() {
		return super.getName();
	}

	@Override
	public String getDes() {
		return super.getDes();
	}

	// print方法,就是输出University 包含的学院
	@Override
	protected void print() {
		System.out.println("--------------" + getName() + "--------------");
		//遍历 organizationComponents 
		for (OrganizationCo

From https://www.cacher.io/

From https://www.cacher.io/
package com.atguigu.composite;

import java.util.ArrayList;
import java.util.List;

public class College extends OrganizationComponent {

	//List 中 存放的Department
	List<OrganizationComponent> organizationComponents = new ArrayList<OrganizationComponent>();

	// 构造器
	public College(String name, String des) {
		super(name, des);
	}

	// 重写add
	@Override
	protected void add(OrganizationComponent organizationComponent) {
		organizationComponents.add(organizationComponent);
	}

	// 重写remove
	@Override
	protected void remove(OrganizationComponent organizationComponent) {
		organizationComponents.remove(organizationComponent);
	}

	@Override
	public String getName() {
		return super.getName();
	}

	@Override
	public String getDes() {
		return super.getDes();
	}

	// print方法,就是输出University 包含的学院
	@Override
	protected void print() {
		System.out.println("--------------" + getName() + "--------------");
		//遍历 organizationComponents 
		for (OrganizationComponent organizationComponent : organizati

Socket IO

## Socket.io

**Server Setup on Node.js**

 ```js
 const express = require ('express')
 const app = express()
 const socket = require('socket.io')
 
 const server = app.listen(69, () => console.log('Connected!')) // callback function is optional
 
 const io = socket(server) // its called "io" just for convention, you can call it anything
 
 
 ```

From https://www.baidu.com/?tn=59046333_dg

From https://www.baidu.com/?tn=59046333_dg
package com.atguigu.composite;

import java.util.ArrayList;
import java.util.List;

public class College extends OrganizationComponent {

	//List 中 存放的Department
	List<OrganizationComponent> organizationComponents = new ArrayList<OrganizationComponent>();

	// 构造器
	public College(String name, String des) {
		super(name, des);
	}

	// 重写add
	@Override
	protected void add(OrganizationComponent organizationComponent) {
		organizationComponents.add(organizationComponent);
	}

	// 重写remove
	@Override
	protected void remove(OrganizationComponent organizationComponent) {
		organizationComponents.remove(organizationComponent);
	}

	@Override
	public String getName() {
		return super.getName();
	}

	@Override
	public String getDes() {
		return super.getDes();
	}

	// print方法,就是输出University 包含的学院
	@Override
	protected void print() {
		System.out.println("--------------" + getName() + "--------------");
		//遍历 organizationComponents 
		for (OrganizationComponent organizationComponent : organizati

From https://www.baidu.com/?tn=59046333_dg

From https://www.baidu.com/?tn=59046333_dg
package com.atguigu.composite;

import java.util.ArrayList;
import java.util.List;

public class College extends OrganizationComponent {

	//List 中 存放的Department
	List<OrganizationComponent> organizationComponents = new ArrayList<OrganizationComponent>();

	// 构造器
	public College(String name, String des) {
		super(name, des);
	}

	// 重写add
	@Override
	protected void add(OrganizationComponent organizationComponent) {
		organizationComponents.add(organizationComponent);
	}

	// 重写remove
	@Override
	protected void remove(OrganizationComponent organizationComponent) {
		organizationComponents.remove(organizationComponent);
	}

	@Override
	public String getName() {
		return super.getName();
	}

	@Override
	public String getDes() {
		return super.getDes();
	}

	// print方法,就是输出University 包含的学院
	@Override
	protected void print() {
		System.out.println("--------------" + getName() + "--------------");
		//遍历 organizationComponents 
		for (OrganizationComponent organizationComponent : organizati

set path for angular cli

1. Right Clicked on My Computer (windows)
2. Selected Advanced System Settings
3. Clicked "Environment Variables"
4. Under "Path" variable, made the FIRST value listed %AppData%\npm

Prevent video play() interruption

// Initializing values
var isPlaying = true;

// On video playing toggle values
video.onplaying = function() {
    isPlaying = true;
};

// On video pause toggle values
video.onpause = function() {
    isPlaying = false;
};

// Play video function
function playVid() {      
    if (video.paused && !isPlaying) {
        video.play();
    }
} 

// Pause video function
function pauseVid() {     
    if (!video.paused && isPlaying) {
        video.pause();
    }
}

css combinators

https://www.w3schools.com/css/css_combinators.asp

esconde o campo Descrição da página de edição da taxonomia

function wpse_hide_cat_descr() { 
  if ( 'serie' == $_GET['taxonomy'] ) {
    echo '<style type="text/css">
      .term-description-wrap {
        display: none;
      }
    </style>';
  }
}  
add_action( 'admin_head-term.php', 'wpse_hide_cat_descr' );
add_action( 'admin_head-edit-tags.php', 'wpse_hide_cat_descr' );

Trackers torrent

https://github.com/ngosang/trackerslist

udp://tracker.coppersurfer.tk:6969/announce

udp://tracker.open-internet.nl:6969/announce

udp://tracker.leechers-paradise.org:6969/announce

udp://exodus.desync.com:6969/announce

udp://9.rarbg.to:2710/announce

udp://9.rarbg.me:2710/announce

udp://tracker.internetwarriors.net:1337/announce

http://tracker.internetwarriors.net:1337/announce

udp://tracker.opentrackr.org:1337/announce

http://tracker.opentrackr.org:1337/announce

http://tracker3.itzmx.com:6961/announce

http://tracker1.itzmx.com:8080/announce

udp://open.demonii.si:1337/announce

udp://tracker.torrent.eu.org:451/announce

udp://thetracker.org:80/announce

udp://denis.stalker.upeer.me:6969/announce

udp://bt.xxx-tracker.com:2710/announce

udp://tracker.tiny-vps.com:6969/announce

udp://tracker.cyberia.is:6969/announce

udp://explodie.org:6969/announce

http://explodie.org:6969/announce

udp://ipv4.tracker.harry.lu:80/announce

http://open.acgnxtracker.com:80/announce

udp://trac

17 Dec, 2019 -- Header Component

Free HTML5 and CSS3 Course
<html>
  
  <head>
    
  </head>  
  
  <body>
    
  </body>
</html>

Yocto - GUI Bitbake

# UI for Yocto

https://old.yoctoproject.org/tools-resources/projects/toaster

The community used to use `hob` to see the dependencies and work on 
a project useing a user interface. Now we use `toaster` which is a 
`django` web page.

close drawer

// make back button close navigation drawer
    @Override
    public void onBackPressed() {
        if (flowingDrawer.isLaidOut()) {
            flowingDrawer.closeMenu();
        } else {
            super.onBackPressed();
        }
    }