Posts

Flag MySQL table records based on a second table -

i have 2 tables: table has list of records. recordid datetime clientid 1 2017-07-01 17:20:21 1 2 2017-07-01 17:01:41 2 3 2017-07-01 17:20:30 1 4 2017-07-01 17:10:23 2 5 2017-07-01 17:01:20 2 6 2017-07-01 17:15:11 2 .... table b holds number of valid records client. clientid date validrecords 1 2017-07-01 1 2 2017-07-01 2 i need query takes number (n) table b , flag (1 or 0) amount (n) of records in table a. the expected result: recordid datetime clientid valid 1 2017-07-01 17:20:21 1 1 2 2017-07-01 17:01:41 2 1 3 2017-07-01 17:20:30 1 0 4 2017-07-01 17:10:23 2 1 5 2017-07-01 17:01:20 2 0 6 2017-07-01 17:15:11 2 0 client 1 has 1 correct record, other 1 0. client 2 has 2 correct records, others should marked 0. any ideas welcome...

sql - Msg 242: conversion of a varchar data type to a datetime data type resulted in an out-of-range value -

Image
i have gone through bunch of posts here error , tried changing data types , used convert nothing seems fix this. ask here. try give info, feel free ask if not enough. this getting error: insert prompt(id, date) select row_number() on (order b.idloc), [dbo].[fn_getgptime](cast (replace(datecollected, '/', '-') + ' ' + a.utctime datetime)) img inner join tloc b on a.filename = b.filename order b.idloc the date column in prompt table has datatype of float . utctime , datecollected both varchar(20) the error is: msg 242, level 16, state 3, line 274 conversion of varchar data type datetime data type resulted in out-of-range value. here function: [dbo].[fn_getgptime] (@utctime datetime) returns varchar(50) begin return (datepart (weekday, @utctime) - 1) * 86400 ---day + datepart (hour, @utctime) * 3600 ---hour + datepart (minute, @utctime) * 60 ...

java - getting "oauth_signature does not match expected value" error while authenticating tumblr -

i got request token (oauth_token , oauth_token_secret) using https://www.tumblr.com/oauth/request_token url. constructed authorize url using oauth_token got in previous step. when try access token using app consumerkey, consumersecret, , oauth_token , oauth_token_secret, getting "oauth_signature not match expected value" error message. message constructed hmacsha1, string signaturebasestring = "get&" + urlencoder.encode(accessurl, "utf-8") + "&" + "oauth_callback%3d" + urlencoder.encode(urlencoder.encode(redirecturl, "utf-8"), "utf-8") + "%26oauth_consumer_key%3d" + urlencoder.encode(consumerkey, "utf-8") + "%26oauth_nonce%3d" + urlencoder.encode(string.valueof(millis), "utf-8") + "%26oauth_signature_method%3d" + urlencoder.encode("hmac-sha1", "utf-8") + "%26oauth_token%3d" + urlencoder.encode(oauthtoken, "utf-8...

vb.net - How to let .NET know that I have an instance of the right class? -

let's suppose have a class viewermanager(of viewtable) and inside have a protected readonly property storedview viewtable which has get inside have this #region "view object properties" enum viewermanagertemplate unkown = 1 tblmemorizedfilterpage = 2 tblmemorizedaev = 3 end enum protected _managertemplate viewermanagertemplate = viewermanagertemplate.unkown protected readonly property managertemplate viewermanagertemplate if _managertemplate = viewermanagertemplate.unkown if pageid > 0 _managertemplate = viewermanagertemplate.tblmemorizedfilterpage else _managertemplate = viewermanagertemplate.tblmemorizedaev end if end if return _managertemplate end end property protected initializedstoredview boolean = false protected _storedview viewtable = nothing protect...

python - Pywinrm and Active Directory PowerShell cmdlets -

i encounter weird issue python code uses pywinrm module. let me explain bit. have linux server launch following python script: import winrm """create security group""" s = winrm.session('https://servername:5986/wsman', auth=(none, none), transport='kerberos', server_cert_validation='ignore') name = "test" path = "ou=security groups,dc=test,dc=org" ps_command = 'new-adgroup -name "{0}" -groupscope universal -groupcategory security -path "{1}" -server ldap.ubisoft.org'.format(name, path) r = s.run_ps(ps_command) if r.status_code == 0 : print(r.std_out.decode('utf-8')) else: print(r.std_err('utf-8')) this 1 connect on https listener of windows server (not dc) launch command of group creation. when launch ad cmdlet directly on windows server, works , security group created within ad. via script, have following response: $ python3 test_win...

php - Get the repeated values of the first character in a string -

i have strings similar one, $string = "01110111011101110111101110111110111111"; i need first character in string (in case, 0). need positions of occurrences of character in string. occurrences should put array first element being 1 (the first occurrence first character of string). for example, above string should produce array this, $return_value = array([0]=>1, [1]=>5, [2]=>9, [3]=>13, [4]=> 17....); this should trick, $string = "01110111011101110111101110111110111111"; $offset = 0; $return_value = array(); $character = substr($string, 0, 1); while (($offset = strpos($string, $character, $offset))!== false) { $return_value[] = $offset + 1; $offset = $offset + strlen($character); } var_dump($return_value); which return_value produce, array(8) { [0]=> int(1) [1]=> int(5) [2]=> int(9) [3]=> int(13) [4]=> int(17) [5]=> int(22) [6]=> int(26) [7]=> int(32)}

image processing - OpenCV HOG and SVM implementation -

Image
i trying use hog , svm methods find person walks under camera. working opencv train_hog example. changed size( 96, 160 ) size( 240, 240 ) in lines 433 437 438 , 442 because size of video (240x240). i use inria dataset negative samples , frames walking person video positive samples. after running train_hog.cpp, got no error. problem when give video input test_it() function, couldn't find same person walking around. what problem here? i have 100 positive sample. few? or problem default hog , svm parameters? (because didn't change parameters) or else? example pos sample: p.s : can done background subtraction want use hog , svm.