MySQL – mysqldump

  1. Dump the whole database:
mysqldump -u username -ppassword database_name  > the_whole_database_dump.sql

2. Dump a single table:

mysqldump -u username -ppassword database_name table_name > single_table_dump.sql

3. Dump only rows that meet a specific criteria, you can add ‘where’ option to your mysqldump command:

mysqldump -u username -ppassword database_name table_name --where="date_created='2013-06-25'" > few_rows_dump.sql

Unity – Get Targets in Range

public float           MaxAimRange = 10f;
public List<Transform> targets;
public Vector2 targetingSensorPosition;


// Start is called before the first frame update
void Start() {
  targetingSensorPosition = GetComponent<Transform>().position;
}


private void GetTargetsInRange() {
  var myContactFilter   = new ContactFilter2D();
  var collidersInCircle = new List<Collider2D>();
  var numFound          = Physics2D.OverlapCircle(
                                   targetingSensorPosition,
                                   MaxAimRange, 
                                   myContactFilter,
                                   collidersInCircle);

  Debug.Log("count of colliders: " + collidersInCircle.Count);
  Debug.Log("numFound: " + numFound);

C# Unity Coroutine

using UnityEngine;
using System.Collections;

// In this example we show how to invoke a coroutine and
// continue executing the function in parallel.

public class ExampleClass : MonoBehaviour
{
    // In this example we show how to invoke a coroutine and
    // continue executing the function in parallel.

    private IEnumerator coroutine;

    void Start()
    {
        // - After 0 seconds, prints "Starting 0.0"
        // - After 0 seconds, prints "Before WaitAndPrint Finishes 0.0"
        // - After 2 seconds, prints "WaitAndPrint 2.0"
        print("Starting " + Time.time);

        // Start function WaitAndPrint as a coroutine.

        coroutine = WaitAndPrint(2.0f);
        StartCoroutine(coroutine);

        print("Before WaitAndPrint Finishes " + Time.time);
    }

    // every 2 seconds perform the print()
    private IEnumerator WaitAndPrint(float waitTime)
    {
        while (true)
        {
            yield return new WaitForSeconds(waitTime);
            print("WaitAndPrint " + Time.time);
        }
    }
}