xgugugu / xgugugu.github.io Goto Github PK
View Code? Open in Web Editor NEWhttps://xgugugu.github.io/
License: GNU General Public License v2.0
https://xgugugu.github.io/
License: GNU General Public License v2.0
测试
测试
11
再来逝世
这是我在编写网页过程中的学习成果,编写过程中难免出现错误,请谅解。
本文假定你已经有了一定的HTML&javaScript&CSS基础。如果你还没有学习过以上三种语言,请前往菜鸟教程或MDN学习后再查看本文。
Vue.js 是一套构建用户界面的渐进式框架。
Vue 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件。
Vue 学习起来非常简单,本教程基于 Vue 3.2.45 版本测试。
对于初学者,在浏览器内使用<script>
标签引入即可。
<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.45/vue.global.min.js"></script>
下面是使用Vue框架编写的HelloWorld网页:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.45/vue.global.min.js"></script>
</head>
<body>
<div id="app">
{{ message }}
</div>
<script>
const app = Vue.createApp({
data() {
return {
message: 'Hello, World!'
}
}
});
app.mount('#app');
</script>
</body>
</html>
2022.12.20新增:
插件所有计划功能全部开发完成,代码见 https://github.com/xgugugu/web-ext-myself/
原内容:
发文章还要上Github,但是github在国内那速度......
所以我做了一个可以发文章的小网页,不过现在还在开发中,很多功能还没有做
等做好了,肯定会开源在github上的
目前架构用的是浏览器拓展(规避CORS限制)
如题
自从10月Google关闭**的翻译服务后,唯一让我用Chrome浏览器的理由已经消失了。
一个更好的选择是——Firefox!
Firefox是一个开源、自由、快速的浏览器,它使用Gecko内核,由Mozilla组织负责维护,并有全世界大量的程序员贡献代码。
与网传的所谓“Firefox脚本速度比Chromium满10倍以上”的说法,在我亲自体验后,认为Firefox的脚本速度不仅和Chromium齐平,在有些方面甚至超过了Chromium(当然,也有可能Firefox在linux上优化更好)。
(我自己编写的贪吃蛇小游戏,Firefox运行速度明显更快)
Chrome一个让我非常不爽的地方就是,每次我更换或者重装操作系统后,都必须重新设置一遍浏览器,因为Google服务在**大陆不可用。然而,Firefox就完全可以使用Firefox账户来自动同步我的设置选项。
(Firefox的“同步”设置页)
用Chrome时,我一直没有安装任何浏览器拓展,因为Chrome的拓展商店根本打不开。而Firefox的拓展商店则加载迅速,而且内容丰富(不过部分广告拦截拓展被国内流氓公司搞下架了,需要手动安装)。
(手动安装,指 sudo pacman -S firefox-ublock-origin
)
Firefox的源代码全部开放,与私有闭源的Chrome相比,让人感到更多的安全感。
对于Linux系统,直接用系统的包管理器安装即可。
对于Windows系统,注意去Mozilla的官网下载,不要下载了Firefox**特供版。
使用const app = Vue.createApp(/*选项*/)
创建一个应用。
使用app.mount(/*选择器*/);
将应用挂载到一个DOM元素上,这将作为Vue渲染的起点。
选项中的data()
是一个函数,它应当返回一个对象,声明数据及其初始值。在本例中,声明了一个message
数据,值为'Hello, World!'
。
div
元素内的{{ message }}
即对应为data()
中声明的message
数据的值。在js中将message
的值改变,则DOM中{{ message }}
所显示的内容也会对应改变。
上面的例子已经揭示出Vue的**:数据驱动。
众所周知,传统的js是事件驱动的,即当发生事件时(用户点击等)调用对应的响应函数,进而修改DOM来显示数据。
而数据驱动的Vue将这一切都包装起来,当发生数据的改变时,会自动的计算出所需应用的DOM的最佳操作,使得效率更高。
在js中,可以通过vm.$data
访问vue中的数据,如:
const vm = app.mount('#app');
(timer = function () {
vm.$data.message++;
setTimeout(timer, 1000);
})();
完全没有DOM操作,就能方便的修改DOM中的数据,这可以为我们的开发带来很大的方便。
第一个更新的地方真是我没想到啊,网页引的jquery库竟然真是jquery.js,不卡就怪了
现在已经改成了jquery.min.js,流畅多了
添加了404页
加了能看到网站结构的网页
把两个旧的网站代码加到old文件夹里了
6B
import std;
测试以下111
std::bitset
是C++标准库中用于存储bool
值的容器。
std::bitset
通过固定的优化,让bool
值的存储变得更加节约内存和时间(其实就是01串状态压缩)。
在标准的bool
数组中,因为计算机存储数据的最小单元是字节(byte),因此一个bool
类型的变量实际占用了8bit,这就造成了极大的空间浪费,而bitset
解决了这个问题。
std::vector
的一个特化vector<bool>
的储存方式同std::bitset
一样,区别在于其支持动态开空间。
不过,因为std::bitset
拥有更多专门处理bool
值的库函数,所以在没有特殊需求的情况下一般使用bitset
。
#include <bitset>
// bitset<大小> bs;
bitset<1000> bs;
// bs[x]:访问第x位
bs[0] = true;
// bs1 ==/!= bs2:比较bs1和bs2是否相同
if (bs1 == bs2) { ... }
// bitset支持位运算
bs |= 1;
bs.count(); // 返回 true 的数量
bs.size(); //返回 bs 的大小
bs.to_string(); //返回 bs 的字符串表达
bs.to_ulong(); //返回 bs 对应的 unsigned long 值
std::bitset
的时间复杂度一般记作O(n/w)
(O(n)
为对应bool
数组的复杂度,w
为32
)
这道题有dfs的解法,不过思路较为复杂。但是用bitset
暴力广搜,更为简单。
q.push({st, 0});
vis[st.to_ulong()] = 1;
while (!q.empty()) { // bfs模板
auto h = q.front();
q.pop();
if (h.x == ed) { // 到了目标状态
cout << h.bs;
return;
}
for (int i = 1; i <= 4; i++) { // 遍历每个点
for (int j = 1; j <= 4; j++) {
if (h.x[(i - 1) * 4 + j - 1]) { // 若该点可以移动
for (auto k : dir) { // 遍历下一点
int nx = i + k[0], ny = j + k[1];
if (nx >= 1 && ny >= 1 && nx <= 4 && ny <= 4 && !h.x[(nx - 1) * 4 + ny - 1]) { // 若下一点可以移动到
auto n = h.x;
n[(i - 1) * 4 + j - 1] = 0;
n[(nx - 1) * 4 + ny - 1] = 1;
if (!vis[n.to_ulong()]) { // 若下一点未被走过
vis[n.to_ulong()] = 1;
q.push({n, h.bs + 1}); //继续广搜
}
}
}
}
}
}
}
为什么不开禁止F12,右键,Ctrl+Shift+I,Ctrl+U
Github:https://github.com/xgugugu/http-chatroom
Releases:https://github.com/xgugugu/http-chatroom/releases
聊天室使用C++编写,因此具有良好的性能的体积
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.