xtodo

xtodo
xtodo

Wolfram language pattern matching concepts

xtodo
xtodo

~/.config/karabiner/karabiner.json

{
    "description": "f3 f4 copy paste",
    "manipulators": [
        {
            "from": { "key_code": "f3" },
            "to": [
                {
                    "key_code": "c",
                    "modifiers": ["left_command"]
                }
            ],
            "type": "basic"
        },
        {
            "from": { "key_code": "f4" },
            "to": [
                {
                    "key_code": "v",
                    "modifiers": ["left_command"]
                }
            ],
            "type": "basic"
        }
    ]
}
{
    "description": "f10 prev app",
    "manipulators": [
        {
            "from": { "key_code": "f10" },
            "to": [
                {
                    "key_code": "tab",
                    "modifiers": ["left_command"]
                }
            ],
            "type": "basic"
        }
    ]
}
{
    "description": "f11 f12 for prev next tab.",
    "manipulators": [
        {
            "from": { "key_code": "f11" },
            "to": [
                {
                    "key_code": "tab",
                    "modifiers": ["left_shift", "left_control"]
                }
            ],
            "type": "basic"
        },
        {
            "from": { "key_code": "f12" },
            "to": [
                {
                    "key_code": "tab",
                    "modifiers": ["left_control"]
                }
            ],
            "type": "basic"
        }
    ]
}
{
    "description": "f11 f12 for fine volume controls",
    "manipulators": [
        {
            "from": {
                "key_code": "f11"
            },
            "to": [
                {
                    "key_code": "volume_decrement",
                    "modifiers": ["left_shift", "left_option"]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "f12"
            },
            "to": [
                {
                    "key_code": "volume_increment",
                    "modifiers": ["left_shift", "left_option"]
                }
            ],
            "type": "basic"
        }
    ]
}

xtodo put in clips

todo 2024

fix html

css flex

.MTckf {
display: flex;
display: inline-flex;

flex-direction: row;
flex-direction: column;

flex-wrap: wrap;
flex-wrap: nowrap;
flex-wrap:  wrap-reverse;

flex-basis: 1200px;
justify-content: flex-start;

align-self: auto normal stretch center start end self-start self-end flex-start flex-end baseline first last safe unsafe;

align-items: center;
align-content: flex-start;

}

.VkjpW {

flex-grow: 2;
flex-shrink: 2;
flex: 1 1 300px;
flex-basis: 300px;
order: 2;
}
# 2023-05-10

# by kite
def f1(tupleLength, maxVal):
  ret = [[]]
  for i in range(tupleLength):
    temp = []
    for j in ret:
      for k in range(1, maxVal + 1):
        temp.append(j + [k])
    ret = temp.copy()
  return ret

# by george
def f2(tupleLength, maxVal):
  return [tuple(i // (maxVal**(tupleLength - j - 1)) % maxVal + 1
                for j in range(tupleLength))
          for i in range(maxVal**tupleLength)]

xx =  f2(3,4)
# xx =  f2(3,4)

for i in xx:
	print(i)

# (1, 1, 1)
# (1, 1, 2)
# (1, 1, 3)
# (1, 1, 4)
# (1, 2, 1)
# (1, 2, 2)
# (1, 2, 3)
# (1, 2, 4)
# (1, 3, 1)
# (1, 3, 2)
# (1, 3, 3)
# (1, 3, 4)
# (1, 4, 1)
# (1, 4, 2)
# (1, 4, 3)
# (1, 4, 4)
# (2, 1, 1)
# (2, 1, 2)
# (2, 1, 3)
# (2, 1, 4)
# (2, 2, 1)
# (2, 2, 2)
# (2, 2, 3)
# (2, 2, 4)
# (2, 3, 1)
# (2, 3, 2)
# (2, 3, 3)
# (2, 3, 4)
# (2, 4, 1)
# (2, 4, 2)
# (2, 4, 3)
# (2, 4, 4)
# (3, 1, 1)
# (3, 1, 2)
# (3, 1, 3)
# (3, 1, 4)
# (3, 2, 1)
# (3, 2, 2)
# (3, 2, 3)
# (3, 2, 4)
# (3, 3, 1)
# (3, 3, 2)
# (3, 3, 3)
# (3, 3, 4)
# (3, 4, 1)
# (3, 4, 2)
# (3, 4, 3)
# (3, 4, 4)
# (4, 1, 1)
# (4, 1, 2)
# (4, 1, 3)
# (4, 1, 4)
# (4, 2, 1)
# (4, 2, 2)
# (4, 2, 3)
# (4, 2, 4)
# (4, 3, 1)
# (4, 3, 2)
# (4, 3, 3)
# (4, 3, 4)
# (4, 4, 1)
# (4, 4, 2)
# (4, 4, 3)
# (4, 4, 4)

don't know what this means

xahlee terrence olivido 2023-01-16
xahlee terrence olivido 2023-01-16
ss 2023-01-05 005528 nRQXt
ss 2023-01-05 005528 nRQXt
xah coprographia unix culture 2022-12-26 vjBPY
xah coprographia unix culture 2022-12-26 vjBPY

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/16071

"require" is similar to the C include, which may cause newbie confusion. (One notable difference is that locals inside the required file "evaporate" when the require is done.)

The Ruby include is nothing like the C include.

The include statement "mixes in" a module into a class. It's a limited form of multiple inheritance. An included module literally bestows an "is-a" relationship on the thing including it.

---- The require method does what include does in most other programming languages: run another file. It also tracks what you've required in the past and won't require the same file twice. To run another file without this added functionality, you can use the load method.

http://zergsoft.blogspot.com/2012/10/ruby-include-vs-require-smackdown.html

------------

http://ionrails.com/2009/09/19/ruby_require-vs-load-vs-include-vs-extend/

----------------

http://stackoverflow.com/questions/318144/what-is-the-difference-between-include-and-require-in-ruby

The include method takes all the methods from another module and includes them into the current module. This is a language-level thing as opposed to a file-level thing as with require. The include method is the primary way to "extend" classes with other modules (usually referred to as mix-ins). For example, if your class defines the method "each", you can include the mixin module Enumerable and it can act as a collection. This can be confusing as the include verb is used very differently in other languages.

• include. The include statement "mixes in" a module into a class. It's a limited form of multiple inheritance. An included module literally bestows an "is-a" relationship on the thing including it.

include : mixes in specified module methods as instance methods in the target class extend : mixes in specified module methods as class methods in the target class

--------------

http://stackoverflow.com/questions/156362/what-is-the-difference-between-include-and-extend-in-ruby

What you have said is correct. However there is more to it than that.

If you have a class Klazz and module Mod, including Mod in Klazz gives instances of Klazz access to objects to Mod's methods. Or you can extend Klazz with Mod giving the class Klazz access to Mod's methods. But also you can extend an arbitrary object with o.extend Mod. In this case the individual object gets Mod's methods even though all other objects with the same class as o do not.

xinput = "
    [D]
[N] [C]
[Z] [M] [P]
 1   2   3

move 1 from 2 to 1
move 3 from 1 to 3
move 2 from 2 to 1
move 1 from 1 to 2"

Function[{x},

Module[{xStacksString, xProcedureString,xLinesOfStackConfig},
{xStacksString, xProcedureString} = (StringSplit[ # , "\n\n" ]& @ x);
xLinesOfStackConfig = StringSplit[ StringReplace[ xStacksString, { "[" -> " ", "]" -> " " } ], "\n" ];
xColumnCount = StringCases[  Last@xLinesOfStackConfig , RegularExpression[ " (\\d+) *$" ] -> "$1" ][[1]]//ToExpression;
xListOfStacks = ((DeleteCases[ # , "" ]) &) /@ Transpose @ (Drop[ #, -1 ]&) @ (StringTrim /@ (StringPartition[ #, 4 ]&) /@ (StringPadRight[ #, xColumnCount * 4 ]& /@ xLinesOfStackConfig ));
(* {{"N", "Z"}, {"D", "C", "M"}, {"P"}} *)
xProcedureNumbers = ToExpression @ StringSplit@ (StringSplit[ StringReplace[ xProcedureString , { "move " -> "", "from " -> "", "to " -> "" } ] , "\n" ]);
(* {{1, 2, 1}, {3, 1, 3}, {2, 2, 1}, {1, 1, 2}} *)

]

]@xinput

(* move p (number of times) from stack m to stack n *)
fmove[{p_, m_, n_}, xstacks_] :=
 Nest[ReplacePart[#1, {n -> Prepend[#1[[n]], First[#1[[m]]]],
     m -> Drop[#1[[m]], 1]}] &, xstacks, p]
xResultStacks = Fold[ fmove[#2, #1]&, xListOfStacks, xProcedureNumbers ]

Function[{x1,x2},expr]

Replace[ expr , fmove[{p_, m_, n_}, xstacks_] :>  Nest[ReplacePart[#1, {n -> Prepend[#1[[n]], First[#1[[m]]]],
     m -> Drop[#1[[m]], 1]}] &, xstacks, p],
{1}
  ]

xResultStacks = Fold[ Function[{x1,x2},expr][#2, #1]&, xListOfStacks, xProcedureNumbers ]

xAnswer = StringRiffle[  Cases[xResultStacks, {x_,___} -> x] , "" ]

xAnswer === "CMZ"

(* xAnswer === "DHBJQJCCW" *)

major

// click to hide all pre
// get pre element
// on click, toggle show hide
const xpreEle = document.getElementsByTagName("pre");

const f_hide_pre = ((xelm) => {
  if (xelm.style.visibility) {
    xelm.style.visibility = "hidden";
  } else {
    xelm.style.visibility = "visible";
  }
});

for (let kk of xpreEle) {
  kk.addEventListener("click", (x) => f_hide_pre(x.target), false);
}
github psychology marketing awards 2022-10-22 VXdzx
github psychology marketing awards 2022-10-22 VXdzx
twitter new ui icons 2022-10-23 Hmt8g
twitter new ui icons 2022-10-23 Hmt8g
unicode new 2022-10-23 xqW6g
2022-10-23 unicode for new 🆕 🌟 http://xahlee.info/comp/unicode_index.html?q=new
Miricale Y comment 2022-09-23 MN3xW
Miricale Y 4 months ago
Your video is sometimes profound and nice, keep it up man, but your operation on emacs I don't know the half of it, but I am working on it trying to keep it up.
xah comment 2022-09-18 qk7gW
xah comment 2022-09-18 qk7gW
xah-html-toggle-syntax-color-tags
 xah-html-htmlize-region
  xah-html-htmlize-string

xah-html-redo-syntax-coloring-buffer
 xah-html-htmlize-region
odysee sync 2022-08-17 kWzjT
odysee sync 2022-08-17 kWzjT

2022-08-23 convert pre class="bash" to pre class="shell" for code block that's app not bash

(query-replace-regexp "\\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\\) \\([^<]+\\)<\\([^>]+\\)>," "{date: \"\\1\", name: \"\\2\", email: \"\\3\", product: \"js\"}," nil nil nil nil nil)

Latest observation on the webdev milengen zoomer web design guru framework faaks. This began about 2019 or so. Sites no work if u don't have cookies on. Having JavaScript on no matter. Started to happen all over. Wallstreet journal, imgur, reddit, etc. (might be off on the specific sites, but it's wildfire).

css font 2022-05-08 ZSXV
css font 2022-05-08 ZSXV

thinking of writing a twitter bot to delete all my tweets.

read

website minor fix

xahweb user facing

xahweb, less important

Windows command.exe notes

add to Ergonomic Keyboard Layouts

write about reading writing to file.

write about -replace operator with block code for replacement. and document on the captured string's type system.text.regularexpression.math. ❮https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.match❯

https://youtu.be/kmW6bikZKe0
How To do a Checkup on Windows
Mar 19, 2021
Chris Titus Tech

keyboard read

here's a short account of modern taiwan history since ww2.

I was born in taiwan, 1968. Left in 1982 at age 14. (to escape mandatory military service) My parents are from china. Dad had a sister, 3 years old, died in shanghai during jp bombing.

China had civil war, between communist (CCP) and nationalists (Kuomintang aka KMT), before ww2. During ww2, jp invasion, they kinda agreed to work together fighting jp. After ww2 (1945), the civil war resumed, and is bloody as ever. In the end, communist party won, lead by mao. The nationalists, led by Chiang Kai-shek, escaped to taiwan in 1949, with his top generals and soldiers and family (1 to 2 million). (my dad's dad, is part of it)

Mao would have chased over and finished the job. Except, us has its 8th fleet at the taiwan strait. basically, usa supports the nationalists.

Chiang's taiwan, is basically authoritarian. any who disagree are jailed or killed. (big example, the historian Li Ao. went to jail for several years. no usa help. Died in 2018) (there were a few massacres) usa, supported it, in the name of “democracy”. (and usa soldiers, rape taiwan women, or enjoys a superior race status. My had told me stories i vaguely remember)

( “taiwaness” means quite a lot of things. 95% are han chinese. of which, the Hoklo, the Hakka, and waishengren (or “mainlanders”) it can mean those who are in taiwan before nationalist arrived. it's (which we call “taiwaness”.) taiwaness indigenous aboriginals. it can mean han chinese. (including, already in taiwan and chinese arrived with chiang from china) )

from 1990 to 2000, taiwan started to become more multi-party “democratic”.