Posts

Showing posts from April, 2012

ios - swift unable to parse php data -

i have been trying fetch values database through poststring , doesn't return value. php tested , working fine, appreciated. below code. import uikit class displaydetailedviewcontroller: uiviewcontroller { var role = string() var date = string() var city = string() var mark_ref = string() override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() } func getdata(){ let myurl = url(string:"http://xxxxxx.co.in/xxxxx/show_report1.php") var request = urlrequest(url: myurl! url) request.httpmethod = "post" let poststring = "city=\(city)&date=\(date)&market_rep=\(mark_ref)" request.httpbody = poststring.data(using: string.encoding.utf8) let task = urlsession.shared.datatask(with: request) { (data: data?, response: urlresponse?, error: error?) in dispatchqueue.mai

c# - through exception while redirecting -

why debugger going catch block. what's issue?? kindly tell me. exception:"thread being aborted". protected void lnkresponse_click(object sender, eventargs e) { try { session["idticket"] = hfidticket.value; response.redirect("~/forms/ticketchat.aspx"); } catch (exception) { throw; } } response.redirect throws system.threading.threadabortexception exception. try using overload, response.redirect(string url, bool endresponse) passes false endresponse parameter suppress internal call response.end . response.redirect ("~/forms/ticketchat.aspx", false);

c# - error CS1525: Unexpected symbol `transform' -

