Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
| --[[ | |
| MakeSwizzle | |
| Add swizzling functionality to a metatable! | |
| @param MOriginal - Original metatable to add swizzling to. | |
| @param keys - Ordered array of key names we want to swizzle on. | |
| @param components - Ordered array of characters to associate with the key names from the keys array. | |
| @param defaults - Optional list of default values to be used when t[GetComponent(c)] == nil. | |
| @param constructor - When swizzling on valid keys, a list of associated values preceded by the custom swizzle metatable is passed to the constructor (in keys) from the __index metamethod, that is, constructor(MSwizzle, ...). The result of this function is returned by the __index metamethod. | |
| @return MOriginal - The original metatable (which has been modified). | |
| @return GetKey(i) - A function that returns the key name at index i from the keys parameter. |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
| wl(){ | |
| local ssid | |
| local conn | |
| nmcli device wifi rescan > /dev/null | |
| ssid=$(nmcli device wifi list | tail -n +2 | grep -v '^ *\B--\B' | fzf -m | sed 's/^ *\*//' | awk '{print $1}') | |
| if [ "x$ssid" != "x" ]; then | |
| # check if the SSID has already a connection setup | |
| conn=$(nmcli con | grep "$ssid" | awk '{print $1}' | uniq) |
Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.
First, a little aside on the details of Rust's module system, and specifically paths; it is
| math.randomseed(os.time()) | |
| minetest.register_chatcommand("mobtest",{ | |
| description="Spawns all available mobs", | |
| privs={server=true}, | |
| func=function(n,param) | |
| local p=minetest.get_player_by_name(n) | |
| local pos=p:get_pos() | |
| for k,v in pairs(minetest.registered_entities) do | |
| if v.horny ~= nil then | |
| local spos=vector.add(pos,vector.new(math.random(100)+10,0,math.random(100)+10)) |
| [ | |
| { | |
| "code": "01", | |
| "dep_name": "Ain", | |
| "reg_name": "Auvergne-Rhône-Alpes" | |
| }, | |
| { | |
| "code": "02", | |
| "dep_name": "Aisne", | |
| "reg_name": "Hauts-de-France" |