Posts

Showing posts from July, 2010

postgresql - How to store dates with different levels of precision in postgres? -

i storing data on journal papers pubmed in postgres, , want store publication date of paper. however, date just year (see pubdate field), month , year, , day, month , year. what's sensible way store data in database? if use postgres date field, need specify day , month well, i'll need invent them in cases, , don't idea of losing information date's precision. for purposes think need year, don't know true possible future purposes. perhaps should have text fields day , month , year , , can convert them date field in future if need them? i store date , store precision well. for example: create type date_prec enum ('day', 'month', 'year'); create table pub ( pub_id integer primary key, pub_date date not null, pub_date_prec date_prec not null ); then can query table this: select pub_id, date_trunc(pub_date_prec::text, pub_date)::date pub; to ignore “random” day , month values in pub_date .

visual studio - Open Dynamics CRM solution with CRM Developer Extensions -

i have solution, developed in vs2012 microsofts crm toolkit . there way open in vs2015? errormessage: workflow\workflow.csproj: application project type based on not found. i have installed jason lattimer's crm developer extensions and it's great new projects, old projects? you have 2 options. first rewrite old workflows in jason lattimers crm developer extensions. second install crm developer toolkit on vs2015 - it's bit tricky not impossible, here can find how vs2013 2015 similar.

intellij idea - Java home path differs -

hello try execute project bootrun on intellij , followign error: execution failed task ':bootrun'. > process 'command '/usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.101-1.b14.fc24.x86_64/bin/java'' finished non-zero exit value 1 i checked results of java paths , stuff , here there echo $java_home /home/mypc123/downloads/jdk1.8.0_101/bin/java $ java /usr/bin/java i have jdk1.8.0 in /usr/bin i looked more indepth , found this: error org.apache.tomcat.jdbc.pool.connectionpool - unable create initial connections of pool. org.postgresql.util.psqlexception: fatal: role "syn12" not exist however when connect postgresql have syn12 role , gradle jvm's in form usr/lib/jvm/java....... well got down : can't load library: /opt/symmetry/ste/java/libste-java.so ,how can install library? seems have project jdk pointed installation. second issue different, incorrect jdbc url hap...

android - BitmapFactory decode returns null -