hi i'm making game in unity using c# , want implement teleport on key-press mechanic i'm having issues code using system.collections; using system.collections.generic; using unityengine; public class teleport: monobehaviour { private transform player; void awake() { //find player object , set player = gameobject.findgameobjectwithtag("player").transform; } void update() { // checks if click space bar , gets -1, 0, 0 if (input.getkeydown(keycode.space) transform.position = new vector3 (-1, 0, 0); } } i'd appreciate if tell me whats wrong or improve mechanic , make better in way. you're lacking of ) here : if (input.getkeydown(keycode.space) player.position = transform.position = new vector3 (-1, 0, 0); which should : if (input.getkeydown(keycode.space)) player.position = transform.position = new vector3 (-1, 0, 0);

java - Spring Security: The authentication stays after server restart -

after restarted tomcat, found out authentication still there, have logged in again. however, after used clean tomcat work directory , authentication lost(switched anonymoususer ). so how spring security remember authentication between tomcat shutdowns? what in work directory related authentication removed? is related remember-me functionality? tomcat persists sessions between server restarts. can change behavior in tomcat configuration from tomcat docs whenever apache tomcat shut down , restarted, or when application reload triggered, standard manager implementation attempt serialize active sessions disk file located via pathname attribute. such saved sessions deserialized , activated (assuming have not expired in mean time) when application reload completed.

Add Library to php built-in -

i'm trying add library example( kint ) php built-in on local development server can use every in php without include (only development purposes). is possible (or other ways approach it)? thanks!

c# - CallMethodAction binding to Button fails -

there no errors. trying learn mvvm. setup simple. no output when clicking on button. xaml should ok since have produced interactions part in blend dragging behavior button. note: intention use methods, not command, since commands cover click, not example doubleclick. <window x:class="mvvm_1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:i="clr-namespace:system.windows.interactivity;assembly=system.windows.interactivity" xmlns:local="clr-namespace:mvvm_1" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" title="mainwindow" width="525" height="350" mc:ignorable="d" > <window.datacontext> <local:viewmodel/&

How to connect to a SQL Server database using PowerShell -

i working on powershell script supposed connect every morning company database, checking pending software approval requests in sccm, , sending emails concerned people allow them accept or refuse request link executes powershell script. my question of first step, connecting database. i created sql server account, able connect microsoft sql server management studio on server, doesn't connect script... i found code on this website , , people apparently saying working, timeout error when run : function getpendingrequests { param ( [string]$sqlserver, [string]$sqldbname, [string]$uid, [string]$pwd ) $sqlquery = "select * [database].[dbo].[userapplicationrequests]" $sqlconnection = new-object system.data.sqlclient.sqlconnection $sqlconnection.connectionstring = "server = $sqlserver; database = $sqldbname; user id = $uid; password = $pwd;" $sqlcmd = new-object system.data.sqlclient.sqlcommand $sqlcmd.commandtext = $sqlquery $sqlcmd.connect

wcf - Federated security, Single Sign On and security token sharing -

in single sign on (sso) scenario if applications running in same domain/company, is same security token shared among applications (relying parties) users authenticated same common identity provider / security token service? default behavior of sts? e.g. user logs on application x. after time, tries access application y. since authenticated same sts , if token issued still not expired, won't have provide credentials while accessing application y. my understanding may possible if token contains claims required relying parties / applications. practice? can token's (which issued when user logged on application x) expiry time extended/reset when user connects application y? wif implies adfs usually, yes long rp using same sts. no - in adfs, each rp has own claims configuration. token produced different (although copy configuration if wanted). in wif, yes. need use " sliding token " mechanism.

How to delete all the entities in Azure table? -

i've been working on deleting rows in azure table in java. can without querying it? in advance if retrieve data, can perform delete query on that? if want delete data, need retrieve pks , rks. after retrieved data of pks , rks, perform delete query entities 1 one. for complex delete query, example, below query not supported currently. delete tablename pk = '' i suggest submit idea on azure feedback site used features request. https://feedback.azure.com/forums/217298-storage

javascript - Enhanced Ecommerce Add To Cart Event Tracking Is Not Working -

for track add cart event use below code code not working please me fix out. ------not working----- ga('require', 'ec'); jquery(document).ready(function($) { jquery("#addtocart").click(function(e) { ga('ec:addproduct', { 'id': 'p12345', 'name': 'android warhol t-shirt', 'category': 'apparel', 'brand': 'google', 'variant': 'black', 'price': '29.20', 'coupon': 'apparelsale', 'quantity': 1 }); ga('send', 'event', 'event-category', 'add cart', 'event-lable','event-value'); }); });

echo - ICMP reply packets are exist, but cmd say "No ping" -

Image
i try ping device. device supports arp answer , icmp reply. send icmp request cmd. device receive 1 , fast reply back. wireshark see reply, cmd doesn't see , print "no reply". how can resolve problem? here it's cmd output also wireshark file attached.

c# - MySql Database connection in Universal Windows Platform application -

so have been trying mysql connection work in universal windows platform have not been successful. first issue was unable connector work because made for.netcore rather than.netframework. have found 1 getting issue needs have reference system.data version 2.0.0.0, however, uwp have version of system.data in core reference when reference system.data version 2.0.0.0 throws error 'reference type 'component' claims defined in 'system', not found ' sure next, in advance help! you should able utilise runtime version of mysql library mysql.data.rt.dll make connections , database. with winrt being based on .net core instead of full framework, lose features moving full assembly rt version such load balancing - these documented here: https://dev.mysql.com/doc/connector-net/en/connector-net-rt.html let me know if need more assistance

apache - Reference: mod_rewrite, URL rewriting and "pretty links" explained -

"pretty links" requested topic, explained. mod_rewrite 1 way make "pretty links", it's complex , syntax terse, hard grok , documentation assumes level of proficiency in http. can explain in simple terms how "pretty links" work , how mod_rewrite can used create them? other common names, aliases, terms clean urls: restful urls, user-friendly urls, seo-friendly urls, slugging, mvc urls (probably misnomer) to understand mod_rewrite first need understand how web server works. web server responds http requests . http request @ basic level looks this: get /foo/bar.html http/1.1 this simple request of browser web server requesting url /foo/bar.html it. important stress not request file , requests arbitrary url. request may this: get /foo/bar?baz=42 http/1.1 this valid request url, , has more nothing files. the web server application listening on port, accepting http requests coming in on port , returning response. web server entirely

Security rules Firebase -

Image
i'm struggling few security rules, have following setup: every user can create device. , every device can create room. relation between room , device in devices rooms table. want devices can join room. i thought give them devices rooms key in case kpt_1..... , need know 1 device uid in there chttrmpl9fe.... , when correct device can join room. approach? , how can implement in te security rules? and no don't have security rules right now, because don't know how @ way.

botframework - BOT Chat Framework error(404 not found) -

i have hosted simple bot chat on iis server, url being http://localhost:3978 . when access http://localhost/3978/api/messages . throws error "http error 404.0 - not found". when giving these end point in emulator , s unable connect , same message displayed. please can me on this you can't conect because need conect http://localhost:3978/api/messages not http://localhost/3978/api/messages , if failed , deploy in iis server, conect http://localhost/api/messages

Parallel stream java Sumarization -

java parallel streams perform every operation in parallel , return same result? e.g. intstream of = intstream.of(1, 2, 3); of = of.parallel(); int reduce = of.reduce(0, (a,b) -> + b); system.out.println("result: " + reduce); will return 6? i try give answer on questions: regarding example: of.reduce(0, (a,b) -> + b); will always return same result? (...always return 6?) => yes will always perform in parallel? => no regarding operations on java streams will always return same result? => no will always perform in parallel? => no # 1.quick answer # 1.1 regarding example: of.reduce(0, (a,b) -> + b); 1.1.1 return same result? yes, yield same result, no matter how run program. provided implementation of jvm , computer (hardware , os) working correctly. java asks use associative operation (you provided (+) ) , identity of set of integers (you provided 0 ). more information in background section.

architecture - Alternative to synchronous REST communication betweeen microservices -

i know synchronous communication between services anti-pattern, i'm searching solution use-case. i have 2 services: location service manages users location score service manages users score now, have build service: users feed service (ufs). has return users near given location, ordered score (descending). synchronous solution given location, ufs fetch nearby users location service (rest) for each 1 of them, gets score score service (rest) finally, sorts users in memory , return them what alternative? have been thinking this: event queue solution ufs stores users locations , scores in database, or memory cache or something it listens changes in queue update data when score service , location service publish in it this way, when client request users feed, users feed service don't have perform network request (it owns necessary data) is solution? how can improve it? scale in large amount of users? maybe have additional requirements you

Why is Mouse Pressed Event not working in TextArea of JavaFX? -

this code: @fxml private textarea txtconfig; public void handlemousepressed(mouseevent mouseevent) { txtconfig.setonmousepressed(new eventhandler<mouseevent>() { @override public void handle(mouseevent event) { system.out.println("pressed"); } }); } in fxml: textarea fx:id="txtconfig" style="-fx-font-size:10pt; -fx-font-family:consolas" maxwidth="infinity" maxheight="infinity" vbox.vgrow="always" onmousepressed="#handlemousepressed"/> however, setonmouseclicked working keeping same. only, onmousepressed changed onmouseclicked in fxml. public void handlemouseclicked(mouseevent mouseevent) { txtconfig.setonmouseclicked(new eventhandler<mouseevent>() { @override public void handle(mouseevent event) { system.out.println("clicked");

linux - Explanation of all columns in size command output? -

after executing size command got following output: size main.out text data bss dec hex filename 1207 552 8 1767 6e7 main.out i understood meaning of text , data , bss segment. what meaning of dec , hex columns? text gives size of text segment (or code segment). data gives size of data segment. bss gives size of block started symbol segment. dec size of text, data , bss size added in decimal, , hex same number in hexadecimal.

lambda - Serverless: The specified bucket does not exist -

i stupidly removed s3 bucket serverless project. when try , deploy or remove application error: the specified bucket not exist how can recreate s3 bucket serverless? i needed delete stack cloud formation, once done able re-run serverless deploy successfully.

xcode8 - Xcode 8.3.2 Iphone Simulator has white space on top -

Image
hi have 1 problem iphone simular , cannot figure out. i have white space on top in storyboard seems fine. simulator xcode storyboard image.

database - Saving variables in AnyLogic -

in anylogic, how can save variables excel file automatically after every time run simulation? have created dataset associating same variable (because variables not saved in log, used dataset) , can read in log after running simulation, need save automatically in excel file, each time don't need copy table log , paste excel. tried use database store variables seems complicated , couldn't work it! there 3 ways: save variable/dataset values custom database table insert query , export table excel automatic export feature ; create editable database view of log table (see creating own logs section here ), , setup same automatic export procedure. write variable value directly excel file excel connectivity tool (old-fashioned way, better use 1 or 2).

linux - libusb_submit_transfer no callback -

i'm setting first libusb asynchronous transfer never receive callback. i have connected library , can enumerate , open devices successfully. the functions being used set transfer (in order) follows: libusb_alloc_transfer() libusb_fill_bulk_transfer() libusb_submit_transfer() libusb_submit_transfer returns successful result expect see receive callback if returns error, none received. any suggestions wrong? libusb documentation states: in interest of being lightweight library, libusb not create threads , can operate when application calling it. application must call libusb it's main loop when events ready handled, or must use other scheme allow libusb undertake whatever work needs done. two integration levels proposed: simple : use blocking call application's main loop content advanced : can either request libusb descriptors , mix them yours, or register callbacks (libusb_set_pollfd_notifiers()) notified of added/removed descriptors.

c# - How to Choose Application Configuration File Save Location? -

Image
in visual studio 2013/2015, when compile program exe saves config file \bin\ folder. when move program exe location c:\program files\ , run it, saves config file %appdata% \appdata\local\ . using c# or visual studio settings, how tell exe save config file current folder , not %appdata% ? i want make program portable , not use %appdata% . \bin\ folder appdata folder you can change output path of build ... go project properties >> build tab >> under output section can change output path of build, creates build @ 1 place files , make portable

node.js - how to set enviroment variable value in pre-processor in webpack? -

i using webpack 2 , added preprocessor in it. passing node_env variable value command line. in java script able access value preprocessor condition getting failed please let me know how set argument value in preprocessor? here config file var debug = process.env.node_env !== "production"; var webpack = require('webpack'); var path = require('path'); module.exports = { context: path.join(__dirname, "src"), devtool: debug ? "inline-sourcemap" : null, entry: "./js/app.js", module: { loaders: [ { test: /\.jsx?$/, exclude: /(node_modules|bower_components)/, loader: 'babel-loader!preprocess-loader?+debug', // query: { // presets: ['react', 'es2015'], // plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy'], // } }, { test: /\.css$/, loader: &

c++ - LNK1104: Cannot Open File "\include.obj" - OpenCV -

i'm new open cv. i've used 3.2.0 version , visual studio 15. i've followed same installation procedures recommended online. so i'm trying run image threshold tutorial ( http://docs.opencv.org/2.4/doc/tutorials/imgproc/threshold/threshold.html ) , when build above error. i'm bit lost in debugging , can't find similar error this. have added pictures setup here check if there errors in setup. current linker setup it seems project settings not set properly. first, check include directories in section configuration properties->c/c++->general->additionals include directories than, linking configuration properties->linker->general->additionals library directories refer opencv documentation details , similar questions ( like this or this ) more detailed answers , values of settings. update: i have looked @ picture referenced in question. , found value $(opencv_root)\include in section additional dependencies

applescript - JXA: Create a mailbox in Apple Mail -

i trying create sub-mailbox in apple mail using javascript. i have following code snippet (parent reference mailbox in want new mailbox): var mb = mail.mailbox({name: "subfolder"}); parent.mailboxes.push(mb); the events log shows: app = application("mail") app.mailboxes.byname("local").mailboxes.byname("archive").mailboxes.push(app.mailbox({"name":"subfolder"})) --> error -10000: appleevent handler failed. what doing wrong? thanks, craig. code now: var mb = mail.mailbox({name: "local/archive/test archive/subfolder"}) logger.logdebug("mb = '" + automation.getdisplaystring(mb) + "'."); mail.mailboxes.push(mb) // create subfolder this works long there no spaces in path. tried force space using \\ in front of it, "test\ archive" name. so how space in name work? thanks. to create sub-folder, need name posix path --> &

Remove post method and initialize for each loop in php codeigniter -

Image
i want remove input->post @ line $attain = $this->input->post('mytext', true); .itried many ways errors display. how can rid of post method? $attain = $this->input->post('mytext', true); $data2=array(); //<-initialize foreach ($attain $i => $a) { // need index match other properties //append array $data2[] = array( 'mytext' => $a, 'projectname'=> $this->input->post('projectname'), ); //for multiple entry in same table $this->db->insert_batch('projectem', $data2); //} } this view user produce dynamic inputs </script> <script type="text/javascript"> $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //fields wrapper

sql - Reject a row based on 2 column values -

below output of simple join query. 3 columns different tables. col1 col2 col3 manual y-yes include mc y-yes include manual y-yes exclude manual y-yes exclude i need rows 'include' if there no 'exclude' same col1 value. if there no 'exclude' col1 value, fine display 'include'. so query should not display first row according requirement since col1 value 'manual' has 'exclude'. your sql query should lot question in english: want rows there no row same col1 value has 'exclude' in col3 value, right? cannot give exact sql since not provide table or column names, if 3 columns in same table, this: select * mytable not exists (select * mytable col1 = t.col1 , col3 = 'exclude')

express - Passport-jwt token get error messages from server -

i cannot figure out how pass error messages server client. searched docs, cannot should implement callback function return error message. my server-side code looks this: passport.js var locallogin = new localstrategy(localoptions, function(email, password, done){ user.findone({ email: email }, function(err, user, info){ if(err){ return done(err); } if(!user){ return done(null, false, {message: 'user not found'}); } user.comparepassword(password, function(err, ismatch){ if(err){ return done(err); } if(!ismatch){ return done(null, false, {message: 'passwords not match'}); } return done(null, user); }); }); }); router.js > var requireauth = passport.authenticate('jwt', {session: false}), > requirelogin = passport.authenticate('local', {session: false}); > > module.exports = function(app){ > > var apiroutes = express.router(), > authroutes = express.router(), > todor

c# - How to group by DateTime.Date in EntityFramework -

i have device model: public class devicemodel { public datetime added { get;set; } } and want select devices count, grouped added date ( not date , time, date ). current implementation not valid, because linq can't translate datetime.date sql: var result = ( device in devicesrepository.getall() group device new { date = device.added.date } g select new { date = g.key.date, count = g.count() } ).orderby(nda => nda.date); how change query make work? well, according this msdn document, date property supported linq sql , i'd assume entity framework supports well. anyway, try query (notice i'm using truncatetime method in order avoid resolving date repeatedly): var result = device in ( d in devicesrepository.getall() select new { device = d, addeddate = ent

cypher - neo4j all relations to certain depth between 2 sets -

playing simple neo4j queries. base match : match (:movie { id: '10' })-[*0..3]-(p:producer) return p.id this returns results, there relations between movie-10 , producer. part of result set is: 'producer_12' 'producer_18' 'producer_36' ......... now want return relations between movie-10 , producer_12 or producer_18 3 hops. modified match. match (:movie { id: '10' })-[*0..3]-(p:producer) p.id in ['producer_12', 'producer_18'] return p.id and doesn't return value, while expected producers 12 , 18 in answer. besides can't find way label relation. not accepted. [r:*0..3]. my final query must relations between 2 sets (movies 10, 12 or 15) , (producers 12 or 18) example. i simulated scenario here. the sample data: create (movie:movie {id : '10'}) create (producer12:producer {id:'producer_12'}) create (producer18:producer {id:'producer_18'}) create (producer36:producer {id:

java - Selenium WebDriver throws org.openqa.selenium.remote.UnreachableBrowserException while running test cases in parallel using testNG -

while running test cases in parallel using testng "unreachablebrowserexception" throwing whereas if parallel="false" given test cases executing succesfully. testng version: 6.9.10 selenium java: 3.0.1 chrome version: 58.0.3029.110 chrome driver version: 2.29 testng xml: <?xml version="1.0" encoding="utf-8"?> <!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="suite" parallel="classes" thread-count="2" verbose="5"> <test name="test"> <classes> <class name="testscripts.loginscenario.paralleltwo"/> <class name="testscripts.loginscenario.parallelone"/> </classes> </test> <!-- test --> </suite> <!-- suite --> testng failure exception org.openqa.selenium.remote.unreachablebrowserexception: not start new session. possible causes invalid address of

java - What happens in system.out.print with empty quotations marks and no String assignment? -

i'm reading "head first java". code below 1 of exercises. idea figure out possible output. there's 1 thing don't understand however. within system.out.print couple of empty quotations used thought quotations used strings , in code example below there no strings ? doing here, how should read it? class test { public static void main(string[] args) { int x = 0; int y = 0; while ( x < 5 ) { y = x - y; system.out.println(x + "" + y + " " ); x = x + 1; } } } i can't sure of idea of guy whi make course, + "" + can avoid addition of 2 ints , in fact if concatenate instead of addition 2 ints : system.out.println(x + "" + y + " " ); for example : x + "" + y : going print 00 11 21 32 42 (with new lines of course between each) x + y : going print 0 2 3 5 6 (with new lines of course between eac

bash - Another way to use a variable readed and passed as argument inside a function -

the script works there way same result without using "tmp" varaible ? thanks function ask_version () { while true ; echo -e "give version of" $1 local tmp=$2 read -r tmp if [[ ! $tmp =~ ^[0-9]$ ]] ; echo -e "please respect number format" elif [[ $tmp -ne $t ]] ; echo -e "it not true number" else return 0 fi done } ask_version "app1" "app1version" ask_version "app2" "app2version" here's functional version of think you're after: function ask_version () { while true ; echo -e "give version of $1" read -r if [[ ! $reply =~ ^[0-9]$ ]] ; echo -e "please respect number format" elif [[ $reply -ne $2 ]] ; echo -e "it not true number" else return 0 fi done } ask_version "app1" 5 ask_version "app2" 6 it not use tmp variable; instead, relies on read 's default variable reply , , compares fu

php - View path return error 401 Bad credentials -

i building web api , stuck following issue. when call following path : localhost:8000/add browser returns code":401,"message":"bad credentials here code: defaultcontroller.php (src/appbundle/controller/defaultcontroller.php) class defaultcontroller extends controller { /* * @route("/add", name="add_user") */ public function addaction() { $number = mt_rand(0, 100); return new response('lucky number: '.$number.' ' ); } } routing.yml (app/config/routing.yml) add_user: path: /add defaults: { _controller: appbundle:default:add } any appreciated. the bad credentials message tells security behind api , should use credentials access api. and in opinion should return jsonresponse instead of response

sql server - TSQL querying xml with namespace -

i've been searching solution problem. want retrieve data xml column. here data: <notification xmlns="http://model.company/notification/de/v1" datenotification="2017-07-24t11:47:51.012+02:00" identifiant="4b7330c7-021f-4cf9-ace6-f74d73f409ef" personneid="1071249" source="regles" sourceversion="1.0.17" typemouvement="modification"> <evenementde xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" referenceoriginale="1071249" xsi:type="changementsignaletique"> <champ anciennevaleur="doe" nom="nom" nouvellevaleur="doe" /> </evenementde> <evenementde xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" referenceoriginale="1071249"

unity3d - Blender to unity problems -

Image
i have few problems importing character blender unity. first of these images of character inside unity (idle state) , in blender(how should look). unity: blender: so guess 1 of problems double sided mesh. checked double sided not working how can fix it. second problem guess weights. looks unity not getting weights how should have have idea problem there. i trying avoid 3d modeling since have done game considering engine, had start learning blender , not laugh because second character (first 1 blank white mesh) :p. the solution 1 sided duplicate object , scale little down. problem edges figure out later. for second 1 bone weights problem, imported .blend file unity , worked (since importing .fbx) beter solution second one: add solidify , it's thickness property job.

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&qu

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.

c# - Remote validation with a select input in MVC CORE -

hy , thank taking time read question. i'm working on mvc core website , i'm try add remote validation entity framework on select input. unfortunately seems doesn't work... here code : html select --> <select asp-for="idsociety" asp-items="@(new selectlist(@viewbag.listofsociety,"id", "name"))"></select> c# viewmodel --> [remote("verifynameservice", "parameter", additionalfields = "servicename", errormessage = "ce nom de service existe déjà pour cette société !")] public int idsociety { get; set; } thank in advance help. i believe have arguments backwards. it's trying call action named verifynameservice on controller named parameter . here constructors remoteattribute in core: public remoteattribute(string routename); public remoteattribute(string action, string controller); public remoteattribute(string action, string controller, stri

cloudfoundry - Deploying Shiny app on Bluemix through Cloud Foundry : Fails at 15 mins -

i trying deploy r shiny application on ibm bluemix through cloud foundry. however, fails after 15 minutes every time. attempted change time cf_staging_timeout , cf_startup_timeout variable, did not help. i not sure how fix issue. below parameters defined in mainfest.yml file: --- applications: - name: myshinyapp memory: 500m instances: 1 buildpack: git://github.com/beibeiyang/cf-buildpack-r.git env: cran_mirror: https://cran.rstudio.com cf_staging_timeout: 60 cf_startup_timeout: 60 the env parameters in manifest.yml file valid application container only. change cf_staging_timeout , cf_startup_timeout value have export them in shell (or command line) running cf command line: for example, if using unix, linux or mac: export cf_staging_timeout=60 cf push myapp

python - Adding weights when using lmfit to fit a 3D line on a cloud of points -

i using following code fit 3d line on cloud of 3d points. using least squares method of lmfit minimize. i need add weights different points , not know how when using array (and not scalar ) distance output. problem when using scalar is not when using array. assume because of larger number of variables. so question - there way add weights each element of array minimizer ? using nelder w/scaral input not perform 3d fit well. from lmfit import minimize, parameters, parameter,report_fit,fit_report, minimizer, printfuncs import numpy np #parameters params = parameters() params.add('y1', value= 0) params.add('x0', value= 129) params.add('x1', value= 0) params.add('y0', value= 129) params.add('y1', value= 0) #function calculating point-line distance def fun(params,x,y,z): x0 = params['x0'].value; x1 = params['x1'].value; y0 = params['y0'].value; y1 = params['y1'].value distance = []

How to remove first element from every sub-array in 2-Dimentional class numpy.ndarray in Python -

i have numpy.ndarray - [[1,2,3],[-7,7,2],[2,-3,4]] i want remove first element of each array , convert [[2,3],[7,2],[-3,4]] is there function can this, rather having use explcit for loop?

tensorflow.python.framework.errors_impl.NotFoundError while generating TFRecord files Object Detection API -

i trying generate tfrecord files pascal voc format dataset. following this guide , used this instructions create pascal_train.record and pascal_val.record . i have prepared annotations, images , image sets in imagesets -> main . generated label map in pascal_label_map.pbtxt . now, when run following command tf_worspace/models : python3 object_detection/create_pascal_tf_record.py \ --label_map_path=object_detection/data/pascal_label_map.pbtxt \ --data_dir=vocdevkit --year=voc2012 --set=train \ --output_path=pascal_train.record i get: file "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.tf_getcode(status)) tensorflow.python.framework.errors_impl.notfounderror: vocdevkit/voc2012/imagesets/main/marlboro_red_train.txt my project structure follow: tf_workspace models (tf staff here...) object_detection vocdevkit voc2012 annotatio

python 2.7 - Parallel Processing of (Stratified) K-fold Cross Validation of a Keras LSTM model -

i know parallel processing of stratified k fold cross validation of keras lstm model should possible theoretically, uncertain how go it. want use parallel processing speeding computation time processing multiple evaluation folds @ time. i implementing k fold cross validation keras model seen in this github issue comment . using pathos.multiprocessing.processingpool.map . works simple perceptron, fails lstm setup following error: valueerror: tensor("embedding_1/embeddings:0", shape=(3990, 300), dtype=float32_ref) must same graph tensor("model_1/embedding_1/cast:0", shape=(?, 49), dtype=int32). i have tried using keras.backend.set_learning_phase have had no luck in have put (setting 1 when doing model fit, 0 when evaluationg in train_and_eval() , moving setting 1 before create_model() called). have tried running code with tf.graph().as_default(): . the code setup located @ gist reference , including perceptron code. missing embedding code different fil

"instance member cannot be used on type" error on Swift 4 with nested classes -

i have class nested class. i'm trying access variables of outer class within nested class: class thing{ var name : string? var t = thong() class thong{ func printme(){ print(name) // error: instance member 'name' cannot used on type 'thing' } } } this however, gives me following error: instance member 'name' cannot used on type 'thing' is there elegant way circumvent this? hoping nested classes capture lexical scope, closures do. thanks you this class thing{ var name : string = "hello world" var t = thong() init() { t.thing = self t.printme() } class thong{ weak var thing: thing! func printme(){ print(thing.name) } } }

spring boot - Internal Server error -- Java.lang.RuntimeException:java.io.IOException: Missing initial multipart boundary, -

i trying upload picture file system. using spring boot , jetty server. getting internal server error -- java.lang.runtimeexception:java.io.ioexception: missing initial multipart boundary when trying upload picture. following piece of code @requestmapping(value = "/setprofilepic", method = requestmethod.post) public datumresponse<identry> setprofilepic(@requestparam("file") multipartfile file, httpservletrequest request) { datumresponse<identry> response = new datumresponse<identry>(); if (file.isempty()) { response.setdata(new identry("file not uploaded")); return response; } try { // file , save somewhere byte[] bytes = file.getbytes(); path path = paths.get("/data/pic/" + "myfile" + ".jpeg"); files.write(path, bytes); response.setdata(new identry("you uploaded")); system.out.println("

constructor - JAVA call factory methods implicitly -

i have 1 constructor , 1 factory method date class. first 1 have 3 int parameter represent month, day , year. , second one, provide in case user give string 1 parameter represent month/day/year. as can see in main(), forget call parseit, factory method. compiler still provide correct result. question is: can java call factory method implicitly? please take 1st constructor , 2nd factory methods: import java.io.*; class date { private int month; private int day; private int year; public date(int month, int day, int year) { if (isvaliddate(month, day, year)) { this.month = month; this.day = day; this.year = year; } else { system.out.println("fatal error: invalid data."); system.exit(0); } } public static date parseit(string s) { string[] strsplit = s.split("/"); int m = integer.parseint(strsplit[0]); int d = integer.parseint(strsplit[1]); int y = integer.parseint(strsplit[2]); retu

ios - Check user settings for Check Spelling and Autocorrect -

i make switch turning on/off autocorrect , checkspelling function in uitextview . as far know when user disabled checkspelling in ios (settings > general > keyboard > check spelling) there no way turn on programatically. apple says spellcheckingtype override iphone settings. as turns out doesn't. it works when user have autocorrect , checkspelling turned on, can turned off programatically, sadly other way around it's not working. so there way check if user has turned off these properties in ios settings? provide kind of feedback user how can turn them on.