- 博客(353)
- 资源 (1)
- 收藏
- 关注
原创 13[2-8]
[root@han learn_erl]# cat numberconvert2.erl -module(numberconvert2).-compile(export_all).binary_to_charlist(_, Postion, Result, TotalLength) when Postion =:= TotalLength -> lists:reverse(Result);binary_to_charlist(Str, Postion, Result, TotalLe.
2021-08-23 16:52:56
75
原创 更新列表中元组的值
1> c(update).{ok,update}2> 2> 2> update:update3().** exception error: undefined function update:update3/03> A = [{"key1","value1"},{"key2","values"}].[{"key1","value1"},{"key2","values"}]4> 4> 4> update:update3(A, "key1",.
2021-07-06 12:50:49
155
原创 从复杂元表中获取数据
2> A = {ok,{[{<<"module">>,<<"callflow">>},{<<"children">>,{[{<<"_">>,{[{<<"module">>,<<"play">>},{<<"children">>,{[]}},{<<"data">>,{[{<<"id">>,.
2021-06-18 13:35:52
115
原创 erlang:列表拼接/过滤列表/快速排序
[root@han learn_erl]# erlErlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]Eshell V10.7.2.1 (abort with ^G)1> c(conact).{error,non_existing}2> c(concat). concat.erl:2: Warning: export_all flag enab.
2021-05-14 08:48:10
433
转载 Erlang 中的 supervisor
【概况】supervisor behaviour 是用来实现监控其他子进程的supervisor 进程的模块;子进程可以是另一个 supervisor 进程,也可以是一个 worker 进程;worker 进程一般使用 gen_event,gen_fsm 或 gen_server behaviour 来实现;一个使用 supervisor behaviour 实现的 supervisor 有一个接口方法的标准集,包括跟踪和错误报告的功能;supervisor 机制用来构建一个分层进程结构,称为..
2021-04-28 14:10:22
746
原创 erlang:循环执行方法(1)
%% b.erl-module(b).-export([x/0]).-export([test/1]).x() -> 20000.y() -> io:format("Vsn1 (~p) b:x() = ~p~n", [1, 2]).test(Count) ->[y() || _ <- lists:seq(1,Count)].[y() || _ <- lists:seq(1,Count)].4> b:test(10). Vsn1 (1.
2021-04-28 09:47:35
258
原创 erlang 模块热加载
[root@han erlangsrc]# cat codereload.erl -module(codereload).-export([main/0, master_loop/2, worker_loop/0]).-define(VERSION, "0.2"). main() -> process_flag(trap_exit, true), Pid1 = spawn(?MODULE, worker_loop, []), Pid2 = spawn(?MOD...
2021-04-28 09:01:29
265
原创 erlang:一个简单的资源分配器
-module(allocator).-export([start/1,server/2,allocate/0,free/1]).start(Resources) -> Pid = spawn(allocator, server, [Resources,[]]), register(resource_alloc, Pid).% The interface functions.allocate() -> request(alloc).free(Resour.
2021-04-01 23:40:58
148
原创 erl命令行的一些基本操作
Microsoft Windows [版本 10.0.18363.1440](c) 2019 Microsoft Corporation。保留所有权利。C:\Users\5-101>erlEshell V10.7 (abort with ^G)1> c:cd("d:/erlang-app/test1/src").c:/Users/5-101ok2> c:cd("e:/erlang-app/test1/src").e:/erlang-app/test1/srcok3&.
2021-04-01 10:21:34
904
原创 piwigo:子相册
GET /piwigo/ws.php?method=pwg.categories.getList&cat_id=31&thumbnail_size=medium&format=json HTTP/1.1Cookie: pwg_id=mg1ctii1j2cpg4cb4gmm0v7tc7User-Agent: Piwigo-Android 1.0.2Host: 192.168.1.138Connection: Keep-AliveAccept-Encoding: gz
2020-12-22 07:29:20
3905
原创 北京周边徒步路线
部分六只脚轨迹号,供需要者参考。香八拉合集:经典香八拉 #3757846香山邮局-植物园 #3823035香山邮局-西山公园 #2168289香山邮局-虎头山 #3737612美人脸/14KM #3737598(休闲路线)东山村/17KM #2916778和平鸽/18KM #3743972小小五/19KM #3823042小香猪/22KM #2241940马蹄莲/30KM #3822953大蝴蝶/32KM #3692145 (挑战路线)中国地图/30KM #3743948大金牛/
2020-12-01 16:05:16
1433
原创 flutter Get list observable
Note about ListsLists are completely observable as are the objects within it. That way, if you add a value to a list, it will automatically rebuild the widgets that use it.You also don't need to use ".value" with lists, the amazing dart api allowed us
2020-11-30 11:42:47
472
1
原创 flutter中如何实现app的重启?
import 'package:flutter/material.dart'; void main() { runApp( RestartWidget( //使用StatefulWidget包装下 child: MaterialApp(), ), );} class RestartWidget extends StatefulWidget { RestartWidget({this.child}); final Widget child; .
2020-11-25 15:46:21
4287
原创 flutter ValueNotifier ValueListenableBuilder
import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';class ValueListenablePage extends StatefulWidget { @override _ValueListenablePageState createState() => _ValueListenablePageState();}class _ValueListenablePageSta.
2020-11-25 15:07:40
310
原创 flutter dio 上传 下载 进展
//文件下载//url 下载的地址//progressCallback 下载进度变化时的回调,用来实现进度条Future<Response> dioDownload(String url, progressCallback) async { Dio dio = Dio(); CancelToken cancelToken = CancelToken();//可以用来取消操作 String docPath = await Application.fileUtil.getDocP.
2020-11-25 14:03:13
2360
1
原创 How do I check if the Flutter application is in the foreground or not?
I don't want to show notification when the app is in foreground. How can I check live state of my app?4 AnswersIn your State<...> class you need to implementWidgetsBindingObserverinterface and listen for widget state changes. Something like t..
2020-11-25 08:48:56
535
原创 piwigo 设备诊断
http://localhost/piwigo/ws.php?format=json&method=reflection.getMethodDetails&methodName=reflection.getMethodDetails{"stat":"ok","result":{"name":"reflection.getMethodDetails","description":"","params":[{"name":"methodName","optional":false,"ac.
2020-11-25 07:46:35
133
原创 piwigo pwg.categories.add
http://localhost/piwigo/ws.php?format=json&method=pwg.categories.add&name=00000{"stat":"ok","result":{"info":"\u865a\u62df\u76f8\u518c\u5df2\u6dfb\u52a0","id":7}}
2020-11-19 22:00:24
1215
原创 flutter TextFormField validate
import 'dart:math';import 'package:flutter/material.dart';void main() { runApp(MyApp());}class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar.
2020-11-18 11:02:31
2143
原创 pwg.images.search
http://localhost/piwigo/ws.php?format=json&method=pwg.images.search&query=100&per_page=5&page=0{ "result": { "images": [ { "comment": null, "date_available": "2020-10-09 21:22:47", "date_creation...
2020-11-18 06:09:33
185
原创 flutter PopupMenu
onTap: () async { final result = await showMenu( context: context, position: RelativeRect.fromLTRB(100.0, 200.0, 100.0, 100.0),// position: RelativeRect.fromLTRB(1000.0, 1000.0, 0.0, 10.0), items: <PopupMenuItem<String>>[ .
2020-11-17 13:24:10
1320
原创 Flutter 透明背景色弹窗
showGeneralDialog( context: context, barrierDismissible:true, barrierLabel: '', transitionDuration: Duration(milliseconds: 200), pageBuilder: (BuildContext context, Animation<double> animation,Animation<double> secondaryAnimation) {.
2020-11-13 15:42:28
3601
原创 花生壳 Linux arm
安装和使用Linux花生壳服务一、安装说明(以CentOS 5为例)1、安装必要的开发包[root@localhost ~]# yum install gcc gcc-c++ autoconf automake2、下载phddns-2.0.2.16556.tar.gz到某一个目录[root@localhost ~]# wgethttp://download.oray.com/peanuthull/phddns-2.0.2.16556.tar.gz3、解压所有文件[root@lo.
2020-11-11 19:25:52
3748
1
原创 flutter upload dio elfinder
IconButton( onPressed: loadAssets, icon: Icon(Icons.photo),),Future<void> loadAssets() async { List<Asset> resultList = List<Asset>(); String error = 'No Error Dectected'; try { resultList = await MultiImageP...
2020-11-11 10:26:29
200
原创 通过pwg.session.getStatus获取pwg_token
http://192.168.2.89/piwigo/ws.php?method=pwg.session.getStatus&format=json{"stat":"ok","result":{"username":"root","status":"webmaster","theme":"default","language":"zh_CN","pwg_token":"d9b0c3557fbfcd4acef124c30aa09b53","charset":"utf-8","current_.
2020-11-10 10:10:31
583
原创 piwigo:接口:注册
POST /piwigo/ws.php?format=json HTTP/1.1Host: localhostConnection: keep-aliveContent-Length: 52Cache-Control: max-age=0Upgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.
2020-10-11 22:15:10
1385
原创 piwigo:接口:获取相册信息和获取相册图片列表信息
http://localhost/piwigo/ws.php?format=json&method=pwg.categories.getImages&cat_id=1{ "result": { "images": [ { "categories": [ { "id": 1, "page_url": "http://localhost/piwigo/picture.php?/2/c
2020-10-10 19:33:07
4591
原创 flutter:dart:get IP address of a computer name
import 'dart:io';void main() async { // ignore: prefer_typing_uninitialized_variables String connect; try { final result = await InternetAddress.lookup('DESKTOP-TR4ANSP', type: InternetAddressType.IPv4); if (result.isNotEmpty &.
2020-09-27 06:34:45
1304
原创 dart: Extension使用实例
扩展某个Class的能力:如果你想扩展某个系统Class的能力,不需要通过继承等的方式完成,而直接通过extension .. on 的方式进行操作。如下:/// Extends the `BuildContext` class with the ability/// to perform a lookup based on a `Bloc` type.extension BlocProviderExtension on BuildContext { /// Performs a l.
2020-09-11 07:03:25
611
原创 dart: dynamic List类型转换
import 'dart:async';Stream get asynchronousNaturals async* { print("Begin"); int k = 0; while (k < 3) { print("Before Yield"); yield k++; } print("End");}void testAsync() { StreamSubscription subscription = asynchronousNatura.
2020-09-10 10:29:21
5191
原创 flutter_bloc library
flutter_bloclibraryClassesBloc<Event,State>{@template bloc} Takes aStreamofEventsas input and transforms them into aStreamofStatesas output. {@endtemplate}BlocBuilder<C extendsCubit<S>,S>BlocBuilderhandles building ...
2020-09-09 14:27:18
186
原创 async* get StreamSubscription Stream
import 'dart:async';Stream get asynchronousNaturals async* { print("Begin"); int k = 0; while (k < 3) { print("Before Yield"); yield k++; } print("End");}main() { StreamSubscription subscription = asynchronousNaturals.listen(.
2020-09-09 11:22:31
174
原创 flutter_bloc example注释
import 'dart:async';import 'package:flutter/material.dart';import 'package:flutter_bloc/flutter_bloc.dart';/// Custom [BlocObserver] which observes all bloc and cubit instances.class SimpleBlocObserver extends BlocObserver { @override void onEv.
2020-09-09 10:20:28
193
原创 css自定义字体
@font-face {font-family: "iconfont"; src: url('../iconfont/iconfont.eot?t=1585271332268'); /* IE9 */ src: url('../iconfont/iconfont.eot?t=1585271332268#iefix') format('embedded-opentype'), /* IE6...
2020-03-27 11:40:02
348
原创 go 结构体赋值
var ( defaultOption = &Options{ Host: "127.0.0.1:1889", Topic: "test", Channel: "test", Username: "username", Password: "password", ClientID: "client-id", })func NewOptio...
2020-02-24 20:54:02
8578
原创 go资源
https://colobu.com/categories/Go/妙到颠毫: bigcache优化技巧fastcachehttp://allegro.tech/2016/03/writing-fast-cache-service-in-go.html https://github.com/allegro/bigcache https://dev.to/douglasmakey/ho...
2020-01-20 17:08:57
247
原创 sqlite3 json
https://cloud.tencent.com/developer/section/1419793SQLite version 3.30.1 2019-10-10 20:19:45Enter ".help" for usage hints.Connected to a transient in-memory database.Use ".open FILENAME" to reo...
2020-01-03 13:19:40
2266
转载 FreeSWITCH 呼叫接入慢:恶意IP攻击
FreeSWITCH 呼叫接入慢网上的大多数方法是修改/etc/freeswitch/dialplan/default.xml中field="${default_password}"规则下的休眠时间,但只有默认密码为1234时,该规则才会被触发。在前面我们已经修改了默认的密码,这里修改该规则将没有任何作用。<condition field="${default_passwo...
2019-06-24 14:45:27
2605
1
原创 在C函数中执行dialplan application的方法:
以下代码:将某个用户呼通后,桥接fifo中的某个等待呼叫switch_channel_set_variable(channel, "fifo_outbound_uuid", h->uuid);app_name = "fifo";arg = switch_core_session_sprintf(session, "%s out %s", h->node_name, membe...
2019-05-24 15:04:55
243
原创 mod_fifo内部用的表
表如下:/* Navicat Premium Data Transfer Source Server : c-freeswitch-fifo Source Server Type : SQLite Source Server Version : 3017000 Source Schema : main Target Server Typ...
2019-05-24 14:11:11
371
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