Posts

Showing posts from February, 2011

azure - U-SQL error while table rebuild -

Image
error occurs when call alter table rebuild in 1 stored procedure , try select data in simultaneously. create procedure if not exists rebuildcontent() begin insert dbo.log (date, message) values ( datetime.utcnow, "starting content table rebuilding ..." ); alter table dbo.content rebuild; alter table dbo.contentcrc rebuild; insert dbo.log (date, message) values ( datetime.utcnow, "completed content table rebuilding ..." ); end; are there solutions avoid it? thank in advance! you running race condition between rebuilding , reading same table. rebuilding table creates new file compacting files got created insertion. unfortunately right now, once rebuild deleting old file, lose access old version , error message. we aware of issue , have created work item preserve access old file started queries (providing snapshot semantics). however, not have eta @ moment. thus until then, please schedule rebuild , read jobs without overlaps. note: c

authentication - Firebase Internal Error Occurred [Bad Request] - Email Auth -

i continue receive error when using createuserwithemailandpassword or signinwithemailandpassword. both throw "an internal error has occurred. [ bad request ]" error , can't figure out why. of api , sha1 keys between google api , firebase api match , have email/password authentication enabled. here's snippet of code, can't figure out why happens. public void signin(string email, string password) { mauth.signinwithemailandpassword(email, password) .addoncompletelistener(new oncompletelistener<authresult>() { @override public void oncomplete(@nonnull task<authresult> task) { if (task.issuccessful()) { //on successful sign in... //take user mainactivity intent intent = new intent(getcontext(), mainactivity.class); startactivityforresult(intent, 1); dialogfragment.dismissallowingstateloss(); } else { //if user ca

How to install @angular/cli in Putty shell? -

i trying install angular/cli using command in putty: npm install -g @angular/cli but failed , run through these error messages: permission denied (publickey). fatal: remote end hung unexpectedly cound not install angular/cli error: enoent, stat 'angular/cli' how fix issue? tia it saying permission denied -g installing thing globally not have enough rights install package globally. matter need research on error permission denied (publickey) hosting/cloud service provider. however if deploying angular cli app on server not have install angular cli globally anyway. if build server or npm install or yarn first , run command npm run ng -- build --prod run local version of angular cli specified in package.json wiki

Calling Transform component of an object in another class C# -

i working on tutorial , "side objectives" don't walk through try , feel it. so, way things work @ time there player object. player object has player script. public class player : monobehaviour { private animator anim;//reference animator component private rigidbody rigidbody;//reference component rigidbody private audiosource audiosource; [serializefield] private float force = 100f; [serializefield] private audioclip sfxjump; [serializefield] private audioclip sfxdeath; } void awake() {//these assertions ensure when writing cocde wont miss them. use team work. assert.isnotnull (sfxjump); assert.isnotnull (sfxdeath); } private bool jump = false; //check jump // use initialization void start () {//all these getting components @ start update them code goes onwards. anim = getcomponent<animator> (); rigidbody = getcomponent<rigidbody> (); audiosource = getcomponent<audiosource> (); positionstart = getcomponent<tra

javascript - Scroll to top button won't work when implement to PHP -

i no means web developer forgive me if missing blindly obvious. trying add scroll top button this awesome guy static html site , work when splitting 2 parts put <head> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> <div class='thetop'></div> and rest <footer> <div class='scrolltop'> <div class='scroll icon'><i class="fa fa-4x fa-angle-up"></i></div> </div> <script> $(window).scroll(function() { if ($(this).scrolltop() > 50 ) { $('.scrolltop:hidden').stop(true, true).fadein(); } else { $('.scrolltop').stop(true, true).fadeout(); } }); $(function(){$(".scroll").click(function(){$("html,body").animate({scrolltop:$(".thetop").offset().top},"1000");return false})}) </script> so when trying implement php,

java - jCalendar cell coloring -

i coloring jcalendar cell's background mentioned here have stored date employees id when present , saving dates in resultset variable result , coloring date cells green. upto code working fine, when tried color sundays blue , rest of dates when employee absent red, it's not working. here i'am pasting code- presenthighlightevaluator pevaluator = new presenthighlightevaluator(); holidayhighlightevaluator hevaluator = new holidayhighlightevaluator(); absenthighlightevaluator aevaluator = new absenthighlightevaluator(); string dburl = "jdbc:derby://localhost:1527/contact;user=nbuser;password=nbuser"; connection conn = null; statement stmt = null; try { class.forname("org.apache.derby.jdbc.clientdriver").newinstance();; //get connection conn = drivermanager.getconnection(dburl); stmt = conn.createstatement(); resultset result = stmt.executequery("sele

java - javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: driver for class: Script1 -

script written in jsr223 + groovy sampler in jmeter load testing. when run code multiple threads(users) of them passed , other failed , shows error message: javax.script.scriptexception: groovy.lang.missingpropertyexception: no such property: driver class: script1 import org.openqa.selenium.by import org.openqa.selenium.javascriptexecutor import org.openqa.selenium.phantomjs.phantomjsdriver import org.openqa.selenium.phantomjs.phantomjsdriverservice import org.openqa.selenium.remote.desiredcapabilities import org.openqa.selenium.support.ui.expectedconditions import org.openqa.selenium.support.ui.webdriverwait boolean result=true; try { file src=new file("projects\\phantomjs.exe"); system.setproperty("phantomjs.binary.path", src.getabsolutepath()); driver=new phantomjsdriver(); driver.manage().window().maximize(); driver.get("https://rx.vurvhealth.com/vurv_server/&

security - Which method is secure for accessing the AWS services? -

other aws console, there multiple ways access aws services. aws cli(awscli/awspowershell) aws sdk rest api out of these 3 methods secure one? consider thinking way - if working awscli, need store credentials using command aws configure . i know, without passing credentials(accesskey , secretkey) sdk,cli , api, cant access aws services. hope still other way there access/manage services. in end of these ways call aws apis, perspective equally secure. there differences in use of features of apis though. while aws cli supports mfa authentication, sdks (e.g. boto3 does , aws-sdk-js doesn't yet ) , accessing apis directly have implement yourself. wiki

javascript - Submit Button by Agreeing on Terms and Condition load new page -

i reading on few other submit button post on here need assistance getting 1 load new page upon accepting "terms , conditions" <script type="text/javascript"> function checkform(form) { if(!form.terms.checked) { alert("please indicate accept terms , conditions"); form.terms.focus(); return false; } return true; } </script> for html have <form onsubmit="return checkform(this);"> <p><input type="checkbox" name="terms"> accept <u>terms , conditions</u></p> <p><input type="submit"></p> </form> now when select submit after checking box want direct them new page(the 1 trying before being redirected terms of service page). if change url of current page, can use following code: document.location.href = "http://example.com"; however, if create new page, can use code: var win = windo

Why is this generic method to find the largest in a Java array not compiling? -

i'm trying learn generics in java, , would've thought method work finding largest in array: public static <t> t largestinarray(t[] inputarray){ t largest = inputarray[0]; (int = 1; < inputarray.length - 1; i++){ if (inputarray[i] > largest) largest = inputarray[i]; } return largest; } but error saying: bad operand types binary operator '>' how should this? you can use comparison operators on numeric types. if want compare generic types, you'll have ensure implement comparable , , call comparable.compare() : public static <t extends comparable<? super t>> t largestinarray(t[] inputarray) { //... if (inputarray[i].compareto(largest) > 0) { //... } compareto() return 0 equal values, < 0 if target object has precedence, , > 0 if argument has precedence. alternatively, can use custom comparator instead of relying on natural order: public static <t> t largest

swift - Crash when assigning items to a UITabBar -

Image
if put exception breakpoint (all exceptions) in xcode, breaks on tabbar.items strange reason. func application(_ application: uiapplication, didfinishlaunchingwithoptions launchoptions: [uiapplicationlaunchoptionskey: any]?) -> bool { let tabbar = uitabbar() let item = uitabbaritem(title: "", image: uiimage(), selectedimage: uiimage()) tabbar.items = [item] // --- breaks here return true } however, if create empty project , put same lines, won't crash. figure must project. how debug this? wiki

Exception error(java.lang.ClassCastException) from jenkins with testlink plugin integration -

i encounter problem jenkins testlink plugin integration. have configured testlink plugin needed , setup execution type automated & custom filed in testlink server. failed show below console log when start build jenkins. have know why show error log? there setting have lost? thanks advise! version: jenkins: v2.60.2 testlink plug-in: v3.12 testlink: v1.9.2 console log: > error: build step failed exception java.lang.classcastexception: > [ljava.lang.object; cannot cast java.util.map @ > br.eti.kinoshita.testlinkjavaapi.util.util.casttomap(util.java:603) > @ > br.eti.kinoshita.testlinkjavaapi.testprojectservice.gettestprojectbyname(testprojectservice.java:115) > @ > br.eti.kinoshita.testlinkjavaapi.testlinkapi.gettestprojectbyname(testlinkapi.java:451) > @ > hudson.plugins.testlink.testlinkbuilder.gettestlinksite(testlinkbuilder.java:333) > @ > hudson.plugins.testlink.testlinkbuilder.perform(testlinkbuilder.java:206) >

How to ebable package filtering in Android Studion -

for reason logs without package name. , package wiltering not work 08-23 13:12:26.335 22767-22767/? e/new_bhd: cannot run on production devices! basicly tried steps solution tried enable , disable tools> android >enable adb integration. tried restart adb service, both before , after `enable adb integration' i tried set debugable application on developers option app. attack debuger ok button inactive. http://joxi.ru/p2717vbc0n3zbr android studion version: 2.3.3 wiki

ios - Selecting multiple contacts/contact properties in CNContactPicker -

i'm using predicates defined here: how can pick contact phone number in ios? . contactspicker.predicateforenablingcontact = nspredicate(format:"phonenumbers.@count > 0") contactspicker.predicateforselectionofcontact = nspredicate(format: "phonenumbers.@count == 1") contactspicker.displayedpropertykeys = [cncontactphonenumberskey] i have defined following delegate methods: func contactpicker(_ picker: cncontactpickerviewcontroller, didselect contactproperty: cncontactproperty) { print(contactproperty) } func contactpicker(_ picker: cncontactpickerviewcontroller, didselect contact: cncontact) { print(contact) } the behavior expect user gets pick phone number properties multiple different contacts , when user clicks done, list of these properties , contacts. unfortunately, code above exits picker when user clicks done. means user cannot select multiple phone numbers and/or multiple contacts , can select 1 before picker exi

javascript - Casting for element access in Haxe for HTML-elements -

if want draw on canvas need 2d context of it. have canvas element in index.html of project: <body> <canvas id="canv" width="200" height="200"></canvas> </body> so need access element, ok, let's write code: var cans:canvaselement = browser.document.getelementbyid("canv"); and in compile phase error: src/main.hx:32: characters 2-78 : js.html.element should js.html.canvaselement but if use unsafe casting, fine: var cans:canvaselement = cast browser.document.getelementbyid("canv"); and works fine, access , can 2d context or make settings like: cans.width = cans.height = 800; cans.style.backgroundcolor = 'rgba(158, 167, 184, 0.4)'; yes, know, "if works - don't fix", , understand normal, in principle need, when cast, can explain process me? mean - js.html.element should js.html.canvaselement ? i'm started haxe learning (and programming in particular), i&#

javascript - This keyword when function is called from hyperlink -

i have many links on web page used this: <a href="javascript:test.test(this);">testing</a> with this keyword expecting html element owner of function. but, shows me window object instead. why that? how can (with code used above) html element, owner of function? on web page, html structure more complex. every hyperlink inside other element, if this showing current element, easy parent element. var test = function(){ var test = function(element){ debugger; } return { test: test } }(); <div data-iuser_key='49499'> <a href="javascript:test.test(this);">testing</a> </div> what did expect? code run inside javascript: , has no reference target element. default this refers window . instead, use proper click handler: <a href="#" onclick="test.test(this)"> wiki

php - does silex make new database connection for every request? -

i'm new silex/php. have following snippet in index.php. $app->register(new \silex\provider\doctrineserviceprovider(), array( 'db.options' => $dbconfig )); dbconfig - configurable (pdo_sqlite or pdo_mysql). silex run under lighttpd php-fpm. i have following questions: does silex create "new" database connection every request? if so, how 1 optimize performance old/existing connection used? if new connection not made, how can 1 change existing connection 1 other particular "app" instance when database configuration changes? in case, please assume "app" 1 process configuration change , gets know it. thanks in advance. wiki

wordpress - My woocommerce cart items delete not working properly -

all have serious problem regarding woocommerce cart system. cart items not deleting time , products, sometime deletes , remove doesn't. it seems products first added cart not deleting every time. https://amplefoodstore.com.au/ website url. have used default wp theme if it's causing because of themes woocommerce files, deleted woocommerce plugins directory plugins , added fresh woocommerce files. no luck on there. wiki

c# - Detect if WPF application is running or in Visual Studio windows visualizer -

i have wpf application opens popup when main window loaded. problem when select .xaml file in solution explorer in visual studio 2013, the popup "pops" when application not running . suppose intended behavior since visualizer needs execute code in order render page layout, need close every time load page... cannot temporarily disable popup since has start logic application (selection of location,...). here code of popup trigger public generalprocess() //usercontrol { initializecomponent(); loaded += generalprocess_loaded; } void generalprocess_loaded(object sender, routedeventargs e) { var popup = new stationselect(); popup.owner = window.getwindow(this); popup.showdialog(); } is there way know if application running or if in visualizer, or there way disable loaded event visual studio ? goal still able see page easy editing. edit : question duplicate. this answer worked me. void generalprocess_loaded(object sender, routedeventargs

node.js - mkdir command not working properly in child_process exec -

i trying create folders. e.g folder1 --> folder2. below code snippet executes folders not created in level deep. created in same level. running code in windows machine. var exec = require('child_process').exec; exec('mkdir folder1\folder2' , function(err, strdout, stderr){ if(err) console.log("folder creation err:" + err) }) code output: root folder: folder1 older2 can me out fix this? wiki

python - Sort rows and get column IDs in a pandas dataframe -

with given pandas dataframe, i'd create new columns highest, second highest, third highest, etc... values in row. , create column corresponding column name of each of those. code below max value of row, not follow. adapted find column name has maximum value each row import pandas pd df = pd.dataframe({'a': (23, 24, 55, 77, 33, 66), 'b': (12, 33, 0.2, 44, 23.5, 66), 'c': (1, 33, 66, 44, 5, 62), 'd': (9, 343, 4, 64, 24, 63), 'e': (123, 33, 2.2, 42, 2, 99)}) # determine max value , column name , add columns df df['max1'] = df.max(axis=1) df['col_max1'] = df.idxmax(axis=1) # determine 2nd , 3rd max pr , threshold levels , add columns # ??????????? print(df) this produces: b c d e max1 col_max1 0 23 12.0 1 9 123.0 123.0 e 1 24 33.0 33 343 33.0 343.0 d 2 55 0.2 66 4 2.2 66.0

bash - How to deal with a large number of pages in Angular 2? -

i'm new angular 2+. i want create application 121 html pages (actually ionic3 stories application, 1 story on 1 html template). in case, must use cli ng generate 121 components or have way faster? please me. help. its hard without seeing templates. if sure need run generate component command many times, can ex: n=1; while [[ $n -lt 3 ]]; ng g c component${n}; n=$((n+1)); done wiki

java - Spring MVC: Cannot convert value of type String to required type Category for property 'category' -

i have class named project has attribute category. classes project , category have one-to-many relationship. public class project { @manytoone(fetch = fetchtype.lazy) @joincolumn(name="category_id") private category category; public class category { @onetomany(fetch=fetchtype.lazy, mappedby="category") private set<project> project = new hashset<project>(0); in jsp have dropdown select category specific project <select class="form-control" name="category" > <c:foreach items="${categorieslist}" var="category"> <option value="${category.id}"><c:out value="${category.category_name}" /></option> </c:foreach> </select> and controller looks so @requestmapping(value = "/client/post_project", method = requestmethod.post) public string postproject(@modelattribute("project") project p){ projectservice.a

ios - How to set Authorization header in AlamofireImage? -

i need download image authorization header. alamofireimage not working authorization header. not execute in debug checkpoint line let url = url(string: urlstring) var request = urlrequest(url:url!) request.setvalue("image/png" , forhttpheaderfield: "content-type") // adding common parameters// if global.account?.token != nil { request.setvalue(global.account?.token ?? "" , forhttpheaderfield: "authorization") } var _urlrequst : urlrequest? do{ _urlrequst = try alamofire.jsonencoding.default.encode(request) }catch let error { print(error) } let downloader = imagedownloader() downloader.download(_urlrequst!) { response in print(response.request) // debug checkpoint print(response.response) debugprint(response.result) if let image = response.result.value { print(image) } } the fact debugger never sto

c++ - DS18b20 fail to read -

i wrote small program in arduino read temperature ds18b20 , transfer nrf24l01. used arduino ng atmega8 mcu compile , burned hex file atmega8 on breadboard. works fine except readings of ds18b20. please take @ code , tell me if there wrong? #include "rf24network.h" #include "rf24.h" #include "onewire.h" rf24 radio(10,9); rf24network network(radio); onewire ds(19); const uint16_t transmit_address = 011; const uint16_t receiver_address = 01; const unsigned long interval = 100; unsigned long last_sent; uint8_t count; float temp; struct payload { uint8_t count; uint8_t data1; }; void setup(void) { radio.begin(); network.begin(90,transmit_address); radio.setpalevel(rf24_pa_high); count = 0; } void loop() { temp = gettemp(); network.update(); unsigned long = millis(); if ( - last_sent >= interval) { count++; last_sent = now; payload payload_data = {count, temp}; rf24networkheader header(receiver_address);

javascript - how to add ads in listview in MyAdapter -

how can add admob ads in list view? i add myadapter class , myviewholder class error. here code: public class myadapter extends recyclerview.adapter<myviewholder> { /// list ads private static final int menu_item_view_typ = 0; private static final int ad_view_type = 1; /// list ads context c; arraylist<article> articles; public myadapter(context c, arraylist<article> articles) { this.c = c; this.articles = articles; } public class nativeexpressadsviewhoolder extends myviewholder { nativeexpressadsviewhoolder(view view){ super(view); } } @override public int getitemcount() { return articles.size(); } @override public long getitemid(int position) { return (position % 8 == 0) ? ad_view_type: position; } @override public myviewholder oncreateviewholder(viewgroup parent, int viewtype) { switch (viewtype) { case ad_view_type: view nativ = layoutinflater.from(c).inflate(r.layout.native_expres_continer, p

jquery - open div tag and close it in another place by javascript -

is possible using javascript open tag, example div#js , insert closing tag in place want, on example below? <div id="first"></div> <div id="js"> <div id="second"></div> <div id="third"></div> </div> <div id="fourth"></div> if start with: <div id="first">1</div> <div id="second">2</div> <div id="third">3</div> <div id="fourth">4</div> and need structure: <div id="first">1</div> <div id="js"> <div id="second">2</div> <div id="third">3</div> </div> <div id="fourth">4</div> the can use $('#second').wrap('<div id="js"></div>').after($('#third')) . see demo below: $('#second').wrap('<div id=&quo

angularjs - Is it possible to install package from git repository via downloading zip files in npm? -

i trying install angular packages after downloading there zip files git hub company policies doesn't allow install directly via npm. have tried link " is possible install package git repository downloaded .zip file in npm? " not work me.any ideas. wiki

selenium - difference between chromedirver and phantomjs with python -

i’m working make web crawler python using selenium here, got contents using chromedriver, problem occurred when tried make headless access crawling through phantomjs. find_element_by_id , or find_element_by_name did not work there difference between these? trying make headless because want run code in ubuntu server batch job without gui support. my script below. from selenium import webdriver selenium.webdriver.common.by import import time selenium.webdriver.common.keys import keys bs4 import beautifulsoup import re #driver = webdriver.phantomjs('/users/user/downloads/phantomjs-2.1.1-macosx/bin/phantomjs') #driver = webdriver.chrome('/users/user/downloads/chromedriver') driver = webdriver.phantomjs() driver.set_window_size(1120, 550) driver.get(url) driver.implicitly_wait(3) #here tried 2 different find_tag things both didn’t work user = driver.find_element(by=by.name,value="user:email") password = driver.find_element_by_id('user_password'

javascript - recibe ng-repeat for add to array -

Image
i have user list , want add 5 new values not recognize them. <tr ng-repeat="users in usersdata"> <td> {{ $index + 1 }} </td> <td> {{ users.id }} </td> <td> {{ users.apellidos }} </td> <td> {{ users.nombres }} </td> </td> <td> <input class="form-control" type="checkbox" style="width: 100px;" ng-model="users.desayuno" ng-checked="true"> </td> </td> <td> <input class="form-control" type="checkbox" style="width: 100px;" ng-model="users.almuerzo" ng-checked="true"> </td> </td> <td> <input class="form-control" type="checkbox" style="width: 100px;" ng-model="users.te" ng-checked="true"> &

Feeding data from multiple h5py files to TensorFlow -

i have relatively infinite training , validation data. stored in multiple h5py files in format ready training. every h5py file consist of 'x' , 'y' datasets having 10 000 of samples per file. i feeling quiet lost on how feed data tf model efficiently. please point me right direction. best practice feed tensorflow model data when training. need build tensorflow dataset, reader, ques? how should done right way? highly appreciate if give code example on doing it. thank sharing knowledge! wiki

identityserver3 - Login page for IdentityProvider using IdentityServer4 -

in usages of implementing openidconnect using identityserver 3/4 have researched upon on internet, login page rendered application running identityserver. we have unique scenario login page rendered application (say, https://example.net ) (ideally move login page rendered app running identityserver (say, https://idp.com ), not possible various reasons). i trying work around constraint registering login url identityserver (by using options) ( https://example.net/login ). able end-user correct login page if end-user not authenticated. when end-user submits entering / username , password, intending post login page form identiyserver's login endpoint have created, if user presents right crednetials issue authentication cookie (i.e., cookie host https://idp.com ), , redirected whatever registered client redirecturi. my goal achieve single sign end-users between different clients. given login postback https://idp.com sets required cookies idp server, assuming next client not p

custom controls - Angular 2 - ControlValueAccessor - How to implement? -

i keep having "no value accessor form control unspecified name attribute" some ngdefaultcontrol should added not trigger change in component i tried implement controlvalueaccessor instead error message above import { component, oninit,input,onchanges,simplechange } '@angular/core'; import { controlvalueaccessor } "@angular/forms"; import { productsservice } '../../pages/products/products.service'; @component({ selector: 'my-product-input', templateurl: './productinput.component.html', styleurls: ['./productinput.component.css'], }) export class productinputcomponent implements oninit,onchanges,controlvalueaccessor { onchange; @input('productid') productid:number=null; private product:any; constructor( private productsservice: productsservice, ) {} ngoninit() { this.getproduct(); } getproduct() ... ngonchanges(changes: { [propname:

How can my Paypal sandbox merchant account support amex payment -

i'm using dodirectpayment api https://api-3t.sandbox.paypal.com/nvp . visa/mastercard payment works fine gave me error if use amex. need set sandbox account? it's business pro account. many thanks! array(11) { ["timestamp"]=> string(20) "2017-08-22t11:13:42z" ["correlationid"]=> string(13) "ed8fff8346e43" ["ack"]=> string(7) "failure" ["version"]=> string(4) "56.0" ["build"]=> string(8) "36082234" ["l_errorcode0"]=> string(5) "10566" ["l_shortmessage0"]=> string(28) "credit card type unsupported" ["l_longmessage0"]=> string(37) "the credit card type not supported" ["l_severitycode0"]=> string(5) "error" ["amt"]=> string(5) "10.00" ["currencycode"]=> string(3) "usd" } wiki

iis - configuring security for Classic asp site running on Windows Server 2012 r2 -

i moved classic asp site on windows server2003 windows server 2012. under iis authentication prove site comes enabled anonymous authentication, working. i've disabled , have windows authentication enabled. application pool i've set site against has .net clr version set v2.0 enable 32-bit set true ive set identity use networkservice , managed pipeline set classic. from within iis on wwwroot properties security tab, have ensured networkservice , domain user group have relevant permissions , i've done same on physical path of site. i've recycled app pool , restarted site, whenever try browse site, asks user password. after entering password still comes 401.1 - unauthorized error. added same roles asp.net authorization rules in iis didn't make difference (didn't expect since isn't .net app). ideas go here? apparently known issue design. loopback issue. resolve problem in iis create new binding actual ip address of website , leave hostname blank

c# - Edit Row in LINQ -

i trying update row using linq below not doing update reason. have googled , can assure defenitely have primary key in table. below code: public static returnedsavedsearchstatus editsavedsearches(eteach.objects.savedsearch savedsearch) { returnedsavedsearchstatus rtn = new returnedsavedsearchstatus(); et_tbl_talentpoolsavedsearch dbsavedsearch = new et_tbl_talentpoolsavedsearch(); dbsavedsearch = automapper.mapper.map<et_tbl_talentpoolsavedsearch>(savedsearch); if (dbsavedsearch.id < 0) { rtn.status = false; rtn.description = "error: id cannot less 0"; } else { using (eteachdatabasedatacontext ctx = new eteachdatabasedatacontext()) { var result = ctx.et_tbl_talentpoolsavedsearches.singleordefault(s => s.id == dbsavedsearch.id); if (result != null) { result = dbsave

ios - Trying to dismiss a popover that was presented by storyboard -

i see lot of questions on answers nothing me. i presenting popover using storyboard. after while want dismiss popover programmatically. i have tried many things last try involves creating class view controller inside popover. class this: - (id)initwithcoder:(nscoder *)adecoder { self = [super initwithcoder:adecoder]; if (self) { [self initializenotification]; } return self; } - (void) initializenotification { [[nsnotificationcenter defaultcenter] addobserverforname:@"closepopover" object:self queue:[nsoperationqueue mainqueue] usingblock:^(nsnotification * _nonnull note) { [self dismissviewcontrolleranimated:yes completion:nil]; }]; } then, main code post notification like [[nsnotificationcenter defaultcenter] postnotificationname:@"closepopover" object:self]; and nothing happens... popover continues there. why? you have replace self nil (for object parameter) when creating not

javascript - Catch Error Type in Bluebird Not Working -

i have custom error class: class networkerror extends error { constructor() { super('network error'); this.name = 'networkerror'; } } and want handle specifically: import {networkerror} '../../common/errors'; somefunc().catch(networkerror, err => { // missed }).catch(err => { // hit }); but it's skipping custom catch , hitting general catch. if change so, works: somefunc().catch({name: 'networkerror'}, err => { // hit }).catch(err => { // missed }); obviously first way preferred. missing here? as @loganfsmyth suggested in question comments, it's babel limitation. answer trick: why doesn't instanceof work on instances of error subclasses under babel-node? wiki

mysql - Rename multiple tables with single command -

it's possible mysql mentioned here: https://www.electrictoolbox.com/rename-multiple-tables-mysql/ does similar action possible oracle ? something : alter table tbl1 rename new1, tbl2 new2; an alternative think of can generate multiple alter commands using single select all_tables . select 'alter table ' ||table_name ||' rename ' ||table_name ||'_new' ||rn||';' alter_command (select rownum rn , a.* all_tables table_name in ('<list_of_tables>') ) order table_name; output: alter table abcd_tmp rename abcd_tmp_new1509; alter table abcd_tmp3 rename abcd_tmp3_new1510; alter table access$ rename access$_new46; alter table account rename account_new1549; alter.. ..... wiki

uwp - How to implement a Template 10 HamburgerMenu in a single page -

i attempting use template 10 hamburgermenu control within single page of uwp application (in conjunction pageheader control), instead of more typical application-wide hamburger menu hosted in shell page. the documentation doesn't explain how should done, stating "the hamburgermenu xaml control and, such, can placed in page of application". assuming control works splitview , , using template10 hamburgermenu demo code starting point, have added following minimal implementation page: <controls:hamburgermenu x:name="menu"> <controls:hamburgermenu.primarybuttons> <controls:hamburgerbuttoninfo buttontype="command"> <stackpanel orientation="horizontal"> <symbolicon width="48" height="48" symbol="home" /> <textblock margin="12,0,0,0" verticalalignment="center" text="home" /> &

C# WPF Grid Rows height stretch -

Image
i trying create wpf view grows dynamically window size. example code shows three. the first 1 shall fixed height. the second , third 1 shall same size , whole window. unfortunatelly not work. doing wrong? dockpanel correct tool purpose? <grid > <grid.rowdefinitions> <rowdefinition height="200"/> <rowdefinition height="1*"/> <rowdefinition height="1*"/> </grid.rowdefinitions> <dockpanel grid.row="0"> <!-- labels , buttons --> </dockpanel> <dockpanel grid.row="1"> <listview margin="5"/> </dockpanel> <dockpanel grid.row="2"> <listview margin="5"/> </dockpanel> </grid> because information not possible put in comment. your layout still want do. set background colors show it. me easy trick check if layout expands

I need help to implement Cut command for Nattable -

i have try deleteselectionhandler copy command.it works paste not working.copy , paste working fine.but when have used cut( copy,delete).cut works fine not able paste data. this not work existing functionalities in nattable. copy + paste working internally cell references. means when delete content in 1 cell, stored reference containing no data anymore can copied. cut + paste need implement mechanism takes data clipboard , prepares pasting again. similar task perform when trying copy paste action between different nattable instances. for use cases need work clipboard , handle data there. , handling dependent on table structure. example if have different data types per column, cut + paste cause data conversion exceptions. wiki

jquery - Form data value from view - Javascript -

i'm trying append data form data view, returns undefined code: html: <input type="text" id="iditem"> <button id="idbtn" type="button" onclick="mymethod()">aceptar</button> javascript: function mymethod(){ var formdata = new formdata() formdata.append("nombre",$('#iditem').value) //input-text } any suggest? thanks. try change $('#iditem').value => $('#iditem').val() wiki

java - file content get reduced when transfering to ftp server -

i wrote java program recursively upload directory remote ftp server using apache.commons.net library.by program files got uploaded remote ftp server expected.but html,js,svg,ftl file content getting reduced.also jpeg,png,icon file sizes different original.i compare original directory , uploaded directory after uploading using meld software can figure out directory content got corrupted.i have tried both binary , ascii transfer mode.both 2 modes getting same problem.so can 1 suggest reason why happening.is issue ftp file transferring import java.io.file; import java.io.fileinputstream; import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import org.apache.commons.io.filenameutils; import org.apache.commons.net.ftp.ftp; import org.apache.commons.net.ftp.ftpclient; public class ftpclient3 { public static boolean uploadsinglefile(ftpclient ftpclient, string localfilepath, string remotefilepath) throws i

android - convert the bitmap file (of a cuptured image) to a path file -

the photo parameter bitmap , checked , shows cuptured image how can convert bitmap path able send attachment mail this code : protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.opencvhc); imgphoto = (imageview) findviewbyid(r.id.imgphoto); bundle extras = getintent().getextras(); if (extras != null) { bm = (bitmapdataobject) getintent().getserializableextra("photo"); //obtaining data bitmap = bm.getbip(); imgphoto.setimagebitmap(bitmap); } checkmood = (button) findviewbyid(r.id.checkmood); check = (button) findviewbyid(r.id.check); txtview = (textview) findviewbyid(r.id.txt); } public void checkclick(view view) throws ioexception { string file = mediastore.images.media.insertimage(getcontentresolver(), bitmap, "file", null); //uri screenshoturi = uri.parse(file); toast.maketext(opencvhc.this, file, toast.length_short).

gruntjs - Line numbers of less in css -

Image
i have simple , stupid question, can't figure out. know possible grunt , less, how-where-and-when... i want less line-numbers in rendered css comments can debug faster , easyer. (i know can add less html developing reasons cleaner directly write in css.) the following outcome i'm searching for: could send me in right direction? in advance! wiki

java - Storm: set log level for topology -

apache storm how can set log level new topology , exist once? in java wrote: import org.slf4j.logger; import org.slf4j.loggerfactory; ... private static final logger log = loggerfactory .getlogger(myclass.class); ... log.debug("my debug log"); log.info("my info log"); and see line "my info log" dont see "my debug log" in worker.log file. decision: https://community.hortonworks.com/articles/36203/debugging-an-apache-storm-topology-1.html the best way set log level of topology: ./bin/storm set_log_level my_topology -l root=debug:30 wiki

reactjs - Simple react todo app and storing todos in firebase -

i have simple todo app trying 'todos' stored in firebase. here relevant files... base.js import rebase 're-base'; import firebase 'firebase'; const app = firebase.initializeapp({ apikey: "mykey", authdomain: "myapp.firebaseapp.com", databaseurl: "https://myapp.firebaseio.com", }); const base = rebase.createclass(app.database()); export default base; todolist.js import react, { component } 'react'; import todoitems './todoitems'; import todoinput './todoinput'; import base './base'; class todolist extends react.component { static proptypes = { todos: react.proptypes.array }; constructor(props) { super(props) this.state = { todos: this.props.todos || [] } } componentwillmount(){ this.ref = base.syncstate({ context: this, state: 'todos' }); } addtodo = (item) => { this.setstate({todos: this.state.todos.concat([

angular - How to remove <ion-footer> in Ionic 2 -

Image
i'm trying hide if clicked on search button there small problem couldn't solve it. for example part of footer html code. note1: "search" normal variable defined in first of .ts code value "false". note2: if click button, there function change "true". <ion-footer *ngif="!search"> <ion-toolbar> <ion-input placeholder="type thing" [(ngmodel)]="variables.chattext" (click)="autoscroll()"></ion-input> <ion-buttons end> <button ion-button icon-right color="royal" [disabled]="!variables.chattext" (click)="sendchat(variables.chattext)" >send<ion-icon name="send"></ion-icon> </button> </ion-buttons> </ion-toolbar> </ion-footer> when want hide it, page shown such picture. how can solve problem ? just can see in the docs : if height of ion-hea

javascript - Mocking jquery selector and returning an html element -

i trying test javascript function requires element present in dom. below function trying test: auction.save_scroll_state = function() { var user_agent = $window.navigator.useragent.tolowercase(); var is_android = user_agent.indexof("android") > -1; if (is_android) { var restore_pos = null; debugger if ($location.search().section == "items") { restore_pos = $('#all-items').scrolltop(); $('#all-items').one('scroll', function(){$('#all-items').scrollto(restore_pos)}); } else if ($location.search().section == "user_items"){ restore_pos = $('#your-items').scrolltop(); $('#your-items').one('scroll', function(){$('#your-items').scrollto(restore_pos)}); } } }; when run test , debugger type $('#all-items').length returns 0 indicating element cannot found. trying form kind of jasime spy mock out j

php - UEditor cant update resource,because of two js fill doesnot work ,how to fix it? -

see problem editor's update founction cant work ,and error message is: https://sfault-image.b0.upaiyun.com/155/687/1556879243-599e3ed24ccad router , controller fine,(im usig laravel project),so problem? wiki