This file contains hidden or 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
QueryString qs = new QueryString("John Doe AND New York City") | |
.SetAllowLeadingWildcard(false) | |
.SetFields(new List<Field> | |
{ | |
new Field("firstName", 2.0), | |
new Field("city", 0.5) | |
}) | |
.SetFuzzyMinimumSimilarity(0.1); |
This file contains hidden or 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
var connectionSettings = new ConnectionSettings("127.0.0.1.", 9200).SetDefaultIndex("mpdreamz"); | |
var client = new ElasticClient(connectionSettings); | |
var blogPost = new Blog() | |
{ | |
Id = 10, | |
Body = StaticData.RandomString(StaticData.RandomNumber(10, 1000)), | |
Title = StaticData.RandomString(StaticData.RandomNumber(4, 20)), | |
Author = persons[StaticData.RandomNumber(0,29)] | |
}; | |
client.IndexSync(blogPost); |
This file contains hidden or 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
{"_index":"mpdreamz","_type":"blogs","_id":"10", "_source" : { | |
"id": 10, | |
"title": "YuwlQyGBD", | |
"body": "BQFSBpwAflRTUBoBESibOuMvCRnOjgIFjNqEbSsaRdUyOsOUOFcjldwHekqkchrzCLkGLJaLAiJLZoGkCsadDzUFrIArCHykLVVCiHIEfQIdTKHqDFhJGNvDrePdjjjSJzZeSDBvJvynQrmGAKnWaoDXaRLDsFVwhPtuKDxZDmalPiMZRICyVmSvVBeAsyCDZBFAXswWnntNosiRfLmjdxAvxXyIZWHFJwLoCLcZMFlitEhDTmVGLtAcbkDaTnWQFneRguptJmWxmscsQUpNbbTqVJMsicgZIUCFAPXZxCxZWdPIiljzyjPEtNVWhWKhFxORPwRAxpqyDuTsTekWShBzfyMnTASARPTZOySmTIcISrAzTDdCmoOYvpMRJEGwWPGoauDvlydJESgNxntqXPodAUezLbcpBFLdkmzZZHRolfuc", | |
"author": { | |
"firstName": "", | |
"lastName": "Holiman", | |
"dateOfBirth": "\/Date(-62135596800000+0100)\/", | |
"id": 0 | |
} |
This file contains hidden or 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
FullFileName = %1% | |
SplitPath, FullFileName, name, dir, ext, noext, drive | |
FileGetSize, Size, %FullFileName% | |
if (Size = 0) | |
{ | |
FileAppend, /* New File */, %FullFileName% | |
; HACK, zero byte files sadly default to the internal lister | |
} | |
SEND ^r | |
SEND %name% |
This file contains hidden or 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
var lastScreen = this.GetScreenFromRect(lastRect); | |
var newScreen = this.GetScreenFromRect(newRect); | |
if (!lastScreen.Bounds.Equals(newScreen.Bounds)) | |
{ | |
var x = (newRect.Left - newScreen.Bounds.X) + lastScreen.Bounds.X; | |
var y = (newRect.Top - newScreen.Bounds.Y) + lastScreen.Bounds.Y; | |
var width = newRect.Right - newRect.Left; | |
var height = newRect.Bottom - newRect.Top; | |
Window32API.MoveWindow(this.hWnd, x, y, width, height, false); |
This file contains hidden or 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
public partial class App : Application | |
{ | |
protected override void OnStartup(StartupEventArgs e) | |
{ | |
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; | |
} | |
} |
This file contains hidden or 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
dbcc freeproccache | |
go | |
dbcc dropcleanbuffers | |
go | |
DECLARE @a DATETIME, @b DATETIME | |
SET @a = CURRENT_TIMESTAMP | |
-- QUERY BIT | |
select * from | |
(select Row_Number() over (order by Id) as RowIndex |
This file contains hidden or 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
USE MyDb | |
ALTER DATABASE MyDb SET RECOVERY SIMPLE | |
go | |
DBCC SHRINKFILE(MyDb) | |
DBCC SHRINKFILE(MyDb_log) | |
go | |
EXEC sp_helpdb MyDb | |
go | |
ALTER DATABASE MyDb SET RECOVERY FULL | |
go |
This file contains hidden or 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
----Force database into single user Mode | |
ALTER DATABASE db_name | |
SET SINGLE_USER WITH | |
ROLLBACK IMMEDIATE | |
----Restore Database | |
RESTORE DATABASE db_name | |
FROM DISK = 'D:\db_name.bak' | |
WITH REPLACE, | |
MOVE 'db_name' TO 'D:\SQLServer\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\db_name.mdf', |
This file contains hidden or 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
WITH CTE (Colum1, Colum2, DuplicateCount) | |
AS | |
( | |
SELECT Colum1, Colum2, ROW_NUMBER() | |
OVER(PARTITION BY Colum1, Colum2 ORDER BY Colum1) AS DuplicateCount | |
FROM MyTable | |
WHERE Colum1 = 1 AND Colum2 IS NOT NULL | |
) | |
SELECT * FROM CTE | |
WHERE DuplicateCount > 1 |
OlderNewer