mahaoqu 最近的时间轴更新
mahaoqu's repos on GitHub
Python · 4 人关注
shadow-http
A Shadowsocks-like http proxy server.
Vue · 2 人关注
Staff-attendance-system-frontend
Front-end of SE class project use Vue.js. Backend see https://github.com/kk456852/Staff-attendance-system
Verilog · 2 人关注
y86-processor-verilog
A simple implementation of y86-processor (see CSAPP3e, chap4).
Java · 1 人关注
CalorieTracker
csc510-21fall-g35
Python · 1 人关注
lcbot
TypeScript · 1 人关注
TeamFormationAssistant
An assistant which will take the project requirements, team members availability, skill level, tools preferred, etc. as input and assigns the members for the new team.
Lua · 0 人关注
2DGameEngine
C++ · 0 人关注
a-llvm-proj
0 人关注
aframe-react
:atom: Build virtual reality experiences with A-Frame and React.
Java · 0 人关注
antlr-js-java
0 人关注
bilicli
🎛️ Bilibili-live danmu dashboard in your terminal.
TypeScript · 0 人关注
ChatGPT-Next-Web
One-Click to deploy well-designed ChatGPT web UI on Vercel. 一键拥有你自己的 ChatGPT 网页服务。
0 人关注
cpp-docs.zh-cn
VCPPDocs Public Repo
0 人关注
DoR
The Department of Reuse tracks and documents reuse of artifacts in computer science (starting with the SE field)
0 人关注
DrCCTProf
DrCCTProf is a fine-grained call path profiling framework for binaries running on ARM and X86 architectures.
0 人关注
Mahaoqu
JavaScript · 0 人关注
mahaoqu.github.io
Blog
Verilog · 0 人关注
mips-pipeline
A verilog implement of a simple 5-stages pipeline processor.
0 人关注
modern-compiler-implementation-ml
Tiger Compiler from Modern Compiler Implementation in ML
Python · 0 人关注
my_alien_invasion_game
An game project based on Python Crash Course
Python · 0 人关注
production-practice
网络问答与资源共享平台
0 人关注
Staff-attendance-system
A simple realization of staff attendance system
C++ · 0 人关注
xcpp
A simple game engine
Rust · 0 人关注
zero2prod
mahaoqu

mahaoqu

V2EX 第 337689 号会员,加入于 2018-08-01 13:46:42 +08:00
今日活跃度排名 2572
mahaoqu 最近回复了
10 小时 0 分钟前
回复了 liyafe1997 创建的主题 Windows Win11 安装了 4 月更新之后发现搜索 UI 换字体了?
@liyafe1997 我搜到了,微软的人在 ReactConf 上说开始菜单的搜索和推荐部分是 React Native 做的。“全部程序”那部分好像还是原生。
13 小时 20 分钟前
回复了 IAmSimon 创建的主题 问与答 关于有了 AI 还需要记录(写笔记)吗
笔记的内容不重要,但是笔记的结构很重要。

这就是为什么 Obsidian 和一大堆双链工具能火起来。
15 小时 39 分钟前
回复了 liyafe1997 创建的主题 Windows Win11 安装了 4 月更新之后发现搜索 UI 换字体了?
这个开始菜单是用 Web 技术写的?
现在 MoonBit 主要的社区在哪个平台上?
10 个小时都搞不定中文的国际化么?
28 天前
回复了 GotKiCry 创建的主题 程序员 好奇 Java 味是什么味
大概就这种:

public interface Subject {
public void attach(Observer observer);
public void detach(Observer observer);
public void notifyObservers();
}

public interface Observer {
public void update(Subject subject);
}

public class HelloWorldSubject implements Subject {

private ArrayList<Observer> observers;
private String str;

public HelloWorldSubject() {
super();

observers = new ArrayList<Observer>();
}

public void attach(Observer observer) {
observers.add(observer);
}

public void detach(Observer observer) {
observers.remove(observer);
}

public void notifyObservers() {
Iterator<Observer> iter = observers.iterator();

while (iter.hasNext()) {
Observer observer = iter.next();
observer.update(this);
}
}

public String getStr() {
return str;
}

public void setStr(String str) {
this.str = str;
notifyObservers();
}
}

public class HelloWorldObserver implements Observer {

public void update(Subject subject) {
HelloWorldSubject sub = (HelloWorldSubject)subject;
System.out.println(sub.getStr());
}
}

public interface Command {
void execute();
}

public class HelloWorldCommand implements Command {

private HelloWorldSubject subject;

public HelloWorldCommand(Subject subject) {
super();

this.subject = (HelloWorldSubject)subject;
}

public void execute() {
subject.setStr("hello world");
}
}

public interface AbstractFactory {
public Subject createSubject();
public Observer createObserver();
public Command createCommand(Subject subject);
}

public class HelloWorldFactory implements AbstractFactory {

public Subject createSubject() {
return new HelloWorldSubject();
}

public Observer createObserver() {
return new HelloWorldObserver();
}

public Command createCommand(Subject subject) {
return new HelloWorldCommand(subject);
}
}

public class FactoryMakerSingleton {

private static FactoryMakerSingleton instance = null;
private AbstractFactory factory;

private FactoryMakerSingleton() {
factory = new HelloWorldFactory();
}

public static synchronized FactoryMakerSingleton getInstance() {
if (instance == null) {
instance = new FactoryMakerSingleton();
}

return instance;
}

public AbstractFactory getFactory() {
return factory;
}
}

public class AbuseDesignPatterns {

public static void main(String[] args) {
AbstractFactory factory = FactoryMakerSingleton.getInstance().getFactory();

Subject subject = factory.createSubject();
subject.attach(factory.createObserver());

Command command = factory.createCommand(subject);

command.execute();
}
}
@FalconD 结构子类型,打错了(
29 天前
回复了 lymanbernadette6 创建的主题 Windows 多个平台的 emoji 长得不一样
巨硬最搞笑的是做了两套,Teams 上的不给 Windows 平台用
30 天前
回复了 Livid 创建的主题 Python Nodezator
Python 也要有自己的蓝图
Go 和 TS 一样都使用名义类型应该算是最大的类似之处了,其他所有主流语言都不支持这一特性。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1330 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 38ms · UTC 17:24 · PVG 01:24 · LAX 10:24 · JFK 13:24
Developed with CodeLauncher
♥ Do have faith in what you're doing.