does this works?
it does
| public void copyToClipboard() { | |
| ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); | |
| ClipData clip = ClipData.newPlainText(label, text); | |
| clipboard.setPrimaryClip(clip); | |
| } | |
| const React = require('react') | |
| const ReactDOMServer = require('react-dom/server') | |
| global.React = React | |
| const t7 = require('t7') | |
| let jsx; | |
| t7.module((t7instance) => { | |
| jsx = t7instance | |
| jsx.setOutput(t7.Outputs.React); | |
| }) | |
| const reactHtmlEmail = require("react-html-email"); |
| // My point is that we could have a simpler Y combinator | |
| // I think the lambda would be λf.λx. f f x | |
| // not sure about that. I have only read about this today, so let me know | |
| // what I am missing. | |
| // My Y combinator (am i violating some lambda rule?) | |
| const Y2 = f => x => f(f)(x) | |
| // This proposal implementation requires spetial input functions |
| // Y combinator's lambda calculus formula: | |
| // Y = λf.(λx.f(x x))(λx.f(x x)) | |
| // Single line Y combinator implementation: | |
| // const Y = f => (x => f(v => x(x)(v))) (x => f(v => x(x)(v))) | |
| // My prefered (2 line) Y implementation (more readable IMO) | |
| const λfx__f_xx_ = f => x => f( y => x(x)(y) ); // helper | |
| const Y = f => λfx__f_xx_(f) ( λfx__f_xx_(f) ); // The Y combinator | |
| // factorial generator for Y (where fact is truly recursive): | |
| const Y_factg = fact => n => n === 0 ? 1 : n * fact(n - 1) | |
| // A factorial function generated with Y: |
| // Continuation Passing Style (CPS) | |
| console.log('CPS factorial') | |
| const CPS_fact = (n, callback = log) => { | |
| console.log('CPS_fact push stack when n = '+ n) | |
| if(n === 0) { | |
| //console.log(`then we call callback$${n}(1)`) | |
| callback(1)// executed when n is 0 | |
| } else { | |
| //console.log(`when n = ${n} then callback$${n - 1} = e => callback$${n}(e * ${n})`) | |
| CPS_fact(n - 1, r => { |
| var {Module, Controller, Provider} = require("cerebral") | |
| var {state, signal} = require("cerebral/tags") | |
| var {increment} = require("cerebral/operators") | |
| var React = require("react") | |
| var PropTypes = require("prop-types") | |
| var {Container, connect} = require("@cerebral/react") | |
| var { renderToString } = require('react-dom/server') | |
| const controller = Controller(Module({ | |
| state: { |
| syntax = "proto3"; | |
| package com.corlaez; | |
| message EmptyEvent { | |
| } |
| import java.util.WeakHashMap; | |
| import java.lang.ref.WeakReference; | |
| class Main { | |
| public static void main(String[] args) { | |
| WeakHashMap map = new WeakHashMap<String, Integer>(); | |
| char[] arr = {'x'}; | |
| String x = new String(arr); | |
| String x2 = new String(arr); |
does this works?
it does
You will need node js to run this array flattener.
Open your terminal/cmd and execute:
npx https://gist.github.com/lrn2prgrm/e82a719b030ee422018461d21052f4a0