duangsuse::Echo
583 subscribers
4.12K photos
118 videos
579 files
6.13K links
import this:
美而不丑、明而不暗、短而不凡、长而不乱,扁平不宽,读而后码,行之天下,勿托地上天国。
异常勿吞,难过勿过,叹一真理。效率是很重要,盲目最是低效。
简明是可靠的先验,不是可靠的祭品。
知其变,守其恒,为天下式;穷其变,知不穷,得地上势。知变守恒却穷变知新,我认真理,我不认真。

技术相干订阅~
另外有 throws 闲杂频道 @dsuset
转载频道 @dsusep
极小可能会有批评zf的消息 如有不适可退出
suse小站(面向运气编程): https://WOJS.org/#/
Download Telegram
#PL #recommended #project 外国有人准备制作一个类 CHaskell 并准备支持类似现在一些新语言的特性(包括语法上的),手动管理内存的编译性语言叫 Jai
它还支持
反射和函数泛型、不错的新特性等

It looks like this:

counter: int = 0;
name: string = "Jon";

average: float = 0.5 * (x+y);

counter := 0; // int counter

counter: int; // w/o initialize like C int counter;

sum :: (x: float, y: float, z: float) -> float {
return x + y + z;
}

print("Sum: %\n", sum(1, 2, 3));

Vector2 :: struct {
x: float;
y: float;
}

a: [50] int;

print_int_array :: (a: [] int) -> fooSt

for
i : 0..n-1 {
print("%\n", it);
print("%\n", it_index);
}

#run generate_linear_srgb(); // 支持编译时运行宏 #run invokes the compile time execution

sum :: (a: $T, b: T) -> T {
return a + b;
}

#bake sum(a, 1) // a += 1

print_any :: (a: Any) {
if a.type.type == Type_Info_Tag.FLOAT
else if // ....
}

node :: struct {
owned_a : !* node = null;
owned_b : !* node = null;
}
example: node = new node;
delete example;
#inline fn
#no_inline fn_b
duangsuse::Echo
最后完整注释的版本 #Android
最后,快速了解一下 #Android 系统服务吧,看来这个星期又是啥都没干成... 🤐

== 简而言之

就是简单的『强类型』 C/S 架构喽