i dealing weird thing in android now. code used work till few days ago stops working. selecting image gallery , want bitmap object of it. code: imgdecodablestring = "/storage/emulated/0/dcim/camera/img_20160114_141351594.jpg" bitmap decodedbitmap = bitmapfactory.decodefile(imgdecodablestring); log.d(constants.tag, "decodedbitmap: " + decodedbitmap); bitmap null (used work) , don't wrong. didn't changed code. had problem? thank you. i have permissions: <uses-permission android:name="android.permission.read_external_storage"/> <uses-permission android:name="android.permission.write_external_storage"/> if (checkpermission(youractivity.this, manifest.permission.write_external_storage)) { // have permission go ahead string imgdecodablestring = "/storage/emulated/0/dcim/camera/img_20160114_141351594.jpg"; if(new file(imgdecodablestring).exists()){ bitmap decodedbitmap = bitmapfactory.decodefile...

java - Short circuit logical operators over Iterable -

consider following code, loop can finish hits false value. there better way checking false after each iteration? boolean result = true; list<boolean> blist = new arraylist<>(); (boolean b : blist) { result = result && b; if (!result) { break; } } what about if (blist.contains(false)) { ...

android - When I try to install signed apk then it give me error "Application not installed" -

i running app on devices android studio direct working fine. have uninstalled unsigned apk application manager. when trying install signed apk sd card give me error "application not installed". device android version 6.0.1. not sure what's problem. tried every thing same problem. please me out , in advance. change application package name my.app.pack my.app.pack.1 remove application/photos increase memory.

visual c++ - How to force CMFCPropertyGridCtrl to refresh after adding an item? -

i add item cmfcpropertygridctrl, new item not show if click cmfcpropertygridctrl. now have indirect solution show new item calling expandall() , don't want expand have collapsed. is there way show new item gracefully ? after cmfcpropertygridproperty.addsubitem() call, new item show following 2 calls: yourgridctrl.adjustlayout(); yourgridctrl.redrawwindow(); hope helps !

azure ad b2c - Is it possible to provide a passwordless login via email (like Slack's magic log-in links) using AAD B2C? -

i have administrator of app create users in azure ad b2c , have azure ad b2c send passwordless link user via email or pass me link can send via email. possible via existing service or api? this article helps explain concept using auth0: https://auth0.com/docs/connections/passwordless/regular-web-app-email-link i asked swaroop krishnamurthy (@swaroop_kmurthy) same question via twitter , received response him on 9/8/2016, "@keithdholloway on our roadmap bit further out near term."

wordpress - Woocommerce variations per category -

i looking way add product variations per category. example: category t-shirts: -> variants: size, color, etc. i know can added per product, can huge thing when there lots of products. easier set them on category, since client like. hope explained clearly. thanks.

uwp - Desktop App Converter does not capture regitryes under HKCU -

i have msi file adds entries under hkey_current_user\software hive. seems app converter totally ignores them. tee registries under hkey_local_machine detected ok. has encountered issue? maybe workaround? thanks i have msi file adds entries under hkey_current_user\software hive. seems app converter totally ignores them during deployment, support keys in package under hklm\software. @ runtime application can write hkcu package content per-machine only. reason find ignored under hkcu\software. let's clarify may misunderstand: deployment: centennial packages may include private package registry data. this data must logically sit under hklm\software . no other registry locations supported. when package deployed, registry data made available application. runtime: once application launched , running can read or enumerate package registry data under hklm\software. running application may read or write hkcu.

ddos - DOS Protection in Azure Web APP -

we using azure web app for our frontend site. have discovered dos attack on our website. when googled around got know solution azure cloud services. there way, azure web app can protected out of box support.. as know, can configure static/dynamic ip restrictions protect our azure web app: 1) configuring dynamic ip address restrictions in windows azure web app, please refer this article . 2) configure static ip address restrictions in windows azure web app, please refer this article . you read this video started.

c++ - Implementing pure virtual function from abstract base class: does override specifier have any meaning? -

background i stumbled on use case of override specifier that, far can tell, seems redundant , without particular semantics meaning, maybe i'm missing something, hence question. before proceeding, should point out i've tried find answer here on so, nearest got following threads, not answering query (maybe can point out q&a answers question). c++ virtual/pure virtual explained c++ override pure virtual method pure virtual method question consider following abstract class: struct abstract { virtual ~abstract() {}; virtual void foo() = 0; }; is there reason use override specifier when implementing foo() in non-abstract class derived directly abstract (as in derivedb below)? i.e., when implementation of foo() required derived class non-abstract (and not overriding anything)? /* "common" derived class implementation, in personal experience (include virtual keyword semantics) */ struct deriveda : public abstract { virtual void foo() {...

javascript - How to create a searchable drop down list in mvc5? -

i'm trying make current dropdown lists(scaffolded mvc) searchable. i added script didn't help. <script type="text/javascript"> $(document).ready(function() { $("select").searchable({ maxlistsize: 100, maxmultimatch: 50, exactmatch: false, wildcards: true, ignorecase: true, latency: 200, warnmultimatch: 'top {0} matches ...', warnnomatch: 'no matches ...', zindex: 'auto' }); }); these dropdown lists <div class="form-group"> @html.labelfor(model => model.customerid, "customerid", htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.dropdownlist("customerid", null, htmlattributes: new {@class = "form-control" }) @html.validationmessagefor(model =...

Quicksort, given 3 values, how can I get to 9 operations? -

well, want use quick sort on given 3 values, doesn't matter values, how can worst case 9 operations? can draw tree , show how show nlogn , n^2 operations? i've tried find on internet, still didnt manage draw 1 show that. the worst case complexity of quick sort depends on chosen pivot. if pivot chosen leftmost or rightmost element. worst case complexity occur in following cases: 1) array sorted in same order. 2) array sorted in reverse order. 3) elements same (special case of case 1 , 2). since these cases occur frequently, pivot chosen randomly. choosing pivot randomly chances of worst case reduced. the analysis of quicksort algorithm explained in this blogpost khan academy.

javascript - Kendo Observable Change event -

i have kendo obervable follows: var viewmodel = kendo.observable({ id: 1, title: "somevalue", }); and have bound follows: kendo.bind($(".bind-view"), viewmodel ); now there button on page. when clicked need check if there changes viewmodel . i have tried $(".clearanalysisinfo").on('click', function (event) { viewmodel.bind("change", function (e) { //some code }); }); but i'm not able viewmodel property whether changed or not. binding observableobject's change event of inside button's click handler late. need after observableobject created. inside change handler, receive information changed field . use information raise javascript flag or save details need, can use them later in button's click handler. var viewmodelchanged = false; var viewmodel = kendo.observable({ id: 1, title: "somevalue", }); viewmodel.bind("change...

Windows 10 IoT core+rasperry pi+camera sensor? -

does windows 10 iot core supports rasperry pi camera sensor?if so,which libraries there in c# code camera module? windows iot officially supports several types of usb cameras, find completed list https://developer.microsoft.com/en-us/windows/iot/docs/hardwarecompatlist#cameras . if you're developing under uwp framework, has built-in support various cameras, follow tutorial https://msdn.microsoft.com/en-us/windows/uwp/audio-video-camera/camera . microsoft provides sample projects camera development, find in https://github.com/microsoft/windows-universal-samples/tree/master/samples/camerastarterkit . i hope helps.

node.js - Using mongose aggregation to populate from collection in mongo -

sample document { _id:"123", "completed" : [ { "id" : objectid("57caae00b2c40dd21ba089be") "subname" : "oiyt", "name" : "endo", }, { "id" : objectid("57caae00b2c40dd21ba089be"), "subname" : "oiyt", "name" : "endo", } ] } how access name , subname complete _id matches? you can use $filter or $unwind (or both). this example shows how use $filter document 1 matched element in array, , $unwind easier access matched element. but there many more options desired result. db.collection.aggregate([ { $project: { filtered_completed: { $filter:{ input: "$completed", as: "complete", ...

matlab - Passing arguments to UIcontrol callback function -

i making app track finances , confused how pass string callback function in uicontrol pushbutton object. for instance: classdef moneyapp < handle methods (access = public) function app = moneyapp % uicontrol object example app.newsymbolglmc = uicontrol(app.figureglmc,... 'style','pushbutton','position',[300 60 200 20],... 'string','new stock',... 'callback', {@app.newstock,'account name'}); end function newstock(src,eventdata,account) % string, 'account name' end end end end i confused how string, 'account name', newstock function. essential part code , think syntax not correct; more examples of code can provided if needed. appreciated! since newstock method of class, first input must object itself. because of need 4 input arguments in function definition: instance, s...

django - retrieving objects from another model -

i have situation: class item (models.model): name = models.charfield(maxlenght=15) class itemishired(models.model): item = models.foreignkey(item) ishirednow = models.booleanfield(null=false) the thing want retrieve items hired right now, if make query using itemishired.objects.filter(ishirednow=true) objects itemishired class when want objects item class related them.

python - Complex aggregation methods as single param in query string -

i’m trying design flexible api django rest. meant have field filterable through query string , in addition have param in query string can denote complex method perform. ok, here details: views.py class starsmodellist(generics.listapiview): queryset = starsmodel.objects.all() serializer_class = starsmodelserializer filter_class = starsmodelfilter serializers.py class starsmodelserializer(dynamicfieldsmixin, serializers.modelserializer): class meta: model = starsmodel fields = '__all__' mixins.py class dynamicfieldsmixin(object): def __init__(self, *args, **kwargs): super(dynamicfieldsmixin, self).__init__(*args, **kwargs) fields = self.context['request'].query_params.get('fields') if fields: fields = fields.split(',') # drop fields not specified in `fields` argument. allowed = set(fields) existing = set(self.fields.keys()) ...

xamarin - XLabs.Platform not working on UWP -

i using windows 10 & visual studio 2015 development , targeting android, ios, windows phone, windows universal. i wanted use xlabs securestorage service. i using xlabs.platform package 2.3.0-pre02. at line getting exception (only uwp) securestorage.store(key, encoding.utf8.getbytes(value)); and exception details : filename : system.runtime.windowsruntime, version=4.0.11.0, culture=neutral, publickeytoken=b77a5c561934e089 hresult : -2146234304 helplink : null innerexception : null message : not load file or assembly 'system.runtime.windowsruntime, version=4.0.11.0, culture=neutral, publickeytoken=b77a5c561934e089' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) source : xlabs.platform.uwp sourcetrack : @ xlabs.platform.services.securestorage.d__6.movenext() @ system.runtime.compilerservices.asyncvoidmethodbuilder.starttstatemachine @ xlabs.platform.services.secu...

javascript - How to auto-refresh a div -

i have controller , view div : def show @requests = events.get_requests end get_requests returns requests in database select, output in div in view: <div class="party-block" id="requests"> <h4><%= t '.requests' %></h4> <input type="button" value="<%= t '.refresh' %>" onclick="window.location.reload()" class="btn-sm btn-info"> <% @requests.each |r| %> <span class="request"> ... in div print requests other things. i want automatically refresh div javascript/jquery function. moment use button refresh need re-execute code in controller? there function in javascript named setinterval lets schedule function executed every time interval. http://www.w3schools.com/js/js_timing.asp setinterval(function() { console.log("hi there"); }, 1000);

intellij idea - Control key not working on embedded terminal (mac os) -

i changed setting mistake, how control key work again?? given open terminal in intellij (2016.2.3) and run command takes time run when press control + c then should see command being aborted instead see letter c typed instead. basically control key not working @ in embedded terminal. the same scenario works on webstorm , iterm . it's intellij short answer: revert previous version intellij idea 2016.2.3 seems have bug prevents control key sent terminal. reverted previous version , fixed me. this not best answer, it's way find fix it. @charles-o pointing out started seeing problem after updating.

sql server - Select all columns, but perform except statement on certain columns -

i have temporary table #tempjointable i have 2 fields in temptable called product_fam_id , product_id , , 2 fields called mandatory_cd , display_cd . basically, have list of products stored inside temporary table. 1 of these product_fam_id/product_id combinations have been tested, rows , records product combination, '591'/'103', should exact same other combinations have stored in 'products check' temptable. thing should different product_fam_id , product_id values, of course so tried following, i'm pretty new @ sql , bit stuck. advice @ welcome create table #tempproductstocheck ( productfamilyid char(10) null, productid char(10) null ) insert #tempproductstocheck (productfamilyid, productid) values ('591', '98'), ('591', '99'), ('591', '101'), ('591', '102'), ('502', '101'), ('502', '102'), ('591', '100'), ('591', ...

php - How do you connect bootstrap form to database -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 22 answers i have created bootstrap form ,but won't connect database. after filling forms, gives me undefined index error. have no idea do. can me? i'm lost. <form name="input" method="post" action="addtodatabase.php"> <form> <div class="form-group"> <label for="book_number">book number</label> <input type="text" class="form-control" id="book_number" placeholder="enter book number"> </div> <div class="form-group"> <label for="book_title">book title</label> <input type="text" class="form-control" id="book_title" placeholder=...

C#, OleDb: My program is not saving my Access Database table -

namespace healthclub_isat { public partial class form1 : form { private oledbconnection connection = new oledbconnection(); public form1() { initializecomponent(); connection.connectionstring = @"provider=microsoft.ace.oledb.12.0;data source=c:\users\zuko\documents\zux techyana cp isat 2016\healthfitnessclub.accdb;persist security info=false"; } private void btnsave_click(object sender, eventargs e) { try { connection.open(); messagebox .show("database opened", "connection", messageboxbuttons.ok); oledbcommand command = new oledbcommand(); command.connection = connection; command.commandtext ="insert members (member_id, first_name, surname, contact_number) values ('" + this.txtmemberid.text + "','" + this.txtmname.text + "','" + this.txtmsurname.text + ...

selenium - Protractor passing all tests as success without doing them -

trying run tests protractor encounter huge problem can't explain or resolve. when run tests, protractor ignore tests , consider has been done success. this report: [16:32:02] i/local - starting selenium standalone server... [16:32:02] i/launcher - running 1 instances of webdriver [16:32:02] i/local - selenium standalone server started @ http://192.168.0.33:54345/wd/hub problem trying remove folder started .................................... 36 specs, 0 failures finished in 0.249 seconds [16:32:15] i/local - shutting down selenium standalone server. [16:32:15] i/launcher - 0 instance(s) of webdriver still running [16:32:15] i/launcher - chromeany #01 passed usually tests should take around 15 minutes. i'm using grunt-protractor-runner run tests. my config : windows 10 grunt: 1.0.1 grunt-protractor-runner: 3.2.0 selenium-webdriver: 3.0.0 protractor-jasmine2-html-reporter: 0.0.5 my conf file : 'use strict'; var env = require('./environment.js...

angular - Angular2 - should RC6 compile to ES5 or ES6? -

i have upgraded rc6 , getting compile errors my code related find. here example. ts2339: property 'find' not exist on type 'string[]'. i file compile errors in angular code under node_module s(why try compile this?). here few: error ts2304: cannot find name 'set'. error ts2304: cannot find name 'promise'. i can solve setting tsconfig target es6 angular2 quickstart still shows es5. don't want deviate far @ point. i using typescript 2.0.0.

excel - Removing Gridlines in All Charts on All Worksheets -

i'm working following code: sub removegridlines() dim axs axes dim ws worksheet dim objcht chartobject each ws in worksheets ws.activate each objcht in ws.chartobjects objcht.chart each axs in objcht.chart .axes.hasmajorgridlines = false .axes.hasminorgridlines = false next axs end next objcht next ws end sub and hung on for each axs in objcht.chart object mismatch. tried adding .axes line won't proceed regardless. how can loop through each axis, chart, , worksheet? when remove .chart , remove .axes subsequent lines method or data member not found . you know, funny real reason, code works: sub removegridlines2() dim axs axis dim ws worksheet dim objcht chartobject dim k chart each ws in worksheets each objcht in ws.chartobjects set k = sheets(ws...

javascript - Generic solution to manage windows with ASP.NET MVC -

i have 3 different cases in project opening new window. when click link in window, expected 1 of following solutions: i use following types window open: _blank _self _parent i have following columns opening new window: code width height behaviour accountpage 400 600 self prospectpage 700 700 blank passwordpage 200 200 single i need pass specific parameters javascript width, height , code. code used screen open , take parameters. have invoicepage, prospectpage,searchpage etc. if invoicepage opened width 200 or if prospectpage opened width 400px. what proper way manage , pass javascript window open types , parameters in generic technique? how can prepare classes , types? i tried use meta tag in layoutgeneral.cshtml pass dataset javascript couldn't it. <meta name="iristabheadername" content="@model.windowinfo" /> should hold data in baseviewmodel , pass parameters javascript there or sh...

php - Repeat array values -

i have array; [1]=> array(5) { ["chid"]=> string(1) "1" ["chtext"]=> string(9) "excellent" ["chvotes"]=> string(2) "13" ["weight"]=> string(1) "1" ["colour"]=> string(7) "#b3c7e0" } the colour added array text field. array length colour @ fixed length of 4. $poll = $entity->choice; // array $poll_colours = array(); // create new array colours $colours = $entity->field_poll_colours['und'][0]['value']; // value text field $poll_colours = explode(',', $colours); // explode comma foreach($poll $key => $value) { $poll[$key]['colour'] = $poll_colours[0]; $poll[$key]['colour'] = ltrim($poll[$key]['colour']); unset($poll_colours[0]); sort($poll_colours); } unset($poll_colours); what want achieve is, if length of array more 4, repeat colou...

.net - Json.Net not deserializing references dynamically -

i have large object graph circular references, serializing json.net in order preserve references before sending client. on client-side, i'm using customized version of ken smith's jsonnetdecycle , is, in turn, based on douglas crockford's cycle.js restore circular object references on deserialization, , remove them again before sending objects server. on server side, i'm using custom jsondotnetvalueprovider similar 1 this question in order use json.net instead of stock mvc5 javascriptserializer. seems working fine server client , again, json surviving round-trip fine, mvc won't deserialize object graph correctly. i've traced problem down this. when use jsonconvert.deserialize concrete type parameter, works, , complete object graph children , siblings referencing each other. won't work mvc valueprovider though, because don't know model type @ point in lifecycle. valueprovider supposed provide values in form of dictionary modelbinder use. it app...

java - opening the csv with Excel with the leading zero without stripping -

i creating csv file contains data when opening excel ms leading zeros being stripped. should write in csv file prevent occuring? part of code for (int i=0; < rows.size(); i++) { object[] row = (object[]) rows.get(i); bufferedwriter.write(row[0]); bufferedwriter.write(";" + row[1]); bufferedwriter.write(";" + row[2]); bufferedwriter.write(";" + row[3]); bufferedwriter.write(";" + row[4]); if(row[4].startswith("0")){ //i want add here tp prevent happen. } bufferedwriter.write(";" + row[5]); bufferedwriter.write(";" + row[6]); try { bufferedwriter.write(";" + df.format(row[7])); } catch (exception ex) { bufferedwriter.write(";0"); } try { bufferedwriter.write(";" + df.format(double.parsedouble(row[8]))); } catch (exception ex) { bufferedwriter.write(";0"); } string...

Repeat Android services with differents times -

i created broadcast receiver starts 3 services. services don't have same intent, don't have same repeattime , don't have same id here's how create it the calling method : createandstartservice(context, intentmobile, repeat_time_mobile, 12); createandstartservice(context, intentnetwork, repeat_time_network, 13); createandstartservice(context, intentsystem, repeat_time_system, 14); and method starting services contains : alarmmanager service = (alarmmanager) context .getsystemservice(context.alarm_service); pendingintent pending = pendingintent.getservice(context, id, i, pendingintent.flag_update_current); service.setinexactrepeating(alarmmanager.elapsed_realtime_wakeup, systemclock.elapsedrealtime(), repeattime, pending); i can't figure out why repeattime overridden last value specified. the code works once, , 3 services synchronized. if have idea me figuring out what's problem there, thank ! ...

javascript - Transfer value of object inside array to another array -

i have object this: var animals_data = { category : [ { class : "reptiles", animals : [ { image1 : "some image", image2 : "some image 2", name : "snake", description : "some description" }, { image1 : "another image", image2 : "another image 2", name : "crocodilia", description : "another description" }, ] }, { class : "mammals", animals : [ { image1 : "more image", image2 : "more image 2", name : "cat", description : "more description" }, { image1 : "image", image2 : "image...

python - can't workout why getting a type error on __init__ -

hope can me... have following: smartsheet_test.py from pfcms.content import content def main(): ss = content() ss.smartsheet() if __name__ == "__main__": main() content.py import smartsheet ss class content: """ pfcms smartsheet utilities """ def __init__(self): self.token = 'xxxxxxxxxxxxxxxxxxx' def smartsheet(self): smartsheet = ss.smartsheet(self.token) however when execute code get: python -d smartsheet_test.py traceback (most recent call last): file "smartsheet_test.py", line 8, in <module> main() file "smartsheet_test.py", line 5, in main ss.smartsheet() file "/xxxxx/pfcms/pfcms/content.py", line 10, in smartsheet smartsheet = ss.smartsheet(self.token) typeerror: __init__() takes 1 argument (2 given) is self being passed ss.smartsheet(self.token) somehow, can see i'm passing argument self.token . knowledge of python isn...

c# - how to return double from double plus double? -

i hava 2 double variables, , when sum them return me int variable. want return double too. should do? thank you! example: double d = 4.0; double myd = 4.0; console.writeline ( d+myd ); // returns me 8 want 8.0 . the value 8 , 8.0 same. if want decimals shown in results, use converter n2 fixed 2 sigdig after decimal. console.writeline((d+myd).tostring("n2"));

javascript - JQDateRangeSlider change bounds issue -

i'm working daterangeslider first time , i'm using timeslider: fiddlejs the problem when button pressed min bounded value, or max one, should change, doesn't min or broke slider when pressing button max. the default values january 1st: var mindatestr = "2014-01-01t00:00:00z"; var maxdatestr = "2014-01-01t23:59:00z"; to display hours:minutes 1 day , button bounded values january 5th: min :new date("2016-01-05t05:00:00z") is there way change min , max bounds "2016-01-05t05:00:00z" without changing default values (january 1st)? i'm not sure if task you're trying achieve practical or possible. according documentation , slider values can changed code @ initialization. means if set either min2 or max2 either end bound, slider can't "jump" there represent area you've selected. not practical. moreover, in documentation, couldn't find way values @ labels "standing". apparen...

android - Why AdMob interstitial lock UI thread? -

while using method tracing util, encountered problem android admob interstitial ads. now use latest version of admob: compile 'com.google.firebase:firebase-ads:9.4.0' and code: long start = system.currenttimemillis(); interstitialad.loadad(adrequest); log.d(tag, "load: " + (system.currenttimemillis() - start) + " ms"); prints: load: 1250 ms and locks ui thread. example device: lg g3 android 5.0. i don't understand why locks. p.s. logs 09-08 11:35:52.294 i/ads: starting ad request. 09-08 11:35:52.297 i/ads: use adrequest.builder.addtestdevice("c847646ce34895e5c61dea64e092f1a5") test ads on device. 09-08 11:35:53.157 w/ads: webview destroyed. ignoring action. 09-08 11:35:53.224 e/ads: js: uncaught referenceerror: afma_receivemessage not defined (:1) 09-08 11:35:53.546 i/ads: scheduling ad refresh 30000 milliseconds now. 09-08 11:35:53.553 i/ads: ad finished loading. p.s.2 i answer question in official admob googe...

docker - Can I get an image digest without downloading the image? -

similar question " what´s sha256 code of docker image? ", find digest of docker image. can see digest when download image: $ docker pull waisbrot/wait:latest latest: pulling waisbrot/wait digest: sha256:6f2185daa4ab1711181c30d03f565508e8e978ebd0f263030e7de98deee5f330 status: image date waisbrot/wait:latest $ another question, what docker registry v2 api endpoint digest image has answer suggesting docker-content-digest header. i can see there docker-content-digest header when fetch manifest image: $ curl 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:waisbrot/wait:pull' -h "authorization: basic ${username_password_base64}" # store resulting token in dt $ curl -v https://registry-1.docker.io/v2/waisbrot/wait/manifests/latest -h "authorization: bearer $dt" -xhead * trying 52.7.141.30... * connected registr...

Why am I getting an error while running a .BAT file? -

the code follows: @echo off set _file=sqlquery.txt set /a _lines=0 /f %j in ('type %_file%^|find "" /v /c') set /a _lines=%j echo %_file% has %_lines% lines. when run .bat file, gives me error 'the syntax of command incorrect', , when run above commands runs successfully. why so? try this: @echo off (set _file=sqlquery.txt) (set _lines=) /f %%i in ('find /v /c ""^<"%_file%"') (set _lines=%%i) if defined _lines echo(%_file% has %_lines% line(s). pause

How to see the plot made in python using pandas and matplotlib -

Image
i following tutorial http://ahmedbesbes.com/how-to-score-08134-in-titanic-kaggle-challenge.html , following code from ipython.core.display import html html(""" <style> .output_png { display: table-cell; text-align: center; vertical-align: middle; } </style> """) # remove warnings import warnings warnings.filterwarnings('ignore') # --- import pandas pd pd.options.display.max_columns = 100 import matplotlib matplotlib.use('tkagg') import matplotlib.pyplot plt matplotlib.style.use('ggplot') import numpy np pd.options.display.max_rows = 100 data = pd.read_csv('./data/train.csv') data.head() data['age'].fillna(data['age'].median(), inplace=true) survived_sex = data[data['survived']==1]['sex'].value_counts() dead_sex = data[data['survived']==0]['sex'].value_counts() df = pd.dataframe([survived_sex,dead_sex]) df.index = ['survived','d...

routing - AngularJs $locationProvider.html5Mode(true); for remove Hash to URL not work -

i have problem function $ locationprovider.html5mode (true), setting: var app = angular.module("app", [ "ngroute", "nganimate" ]); // route config app.config(['$routeprovider','$locationprovider', function($routeprovider, $locationprovider){ $routeprovider. when("/archive", { templateurl: "archive.php", controller: "archivectrl", animate: "slide-left" }). when("/single", { templateurl: "single.php", controller: "singlectrl", animate: "slide-left" }). otherwise({ redirectto: "/archive" }); $locationprovider.html5mode(true); }); in head tag: <head> <base href="/"> </head> the root of site site.com/main.php where main.php contains div ng-view any idea why not work? here working example created on jsfiddle, removed templateurl ,...

c# - Quartz scheduler: avoid using class file and want to call a method directly -

i using quartz scheduler in project. have copy pasted code below.in area of code, type type=typeof(class) , need call method like, type type=typeof(methodname()) . dont want call external class file. int jobid = 0; jobdetailimpl job = null; quartz.impl.triggers.crontriggerimpl trigger = null; isimpletrigger simpletrigger = null; jobdatamap jobdatamap = new jobdatamap(); sheduler.start(); string cronexpression = "0 0/1 * * * ?"; type type = typeof(triggerjob1); job = new jobdetailimpl("job" + jobid + "", null, type); trigger = new quartz.impl.triggers.crontriggerimpl("trigger" + jobid + "", "job" + jobid + "", cronexpression); sheduler.schedulejob(job, trigger); triggerjob1 in above code class file created locally. according quartz scheduler, has functionality scheduler calls @ scheduled time. why want use method instead of triggerjob1 class file is:- using quartz scheduler in aspx file. have fun...

How to including a link in a body of text in android string resource -

i have string resource named large_text as <string name="large_text"> "lots of texts" ... "lots more text\n\n" ... "i not kidding" "so here phrase want make hyperlink" </string> so how make short phrase within large body of text hyperlink? the suggestion here not working : string.xml not compile. gives error error: content of elements must consist of well-formed character data or markup. even faced issue while using strings.xml ended using , works me. useageterms.settext(html.fromhtml("by tapping register, agree the\n " + "<a href=\"http://www.google.in/terms.html\">terms & conditions</a> google")); useageterms.setmovementmethod(linkmovementmethod.getinstance());

wordpress - How to retrieve specific ACF repeater row with matching sub-field value -

Image
i've experimented , researched hours trying find way work, i'm not having luck. so have couple different custom post types need co-mingle bit. let me try , explain clear , economically possible. there 2 custom post types, messages & campuses. (this large multi-campus church website). each message post have repeater rows based on campuses (through taxonomy field), , each campus post trying grab latest message post, , pull specific "campus" repeater row, , same field values row. the acf repeater section message single post... (we're choosing 1 of campus posts, manually entering speaker name , message url) so @ moment, i'm inside of "campus" single post, trying query , latest message post, working. i'm trying target , pull in values of specific repeater row inside of message post. repeater fields in message campus select (select box based on post object field (on "campus" post-type), , 2 different text fields. to further ...

sql - How to get rid of special character in Netezza columns -

Image
i transferring data 1 netezza database using talend, etl tool. when pull data varchar(30) field , try put in new database's varchar(30) field, gives error saying it's long. logs show field has whitespace @ end followed square, representing character can't figure out. attached screenshot of logs below. have tried writing sql pull field , replace thought crlf, no luck. when select on field , length, has few characters see, there , want rid of it. trimming not anything. this sql not return length shorter doing length() on column itself. know else be? select length(trim(translate(translate(<column>, chr(13), ''), chr(10), ''))) len_modified note last column in logs, see square in brackets, supposed show last character examined. save data larger target table size works. if 30 character data put in 500 character table. work. through character character on fields longest determine character being added. use commands ascii() determi...

vbscript - Excel Application.Quit doesn't kill the EXECL.EXE Process -

i’ve identified strange behaviour excel’s quit command can’t find explanation or solution to. the vbscript script below replicates problem. here does… creates new excel instance opens , closes set number of workbooks (controlled workbookstocreate ) attempts quit excel and proves whether excel did quit changing visible state true what i’ve gathered successful quit occurs when workbookstocreate set 0 or 1. if set 2 or higher, excel won’t quit properly. 'switch between 1 , 2 see difference '(1 = quit correctly, 2 = quit changes .visible false) const workbookstocreate = 2 'create new excel instance set xlapp = createobject("excel.application") xlapp.visible = true 'add, , close workbooks w = 1 workbookstocreate set wb = xlapp.workbooks.add wb.close false next 'attempt quit excel xlapp.quit 'test did quit xlapp.visible = true set xlapp = nothing i’m using excel 2010 on windows 7. i’ve tried numerous variations on thi...

javascript - how to pass a buffer to imagemin module in node.js? -

in older version of imagemin able pass module buffer so: new imageminify() .src(streamorbuffer) .use(imageminify.jpegtran({progressive: true})) in current version of imagemin there no src function , calling module result in promise. i not find how achieve same result in newer version of imagemin could done or support removed? i got answer github repo. i'm posting answer here in case else encounter same problem: you can supply buffer using imagemin.buffer . streams has never been supported.

raspbian - Segmentation fault trying to run bitcoind on raspberry-pi 2 -

i installed bitcoin node using raspberry-pi 2 + usb stick of 128 giga (hosting blockchain). cannot make run. get: $ bitcoind segmentation fault after googling while, possible causes found are: corrupted sd card or program electric supply issue (lack of voltage) hopefully it's non of them. insight or advice?

Command line build android apk from Qt app results in cannot read from json file error -

i need build android apk qt app using command line. android, jdk, ndk & ant set in env, running following qmake command. qmake project.pro -spec android-g++ config+=qtquickcompiler make -j2 make install install_root=android /users/buildmaster/qt/5.7/android_armv7/bin/androiddeployqt --output android --verbose --input android-libmyproject.so-deployment-settings.json running script ends in following error: cannot read input file: android-libmyproject.so-deployment-settings.json how can rid of above error & generate android apk ?

c# - Starting PowerPoint via Process.Start() in an ASP.NET web application results in PowerPoint starting in the background -

i'm going have asp.net mvc application run on many clients, of have own local version of iis running. i'm trying open powerpoint file process.start(). powerpoint opening (i can see in task manager) running in background , open in foreground. in order start application i'm using following code: string powerpointpath = @"c:\program files (x86)\microsoft office\root\office16\powerpnt.exe"; string powerpointfilepath = "\"" + filepath; process powerpoint = new process(); powerpoint.startinfo.filename = powerpointpath; powerpoint.startinfo.arguments = " /s " + filepath; powerpoint.start(); since i'm using local instance of iis, made sure grant read permissions powerpoint executable iis apppool\defaultapppool user. there way ensure powerpoint runs in foreground? edit: i'm able run code without issue when using iis express in visual studio (in case application using myname\myname user permissions) not seem work equivalentl...

javascript - Two input fields with the same name - on change event -

i have 2 input fields same name - because business logic of project. they that: <input type="file" name="director_front_passport[]" class="app-file" id="director_front_passport" /> <input type="file" name="director_front_passport[]" class="app-file" /> i need append image name after input field on change event.but in way, how make difference between these 2 inputs? i thought try differ them id attr, have clone button add more fields , don't think work on change event. updated: code on change event following: var inputs = document.queryselectorall( '.app-file' ); array.prototype.foreach.call( inputs, function( input ) { input.addeventlistener( 'change', function( e ) { //my code displaying image } } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> i updated code u...

how to create subsets of variables in SAS using a criteria -

i trying run regression 2 independent variables automatically selected (meeting criterion) variable list. example, variable list is: var1 var2 var3 var4 var5 i trying run 10 regressions using pattern: outcomevar = var1 var2 outcomevar = var1 var3 . . . outcomevar = var2 var3 . . . outcomevar = var4 var5 i trying generate macro contain loop automatically build these regressions. trying use %scan function generate loop cannot formulate criteron variable selection. a nested loop 1 option : %macro combi ; %let nvar = 5 ; %do x = 1 %to %eval(&nvar - 1) ; %do y = %eval(&x + 1) %to &nvar ; %let outcomevar = var&x var&y ; %put &outcomevar ; /* else outcomevar */ %end ; %end ; %mend ; %combi ; if variables aren't numbered , sequential, you'd need adopt different approach : %macro combi ; %let varlist = somevar thisvar thatvar varx vary ; %let nvar = %sysfunc(countw(&varlist)) ; %do x = ...