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
CREATE SEQUENCE public.global_id_seq; | |
ALTER SEQUENCE public.global_id_seq OWNER TO postgres; | |
CREATE OR REPLACE FUNCTION public.id_generator() | |
RETURNS bigint | |
LANGUAGE 'plpgsql' | |
AS $BODY$ | |
DECLARE | |
our_epoch bigint := 1314220021721; | |
seq_id bigint; |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace CMCloud.SaaS | |
{ |
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
#include <windows.h> | |
#include <stdio.h> | |
#define SLEEP_TIME 5000 | |
#define LOGFILE "C:\\memstatus.txt" | |
int WriteToLog(char* str) { | |
FILE* log; | |
log = fopen(LOGFILE, "a+"); | |
if (log == NULL) |
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
requirejs.config({ | |
baseUrl: 'scripts', | |
paths: { | |
'angular': 'lib/angular/angular', | |
'angular-animate': 'lib/angular/angular-animate', | |
'angular-aria': 'lib/angular/angular-aria', | |
'angular-cookies': 'lib/angular/angular-cookies', | |
'angular-messages': 'lib/angular/angular-messages', | |
'angular-mocks': 'lib/angular/angular-mocks', | |
'angular-resource': 'lib/angular/angular-resource', |
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
/**************************************************************************** | |
* Author: Alberto Gutiérrez Jácome <agjacome@gmail.com> | |
* Date: 16/09/2012 | |
* | |
* Compilation: javac KdTree.java | |
* Execution: not applicable | |
* Dependencies: Point2D.java RectHV.java StdDraw.java Queue.java | |
* | |
* Description: A mutable data type that uses a 2d-tree to represent a set of | |
* points in the unit square. A 2d-tree is a generalization of a BST to |
NewerOlder