(下面的 Class#method% 方法表示我不想提及 method 的方法列表,但它是方法不是实例字段)
Service,就是 Android IPC 的 OOService

Service Server 使用 ServiceManager#addService% 和 ServiceManager#getService% 注册和获取 IBinder

abstract class ServiceConnection
onServiceConnected(ComponentName name, IBinder service)

但是注册 Service 对象的程序应该持续运行,一般使用 Looper 的 mainLooper
一般要进行权限认证,Context#checkCallingOrSelfPermission
没有 Context,使用 ActivityThread 拿到 system main thread,再拿 system Context。
检查相等性 PackageManager.PERMISSION_GRANTED

XML 符号:
tag permission-group { android:name android:icon android:label }
tag permission { android:name android:icon android:label android:permission-group android:protectionLevel }

Client,就是 OO,它找 ServiceManager 拿到一个 IBinder 对象,然后进行 IOOService.Stub.asService 转换,保证接口是清真无混乱的(IBinder 好比果的 HTTP 协议、AIDL 则是我们自己对协议的约束)

API,就是 IOOService,可以使用 AIDL 语言定义,用来利用 Android IPC 系统传递我们自己的消息

Manager,就是你自己提供一些辅助函数,比如 getOOService()

== 根据符号们:

—> 应用程序
class Vibrator
class android.os.SystemVibrator extends Vibrator
AIDL interface IVibratorService
abstact class IVibratorService.Stub

public class VibratorService extends IVibratorService.Stub implements InputManager.InputDeviceListener
public void VibratorService#vibrate(int uid, String opPkg, long milliseconds, int usageHint, IBinder token)


Context#getSystemService(@ServiceName String! serviceId)
Context.VIBRATOR_SERVICE

—> SystemServer
class com.android.server.SystemServer
traceBeginAndSlog(String)
ServiceManager.addService(String, IBinder)
traceEnd()

SystemServer#startOtherServices()
SystemServer#main()
SystemServer#run()

SystemServiceManager#startService()
ServiceManager#addService(String, IBinder)
ServiceManager#getService(String)

—> Services API
class android.app.SystemServiceRegistry
abstract class CachedServiceFetcher<T> { T createService(ContextImpl ctx); }
registerService(name, ServiceFetcher)

abstract class ServiceConnection
onServiceConnected(ComponentName name, IBinder service)

IXXXService.Stub.asInterface(service);


—> Android API
class android.os.Looper
Looper#prepareMainLooper();
Looper#loop%
activityThread.getSystemContext%
ActivityThread#systemMain
android.permission.SHUTDOWN
IPowerManager
IPowerManager#shutdown
Context.POWER_SERVICE
PowerManager.SHUTDOWN_USER_REQUESTED
Context#checkCallingOrSelfPermission



http://androidxref.com/8.0.0_r4/xref/frameworks/base/services/java/com/android/server/SystemServer.java#475
默写错(做其他开放定义的修改后没错的除外)的有:

FormatTask#run 可能抛出未捕获的异常 IOException,但是没有标记

XmlFormatterPlugin 使用了 A 类实例 Project#getTasks()
但是 A 类没有 create(String, String, Task): void 这个方法(但是有 create(String, Class<? extends Task>, Consumer<? extends Task>): void

Project#fileTree(Map<String, String>) 的第一个参数是 List 而非 Map
.... 还有些名字的错误,不过 IDE 都可以解决了
其实黑在当地是可以的…… 为什么会撞人拿绿卡, 真的就这么贱

就真的无法理解啊, 不是说中国籍有没有互害, 而是这种恐怖主义居然能被人群聊提出;后续是: #weibo 上居然还有冷漠洗地的,这些人矿的价值观,有如此巨婴?
这种谋杀,有人就觉得只是定价不够,是非都是骗小孩的,“世界上哪有绝对的正义啊? 我能做,那就是灰色地带 ”

如同那些看着普发6k说是退税的人,拿钱享福不好吗? 白嫖还讲大局高低了

这并非贫富的差距,是人兽间的首选项不同!
没绿卡不一定没人权,治安名声差一定被弃权。 阶级互害的惯性,愚昧至此

“你是不是中国人?”
“正因为是人,才要为这种价值观羞耻”
duangsuse::Echo
Photo
在中国把合法投资者视为间谍不审即判的同时,“高人一等”的洋大人却在给非法偷渡美国,打黑工的弱者提供媒体曝光、登记和转运政务🥰
https://m.youtube.com/watch?v=L_udFWDa8Es

明明能在家门口挣钱,却穿越八国边境和热带雨林投奔法制美日。 美国不会养不起劳动力吗?😅
希望华润万家能和美国经济相处融洽,不要内讧🙊

(前几天川普的防疫法案废止,可能反让越界者被永远驱逐,所以越境的新闻炎上了 #run
https://m.youtube.com/watch?v=ZDatHGIaDsI&t=6m

“因為他們是一個移民社會,而不是一個民族國家,”左右互搏还在继续。
VOA是左派媒体,它用词上有意淡化了黑户的特殊身份, 台媒好像更喜欢用非法移民称呼走线的人

这种「战略模糊」是左右之争。Biden称黑户为无证移民, 但难民涉及民族、秩序 法制和人道、廉价劳动力等争议,因此美国驱逐“流浪汉”的动力不稳定🤔。 文明社会是不爱举报弱者
duangsuse::Echo
Photo
#run 这个上海月薪900(10年前)的厨师 墨西哥的山上差点被🐺吃,但现在合法滞留在美了($8万假护照, 50w RMB 啊)

而这个 #apple WWDC 小粉红,有美国籍“二等公民”不入,自愿回国当三六九等 人上人😅,被拒签却莫名痛骂🇹🇼

你 落户 台湾省不就免签了?😅自顾自地恼羞了!
国内有一个好,叫见不得别人好
(没错“中国”有3种护照:人矿85、外交150、台湾168 免签国,包含G7😅 嫉妒了)
(但台湾归谁管 外省人也没纳过税啊..)
#science 赚翻墙信息差的人真是可悲啊,冷观人矿🙉便以为它就高台湾人一等了,对投资留学者的美国猜忌得血海深仇。在野版普京
且不说民国112年是怎么当“胞弟”的,现代人结婚改名还要封建父母同意吗☺️
既然是在内战,双方属于哪国呢?毛泽东生于共国?

对美拿人手短,对台吃人嘴不软,太强了!