public void SearchUser(
string userName,
int? age
) {
// 以 NHibernate 的动态查询示例
ISession session = OpenSession();
IQueryable<User> query = session.Query<User>();
// 根据参数动态构建表达式树
if (userName.IsNotNullOrEmpty()) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used in https://jina.ai/tokenizer (Aug. 14th version) | |
// Define variables for magic numbers | |
const MAX_HEADING_LENGTH = 6; | |
const MAX_HEADING_CONTENT_LENGTH = 200; | |
const MAX_HEADING_UNDERLINE_LENGTH = 200; | |
const MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100; | |
const MAX_LIST_ITEM_LENGTH = 200; | |
const MAX_NESTED_LIST_ITEMS = 5; | |
const MAX_LIST_INDENT_SPACES = 7; | |
const MAX_BLOCKQUOTE_LINE_LENGTH = 200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Xml; | |
using AutoMapper; | |
namespace AutoMapperTest; | |
public class Entity { | |
public XmlDocument Statement { get; set; } | |
} | |
public class Model { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
mv ng-seed-cli/.git _git | |
rm -rf ng-seed-cli | |
pnpm --package=@angular/cli dlx ng new ng-seed-cli --create-application false --skip-git --minimal --package-manager pnpm | |
cd ng-seed-cli | |
cp ../ng-seed/.eslintrc.json ./ | |
cp ../ng-seed/.editorconfig ./ | |
pnpm exec ng add @angular-eslint/schematics@next --skip-confirmation | |
pnpm exec ng g @angular-eslint/schematics:lib app-shared | |
pnpm exec ng g @angular-eslint/schematics:app handset --style scss --routing true --skip-tests true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Small script to fix geometries of the first file argument | |
using the native QGIS processing algorithm. You may need | |
to adjust the path to you installation. | |
""" | |
import sys | |
sys.path.append('/usr/share/qgis/python/plugins') | |
from processing.core.Processing import Processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
tc.table_schema, | |
tc.constraint_name, | |
tc.table_name, | |
kcu.column_name, | |
ccu.table_schema AS foreign_table_schema, | |
ccu.table_name AS foreign_table_name, | |
ccu.column_name AS foreign_column_name | |
FROM | |
information_schema.table_constraints AS tc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# open setting | |
adb shell am start -n com.android.settings/.TetherSettings | |
# down | |
adb shell input keyevent 20 | |
# enter | |
adb shell input keyevent 66 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO $$ | |
DECLARE | |
counter INTEGER := 1; | |
first_name VARCHAR(50) := 'John'; | |
last_name VARCHAR(50) := 'Doe'; | |
payment NUMERIC(11, 2) := 20.5; | |
BEGIN | |
RAISE NOTICE '% % % has been paid % USD.', counter, first_name, last_name, payment; | |
END $$; |
NewerOlder