Search This Blog

Thursday, June 18, 2020

Blender - delete dissolve difference

  • Delete: removes vertices/edges/faces and leaves nothing/a hole in their place.

  • Dissolve: combines faces into one big face (ngon) or removes edges only as a separator between faces.

  • Limited dissolve: dissolves (combines into big NGons) all faces that have a certain angle between them (less than 5° by default).

Friday, July 5, 2019

MongoDB - Pipelines

[
  {
    '$addFields': {
      'Month': {
        '$month': {
          '$dateFromString': {
            'dateString': '$job.ActionDateTime',
            'format': '%d/%m/%Y %H.%M.%S'
          }
        }
      },
      'Year': {
        '$year': {
          '$dateFromString': {
            'dateString': '$job.ActionDateTime',
            'format': '%d/%m/%Y %H.%M.%S'
          }
        }
      },
      'MonthYear': {
        '$dateToString': {
          'format': '%m:%Y',
          'date': {
            '$dateFromString': {
              'dateString': '$job.ActionDateTime',
              'format': '%d/%m/%Y %H.%M.%S'
            }
          }
        }
      }
    }
  }, {
    '$facet': {
      'Totals': [
        {
          '$group': {
            '_id': null,
            'averageRain': {
              '$sum': 1
            },
            'maxRain': {
              '$max': '$Rainfall'
            },
            'totalRain': {
              '$sum': '$Rainfall'
            }
          }
        }
      ],
      'Monthly': [
        {
          '$group': {
            '_id': '$Month',
            'averageRain': {
              '$sum': 1
            },
            'Rainfall': {
              '$sum': '$Rainfall'
            },
            'maxRain': {
              '$max': '$Rainfall'
            }
          }
        }, {
          '$sort': {
            '_id': 1
          }
        }
      ]
    }
  }
]

Tuesday, May 24, 2016

Linux: copy multiple files without asking overwrite confirmation

Linux: copy multiple files without asking overwrite confirmation

To always overwrite without prompt use a backslash:
$ \cp *.jpg ../

Linux: how to rename multiple files at once

Linux: how to rename multiple files at once

Very easy:

rename from to files...
rename JPG jpg *.JPG

Tuesday, September 2, 2014

Fix Retina MacBook poor battery life

The first of these, is to clear the PRAM and NVRAM settings. This seems to be a favorite of Apple support staff, as I recall being told to try this on a couple of pre-MacBook era machines for various things. To do it is really simple:
  • First, power off your MacBook Pro
  • Then, when you power up, hold down the cmd+option+P+R keys all at the same time
  • When you see it cycle round and you hear the startup sound again, let go and let your MacBook Pro boot up as normal.

This on its own may resolve the problem. The other method that runs in conjunction with this involves a little terminal:
  • Open up Terminal on your MacBook Pro
  • Type in cd ~/Library/Preferences/ then press enter
  • Then type rm com.apple.desktop.plist and press enter
  • Finally, type killall Dock and hit enter again

This command will delete the settings file listed in the second line, and restart your dock so you're not running with any faulty preferences anymore. It also seems to set your wallpaper back to the stock, Mountain Lion wallpaper, so that may be a good sign that you did everything right.

Source

Wednesday, August 27, 2014

Show hidden files in OSX Finder utility

You can use a Terminal command to reveal the hidden files in OS X by making a change to the default behavior of Finder.

defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder

reference: