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
# 1st variant of [global] section | |
[global] | |
server string = %h server (Samba, Ubuntu) | |
client schannel = Yes | |
server schannel = Yes | |
map to guest = Bad User | |
obey pam restrictions = Yes | |
passdb backend = tdbsam | |
pam password change = Yes | |
passwd program = /usr/bin/passwd %u |
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
Private m_dMax# 'верхняя граница интервала | |
Public Property Get max() As Double | |
max = m_dMax | |
End Property | |
Public Property Let max(value#) | |
m_dMax = value | |
End Property |
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 s.* | |
FROM sys.stats s | |
JOIN sys.objects o ON s.[object_id] = o.[object_id] | |
WHERE o.is_ms_shipped = 0 | |
-- Скрипт по автоматическому обновлению устаревшей статистики | |
-- Критерий устаревания статистики в каждой конкретной ситуации может быть свой. В данном примере — 1 день | |
DECLARE @DateNow DATETIME | |
SELECT @DateNow = DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) |
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
var query = from с шт context.Customers where c.CustomerId == 1 select c; | |
/*Example of INNER JOIN in LINQ SQL-like syntax*/ | |
var transactions = from с in сcontext.Customers | |
join o in Context.Orders on c.CustomerId equals o.CustomerId | |
join op in Context.OrderProducts on o.OrderId equals op.OrderId | |
join p in Context.Products on op.ProductId equals p.ProductId | |
select new | |
{ | |
CustomerName = c.CustomerName, |
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
UPDATE [mis-dm].[DM].[D_TERRITORY] | |
SET ChildrenCount = (SELECT COUNT(t2.TERRITORY_ID) ChildrenCount | |
FROM DM.D_TERRITORY t1 | |
LEFT JOIN DM.D_TERRITORY t2 ON t2.PARENT_ID = t1.TERRITORY_ID | |
WHERE t1.TERRITORY_ID = [mis-dm].[DM].[D_TERRITORY].TERRITORY_ID | |
GROUP BY t1.TERRITORY_ID | |
) |
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
public void butSelectFile_Click(object sender, EventArgs e) | |
{ | |
OpenFileDialog dlg = new OpenFileDialog(); | |
dlg.Filter = "Текстовые файлы|*.txt|Все файлы|*.*"; | |
if (dlg.ShowDialog() == DialogResult.OK) | |
{ | |
fldFilePath.Text = dlg.FileName; | |
if (FileOpenClick != null) FileOpenClick(this, EventArgs.Empty); |
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
public class Singleton | |
{ | |
private static Singleton _singleton; | |
static Singleton() | |
{ | |
_singleton = new Singleton(); | |
} | |
private Singleton() |
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 GeoAPI.Geometries; | |
using NetTopologySuite.Geometries; | |
using NetTopologySuite.Simplify; | |
namespace NetTopologySuite.Operation.Overlay.Snap | |
{ | |
/// <summary> | |
/// Performs an overlay operation using snapping and enhanced precision | |
/// to improve the robustness of the result. |
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 GisSharpBlog.NetTopologySuite.Features; | |
using GisSharpBlog.NetTopologySuite.Geometries; | |
using GisSharpBlog.NetTopologySuite.IO; | |
using GeoAPI.Geometries; | |
...etc.... |
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
class CompositeCustomService | |
{ | |
// Композиция | |
private readonly CustomRepository _repository | |
= new CustomRepository(); | |
public void DoSomething() | |
{ | |
// Используем _repository | |
} | |
} |