- Red
- Green
- Blue
See here…
| declare @ProjectID int, @SectionID int, @NewOrder int | |
| set @ProjectID = 48 | |
| set @SectionID = 36 | |
| set @NewOrder = 4 | |
| ;with NewOrder1 as ( | |
| select ID, [Order], rank() over (order by [Order]) as n, 1 as m | |
| from ProjectDescriptionSection | |
| where [Order] <= @NewOrder and ProjectID = @ProjectID and ID <> @SectionID | |
| union all |
| create view ProjectDescriptionSectionTags | |
| as select | |
| pds.ProjectID, | |
| cs.ID as SectionID, | |
| U.V.value('./text()[1]', 'nvarchar(100)') as Tag | |
| from ProjectDescriptionSection pds | |
| inner join ContentSection cs on cs.ID = pds.ID | |
| cross apply cs.XmlConf.nodes(N'//key') as T(K) | |
| cross apply T.K.nodes('../value/sequence/item') as U(V) | |
| where T.K.exist('.="tags"') = 1 |
See here…
| // load primary key data from PEM file with BouncyCastle lib | |
| var privrsa = new RSACryptoServiceProvider(); | |
| using (StreamReader sr = new StreamReader("../../rsakeys.pem")) | |
| { | |
| var pass = new Password("gDpfk2Em".ToCharArray()); | |
| var pr = new PemReader(sr, pass); | |
| var p = (AsymmetricCipherKeyPair)pr.ReadObject(); | |
| var o = (RsaPrivateCrtKeyParameters)p.Private; | |
| var rsaParams = new RSAParameters | |
| { |
| var CLIENT_ID = "<YOUR CLIENT ID>"; | |
| var CLIENT_SECRET = "<YOUR CLIENT SECRET>"; | |
| var provider = new NativeApplicationClient( | |
| GoogleAuthenticationServer.Description, | |
| CLIENT_ID, | |
| CLIENT_SECRET); | |
| IAuthorizationState state = new AuthorizationState(new[] { | |
| "https://www.googleapis.com/auth/drive", | |
| "https://www.googleapis.com/auth/userinfo.email" |
| import os | |
| import shutil | |
| ROOT = u'../path/to/folder' | |
| def group(by=100): | |
| files = sorted(os.listdir(ROOT), key=unicode.lower) | |
| groups = [] | |
| for i, f in enumerate(files): | |
| if not i % by: |
| import string | |
| import random | |
| def id_generator(size=8, chars=string.ascii_lowercase+string.digits): | |
| return ''.join(random.choice(chars) for x in range(size)) | |
| with open('data.tsv') as f: | |
| data = f.readlines() | |
| rows = [l.split('\t') for l in data] |
| import binascii | |
| import string | |
| msgs = [ | |
| binascii.unhexlify('315c4eeaa8b5f8aaf9174145bf43e1784b8fa00dc71d885a804e5ee9fa40b16349c146fb778cdf2d3aff021dfff5b403b510d0d0455468aeb98622b137dae857553ccd8883a7bc37520e06e515d22c954eba5025b8cc57ee59418ce7dc6bc41556bdb36bbca3e8774301fbcaa3b83b220809560987815f65286764703de0f3d524400a19b159610b11ef3e'), | |
| binascii.unhexlify('234c02ecbbfbafa3ed18510abd11fa724fcda2018a1a8342cf064bbde548b12b07df44ba7191d9606ef4081ffde5ad46a5069d9f7f543bedb9c861bf29c7e205132eda9382b0bc2c5c4b45f919cf3a9f1cb74151f6d551f4480c82b2cb24cc5b028aa76eb7b4ab24171ab3cdadb8356f'), | |
| binascii.unhexlify('32510ba9a7b2bba9b8005d43a304b5714cc0bb0c8a34884dd91304b8ad40b62b07df44ba6e9d8a2368e51d04e0e7b207b70b9b8261112bacb6c866a232dfe257527dc29398f5f3251a0d47e503c66e935de81230b59b7afb5f41afa8d661cb'), | |
| binascii.unhexlify('32510ba9aab2a8a4fd06414fb517b5605cc0aa0dc91a8908c2064ba8ad5ea06a029056f47a8ad3306ef5021eafe1ac01a81197847a5c68a1b78769a37bc8f4575432c198ccb4ef63590256e305cd3a9544ee4160ead45aef520489e7 |
| const string cs = "<CONNECTION_STRING>"; | |
| const string key = "<YANDEX_API_CODE>"; | |
| const string requestUrlTemplate = | |
| "http://geocode-maps.yandex.ru/1.x/" + | |
| "?geocode={0}&key={1}&&results=1"; | |
| var addresses = new List<string>(); | |
| using (var connection = new SqlConnection(cs)) | |
| using (var select = connection.CreateCommand()) | |
| { |