Skip to content

Commit

Permalink
更新内容
Browse files Browse the repository at this point in the history
  • Loading branch information
jywangyou committed Jan 10, 2024
1 parent 1df6ae7 commit 774bccf
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 40 deletions.
2 changes: 1 addition & 1 deletion docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
{
text: '学习笔记',
items: [
{ text: '《JavaScript教程》', link: '/note/javascript/' },
{ text: '《JavaScript》', link: '/note/javascript/' },
// { text: '《JavaScript高级程序设计》', link: '/note/js/' },
{ text: '《ES6 教程》', link: '/note/es6/' },
{ text: '《Vue》', link: '/note/vue/' },
Expand Down
93 changes: 93 additions & 0 deletions docs/06.收藏夹/03.精选软件.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: 精选软件
date: 2024-01-10 10:31:35
permalink: /pages/41d852/
article: false
author:
name: Kronos
link: https://github.com/jywangyou
---

## 编辑器
- [VS Code](https://code.visualstudio.com/) 最好用的编程软件
- [HBuilderX](https://www.dcloud.io/hbuilderx.html) 国内优秀编辑器
- [微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) 微信小程序开发首选
- [Visual Studio](https://visualstudio.microsoft.com/zh-hans/downloads/) 地表最强编辑器
- [IntelliJ IDEA](https://www.jetbrains.com/zh-cn/idea/download/?section=windows) 领先的 Java 和 Kotlin IDE

## 开发工具
- [Node.js](https://nodejs.org/en/)
- [Git](https://git-scm.com/)

## 通讯
- [QQ](https://im.qq.com/index/)
- [微信](https://weixin.qq.com/)

## 浏览器
- [Chrome](https://www.google.cn/intl/zh-CN/chrome/) 谷歌浏览器
- [Firefox](https://www.firefox.com.cn/) 火狐浏览器
- [Opera](https://www.opera.com/zh-cn/download) 欧朋浏览器

## 压缩
- [360压缩](https://www.360totalsecurity.com/zh-cn/360zip/) 国际版,无广
- [7-Zip](https://www.7-zip.org/download.html) 轻量,极致压缩
- [WinRAR](https://www.win-rar.com/predownload.html?&L=7) 老牌压缩软件


## 屏幕录制
- [EV录屏](https://www.ieway.cn/evcapture.html) 免费无水印
- [OBS Studio](https://obsproject.com/) 免费开源,直播-录屏
- [ScreenToGif](https://www.screentogif.com/) 微软出品,GIF录制首选

## 截图贴图
- [Snipaste](https://zh.snipaste.com/) 免费无广,轻量极简
- [PixPin](https://pixpinapp.com/) 可截长图,OCR识别

## 手机投屏
- [QtScrcpy](https://gitee.com/Barryda/QtScrcpy/releases) 安卓手机投屏到电脑
- [scrcpy](https://github.com/Genymobile/scrcpy/releases) 适用于安卓手机


## 虚拟机
- [VMware](https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html) 支持多种系统运行
- [BlueStacks](https://www.bluestacks.com/tw/index.html) 安卓模拟器


## 远程控制
- [向日葵](https://sunlogin.oray.com/)


## 翻译
- [网易有道翻译](https://fanyi.youdao.com/download-Windows#/)
- [腾讯交互翻译](https://transmart.qq.com/zh-CN/download)
- [Pot](https://pot-app.com/) 跨平台划词翻译和OCR


## 笔记
- [Typora](https://typora.io/) 优秀的 Markdown 编辑器
- [Notepad++](https://notepad-plus-plus.org/downloads/v8.4.7/)
- [有道云笔记](https://note.youdao.com/) 云端同步


## 桌面整理
- [酷呆桌面](https://www.coodesker.com/) 支持硬件加速,启动很快
- [腾讯电脑管家桌面整理](https://guanjia.qq.com/product/zmzl/?ADTAG=media.innerenter.gj_product&wd=&eqid=ab60bbea000010a20000000465291abf) 可下载桌面整理独立版


## 网盘
- [百度网盘](https://pan.baidu.com/download?_at_=1704863197978#win)
- [夸克网盘](https://pan.quark.cn/)


## 游戏相关
- [Steam](https://store.steampowered.com/about)
- [EPIC](https://www.epicgames.com/help/zh-CN/?lang=zh-CN)
- [EA](https://www.ea.com/ea-app?isLocalized=true)
- [原神](https://ys.mihoyo.com/) 启动!

## 其他
- [图吧工具箱](https://www.tbtool.cn/#container_23932c22) 硬件检测工具合集
- [分流抢票](https://www.bypass.cn/) 高铁、火车抢票软件
- [LIVELY WALLPAPER](https://www.rocksdanister.com/lively/) 动态壁纸
- [大饼AI](https://dubbingai.io/) ai变声
- [SoftPerfect Network Scanner v8.1.6](https://pan.baidu.com/s/1GvvlU3NYeC2DhKEeNwANjw?pwd=f1jm) 局域网IP扫描工具 便携版
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ bannerBg: background:none # auto => 网格纹背景(有bodyBgImg时无背景),
<ClientOnly>
<IndexBigImg />
<!-- <Fantasy index="true" /> -->
</ClientOnly>
</ClientOnly>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: C#将扁平化数据以 JSON 树形结构输出
date: 2023-12-22 11:24:45
permalink: /pages/2f2493/
categories:
- 《C#》笔记
- C# 笔记
tags:
- C#
Expand Down Expand Up @@ -38,7 +37,7 @@ author:

假如我们有以下数据:

```data
```css
COMPANYCODE | BUILDNO | ID
------------|---------|---
A | B1 | 1
Expand All @@ -49,7 +48,7 @@ B | C2 | 4

使用LINQ语句对数据进行分组,根据公司代码(COMPANYCODE)进行分组。这一步将数据按照公司代码分成若干组,形成一个分层结构的基础。

```C#
```csharp
var treeData = from row in dataTable.AsEnumerable()
group row by row.Field<string>("COMPANYCODE") into buildingGroup
select new
Expand All @@ -73,7 +72,7 @@ var treeData = from row in dataTable.AsEnumerable()

使用 `JavaScriptSerializer` 类将 LINQ 查询的结果序列化为 JSON 字符串:

```C#
```csharp
JavaScriptSerializer serializer = new JavaScriptSerializer();
string json = serializer.Serialize(treeData);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: C#将字符串转换为日期
date: 2024-01-10 09:28:23
permalink: /pages/05fe96/
categories:
- C# 笔记
tags:
- C#
author:
name: Kronos
link: https://github.com/jywangyou
---

在C#开发中,经常遇到处理日期和时间的任务。有时候,需要将字符串转换为日期对象,以便在应用程序中进行更进一步的处理。浅浅记录下日期时间处理的方法。

## 使用 DateTime.Parse 方法

C# 中的 `DateTime.Parse` 方法是将字符串转换为 DateTime 对象的一种常见方法。以下是一个简单的例子:

```csharp
string dateString = "2024-01-09";
DateTime date = DateTime.Parse(dateString);
```

这段代码将字符串"2024-01-09"转换为 DateTime 对象。需要注意的是,`DateTime.Parse` 方法 **对于标准日期格式通常是有效的,但对于非标准格式可能会引发异常**

## 使用 DateTime.TryParse 方法

为了防止由于非法日期字符串而引发异常,可以使用 `DateTime.TryParse` 方法,它会返回一个布尔值,指示转换是否成功:

```csharp
string dateString = "2024-01-09";
DateTime date;
if (DateTime.TryParse(dateString, out date))
{
Console.WriteLine(date);
}
else
{
Console.WriteLine("日期字符串无效");
}
```

这种方法允许我们在转换失败时进行适当的处理,而不会导致应用程序崩溃。

## 使用 DateTime.ParseExact 方法

如果知道字符串的确切格式,可以使用 `DateTime.ParseExact` 方法,指定一个格式化字符串:

```csharp
string dateString = "09/01/2024";
DateTime date = DateTime.ParseExact(dateString, "dd/MM/yyyy", CultureInfo.InvariantCulture);
Console.WriteLine(date);
```

在上述例子中,我们指定了日期字符串的格式为 "`dd/MM/yyyy`",并使用 `CultureInfo.InvariantCulture` 作为文化信息。

::: details 文化信息
在C#中,`CultureInfo` 是一个表示特定区域性信息的类。它包含了关于语言、国家/地区、日期和时间格式、货币符号等方面的信息。`CultureInfo` 的使用可以确保在进行字符串转换、格式化和解析时,采用了正确的文化习惯,以防止出现意外的行为。

`CultureInfo.InvariantCulture``CultureInfo` 类的一个静态属性,表示一个与任何特定文化相关性都无关的固定格式。使用这个文化信息时,不考虑用户的本地设置,而是使用一个通用的不可变的标准,以确保在不同环境中的一致性。

在日期时间处理中,`CultureInfo.InvariantCulture` 通常用于指定日期时间字符串的格式,以防止受到不同文化设置的影响。例如,使用这个文化信息可以确保 "`MM/dd/yyyy`" 的日期格式在任何地方都被正确解释,而不受不同地区日期格式的影响。
:::

## 使用 DateTime.TryParseExact 方法

`DateTime.TryParseExact` 方法也可用于安全地转换日期字符串:

```csharp
string dateString = "09/01/2024";
DateTime date;
if (DateTime.TryParseExact(dateString, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out date))
{
Console.WriteLine(date);
}
else
{
Console.WriteLine("日期字符串无效");
}
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: 使用 js 检测前端返回地址404错误
date: 2024-01-10 10:04:17
permalink: /pages/ad7a2d/
categories:
- JavaScript 笔记
tags:
- js
author:
name: Kronos
link: https://github.com/jywangyou
---

浅记在前端中进行404错误检测的方法。

## 使用 XMLHttpRequest 对象

```js
function check404(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 404) {
callback(true); // 404错误
} else {
callback(false); // 非404错误
}
}
};
xhr.open('GET', url, true);
xhr.send();
}

// 使用示例
var urlToCheck = 'https://example.com/page-not-found';
check404(urlToCheck, function (is404) {
if (is404) {
console.log('页面不存在!');
// 处理404错误的逻辑
} else {
console.log('页面存在!');
// 处理正常情况的逻辑
}
});
```

## 使用 [Fetch API](https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API)

```js
function check404Fetch(url, callback) {
fetch(url)
.then(response => {
if (!response.ok) {
callback(true); // 404错误
} else {
callback(false); // 非404错误
}
})
.catch(error => {
console.error('发生网络错误:', error);
});
}

// 使用示例
var urlToCheck = 'https://example.com/page-not-found';
check404Fetch(urlToCheck, function (is404) {
if (is404) {
console.log('页面不存在!');
// 处理404错误的逻辑
} else {
console.log('页面存在!');
// 处理正常情况的逻辑
}
});
```

## 注意

在使用上述方法时,需要注意跨域限制。确保你的 JS 代码在访问其他域的资源时得到了允许,否则浏览器会阻止请求。你可能需要在服务器端进行相关配置,以允许跨域请求。
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"vuepress-plugin-demo-block": "^0.7.2",
"vuepress-plugin-fulltext-search": "^2.2.1",
"vuepress-plugin-one-click-copy": "^1.0.2",
"vuepress-plugin-reading-progress": "^1.0.10",
"vuepress-plugin-sitemap": "^2.3.1",
"vuepress-plugin-thirdparty-search": "^1.0.2",
"vuepress-plugin-zooming": "^1.1.7",
"vuepress-theme-vdoing": "^1.12.9",
"yamljs": "^0.3.0",
"vuepress-plugin-reading-progress": "^1.0.10"
"yamljs": "^0.3.0"
}
}

0 comments on commit 774bccf

Please sign in to comment.