Skip to content

Instantly share code, notes, and snippets.

View mwork4755's full-sized avatar
💻

mwork4755

💻
View GitHub Profile
@mwork4755
mwork4755 / map_point.sql
Created March 29, 2026 17:23
tsql geography
DECLARE geo_crs CURSOR LOCAL FOR
SELECT crs.pin,crs.lat,crs.long,crs.geo,crs.reciv FROM #crs4 AS crs
ORDER BY crs.reciv
OPEN geo_crs
FETCH NEXT FROM geo_crs
INTO @pinfirst,@latg,@longg,@geocurs,@receiv
WHILE @@FETCH_STATUS=0
BEGIN
SET @userloc = geography::Point(@latg, @longg, 4326).STBuffer(@km)
SET @checkgeo1 = (SELECT TOP (1) t.checkgeo FROM #t2 AS t WHERE t.checkpin=@pinfirst ORDER BY t.receivedm DESC )
CREATE TABLE #rezults
(cobj BIGINT,
times DATETIME,
counts INT)
DECLARE @xg1 DATETIME2,
@xg2 INT,
@xg3 BIGINT,
@mess VARCHAR(300),
@logr DATETIME2
SET @xg2=0
--Cursor Sample, declare for tables list
--Result select val from list of tables, with equal column names--
IF OBJECT_ID('tempdb..#connector1') IS NOT NULL DROP TABLE #connector1
IF OBJECT_ID('tempdb..#resulttable') IS NOT NULL DROP TABLE #resulttable
CREATE TABLE #connector1 (val int)
CREATE TABLE #resulttable (id int, val int)
DECLARE
import os
import shutil
import pprint
from datetime import datetime
import win32com.client as win32
#upd stamp
with open("lastupd.txt", "a") as f:
x = datetime.today().strftime('%Y-%m-%d %H:%M:%S')
f.write(x + '\n')
#How it work#
#:Search info in incoming messages and remind about new value, into Outlook from third-system, without last(closed) selfstatus
#:Last selfstatus substitution in closed_list.txt manualy
#:Make txt file with some info, for reminder button
#:After, remind about new messages
#(foxes in comment just for ex)
import os
import time
from datetime import datetime
import win32com.client as win32
import openpyxl as px
from tkinter import *
from tkinter import filedialog as fd
import os
import re
file_name='C:/Users/Default/Desktop/PyScript/PyScript/отчет.xlsx'
defrow=1
defcolumn=1
sheetnms=''
sheetl=[]
from tkinter import *
import shelve
import random
import time
import psycopg2
from configsql import *
class Watereat:
def __init__(self,name,energy,power):
USE [sqlnames]
GO
/****** Object: StoredProcedure [dbo].[sp_generatenames] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_generatenames]
@genvalue INT
AS