2020年9月27日日曜日

JavaScript 気になるメソッド .reverse() .concat()

JavaScript  気になるメソッド
Array.reverse() 
reverse メソッドは呼び出した配列オブジェクトの要素をその内部で反転させ、配列を書き換えます。そして、書き換えられた配列を戻します。

Array.concat()
新しい配列に連結する配列や値です。すべての valueN 引数が省略された場合、 concat は呼び出された既存の配列のシャローコピーを返します。詳しくは下記の解説をお読みください。

例 値渡しの感じ
console.log('fns7(  [' + tx7 + ']  )' );
console.log('fns7(  [' + tx7.concat().sort((a, b) => a - b) + ']  )' );


https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/concat


end

2020年2月13日木曜日

VisualStudioCodeでのコード整形 Shift + alt + f

VisualStudioCodeでのコード整形 Shift + alt + f
sublime SublimeAStyleFormatter コード整形 Ctrl+ alt + f

C++ 始まり

MinGW
http://www.mingw.org/



end


2019年11月23日土曜日

PythonでWebServerを動かす方法

PythonでWebServerを動かす方法

python -m http.server --bind 192.168.11.111

python -m http.server --bind 192.168.11.111 --directory C:\FFmpeg

python -m http.server 80 --bind 192.168.11.111 --directory C:\FFmpeg

downloads
https://www.python.org/downloads/release/python-380/

2019年11月7日木曜日

chrome コマンドの一覧を表示する方法

about:about

一覧画面はアドレスバーに
about:about
と入力すると確認できます。

パソコンに接続されている従来のプリンタを Google クラウド プリントに追加できます。
chrome://devices/

2019年10月20日日曜日

在前台运行服务

在前台运行服务

https://developer.android.com/guide/components/services#Foreground

Intent notificationIntent = new Intent(this, ExampleActivity.class);
PendingIntent pendingIntent =
        PendingIntent.getActivity(this, 0, notificationIntent, 0);

Notification notification =
          new Notification.Builder(this, CHANNEL_DEFAULT_IMPORTANCE)
    .setContentTitle(getText(R.string.notification_title))
    .setContentText(getText(R.string.notification_message))
    .setSmallIcon(R.drawable.icon)
    .setContentIntent(pendingIntent)
    .setTicker(getText(R.string.ticker_text))
    .build();

startForeground(ONGOING_NOTIFICATION_ID, notification);

2019年10月8日火曜日

网络安全配置

网络安全配置

https://developer.android.com/training/articles/security-config


NetworkSecurityConfig: No Network Security Config specified, using platform default

res/xml/network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">ekidata.jp</domain>
    </domain-config>
</network-security-config>


<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
     <application android:networkSecurityConfig="@xml/network_security_config"
                        ... >
            ...
    </application>
</manifest>
   




2019年9月1日日曜日

android 音声の周波数を作成

android 音声の周波数を作成

byte b = (byte)(Math.sin(bufferIndex/2*Math.PI(SamplingRate /Frequency))

角度 =bufferIndex /2*Math.PI(4400/800);
byte値(音声のビット、B辺) = (byte) (Math.sin(temp) * 120(C辺);

    private void hz() {
        byte[] bs = new byte[44100];
        Double temp;
        for (int i = 0; i < bs.length; i++) {
            temp = i / 2 * Math.PI / (44100 / Double.parseDouble("800"));
            bs[i] = (byte) (Math.sin(temp) * 120);
        }
        audioTrack.play();
        while (true) {
            audioTrack.write(bs, 0, bs.length);
        }
    }


    private void hz() {
        byte[] bs = new byte[44100];
        Double temp;
        for (int i = 0; i < bs.length; i++) {
            temp = i / 2 * Math.PI / (44100 / Double.parseDouble("800"));
            bs[i] = (byte) (Math.sin(temp) * 120);
        }
        audioTrack.play();
        while (true) {
            audioTrack.write(bs, 0, bs.length);
        }
    }
SamplingRate =44100
Frequency =800

SamplingRate =44100
Frequency =44100

SamplingRate =360
Frequency =4

https://docs.google.com/spreadsheets/d/1IvCVmJ_WYIhO6PaumFV5mpf3XDIjgu4TwmDbSwwLuK8/edit?usp=sharing