Posts

Showing posts from February, 2011

angular - Primeng Button not showing label -

i have primeng button in angular4 application. label of button not displaying.button displaying small without label. <div id="main"> <form #newjobcleanupform="exform" (ngsubmit)="onsubmit(exampleform)"> <label class="stylelabel" for="jobnumber"><span>job number</span> <input type="text" pinputtext class="styletext" id="jobnumber" required [(ngmodel)]="jobnumber" name="jobnumber"> <button pbutton type="button" label="click"></button></label> </form> </div> this issue caused missing import of primeng's buttonmodule. please add import same module, component defined in. import {buttonmodule} 'primeng/primeng'; ... @ngmodule({ imports: [ ... buttonmodule ] ...

java Mailgun email validation API response not working -

can 1 please? i have created test mailgun domain , have public , private api key. i using jersey client validate email address using mailgun api. don't json response instead string "mailgun magnificent api". below piece of code public static clientresponse validateaddress() { client client = client.create(); client.addfilter(new httpbasicauthfilter("api", myapikey)); webresource webresource = client.resource("https://api.mailgun.net/v3/sandboxxxxx.mailgun.org/validate"); clientresponse response = webresource.queryparam("address", "mamta.solanki@ecrebo.co.uk").accept("application/json").type(mediatype.application_json_type).get(clientresponse.class); return response; } public static void main(string args[]) { clientresponse res = validateaddress(); system.out.println(res);}

arduino - How to find specific Teensy in COM list -

i new first project making skype notification cube teensylc , leds. know can hard-code com port communications if unplug , use different plug com port changes. i'd able plug board in , have software find automatically. [edit] it looks didn't express myself first time, let me try again. if call serialport.getportnames() array of {"com1", "com2", "com3"}. if make new serialport() using names properties same. there's nothing can see differentiate teensylc other com port. what best way find teensy board without knowing com port?

html5 - What event will capture the resizing of the browser window? -

i have custom slider, shown when user clicks on font awesome button.this model works quite me. add event listener slider object focusout event, , show or hide slider. i notice when user resizes browser screen, not seen focusout, because in case slider not disappear ( to). so question is, event capture resizing of browser window, in order me hide slider way? thanks!

sapui5 - How to d3.js in UI5? (View.xml | controller.js) -

i have ui5 webapp sites. how can add d3 graph webapp. dont know how should write in view(xml) , controller (js). can me please? greetings florian imo, not question, rather request write application you. not problem if willing pay :) try more specific , own investigation in advance. example: overflow , sap , etc.. the last link contains pretty need know. high level overview: create custom control using sap.ui.core.control.extend override metadata + ui5 controls lifecycle methods (like oonafterrendering) write renderer put there d3js coding

rest - Are public POST routes dangerous if they don't hit the database? -

i'm creating simple calculator api. on there have endpoint named /calculate . can post few params , run calculation. i'm using basic authentication know isn't have enabled testing. my question is: having route open public hit bad idea? type of issues face or if it's simple calculations not problem? any insight dangers brings great, thanks!

javascript - How to change a parameter inside an object? -

begginer here. var player() = { isdrunk: false } how set isdrunk true after player uses item "beer"? (completely made-up example) to answer question player.isdrunk = true so have var player = { lefthanded: false, righthanded: true, isdrunk: false }; and then function drinkbeer(player) { player.isdrunk = true; } then can pass players drinkbeer function needed. alternatively can put function inside player object if want each individual player have drinkbeer() function can use change own isdrunk property calling player.drinkbeer() that this: var player = { lefthanded: false, righthanded: true, isdrunk: false, drinkbeer: function() { isdrunk = true; } };

(AngularJS) Make a "ng-show" true specifically for one element in a ng-repeat -

i'am begining in angular, , i'am asking if possible make "ng-show" true 1 element in "ng-repeat", , make false others? i explain myself code: html file : <tbody ng-repeat="elem in list" ng-init="visible = false"> <tr ng-class="elemselected(elem)"> <td colspan="3"> <a href ng-click="clickelemscroll(elem)" > <span class="glyphicon" ng-class="visible? 'glyphicon-chevron-down' : 'glyphicon-chevron-right'"></span> <strong>{{elem.name}} </strong> </a> </td> </tr> <tr ng-show="visible" > blabla </tr> </tbody> j...

database - How to efficiently compare two subsets of rows of a large table? -

i use postgresql 9.6 , table schema follows: department, key, value1, value2, value3, ... each department has hundreds of millions of unique keys, set of keys more or less same departments. it's possible keys don't exist departments, such situations rare. i prepare report 2 departments points out differences in values each key (comparison involves logic based on values key). my first approach write external tool in python that: creates server-side cursor query: select * my_table department = 'abc' order key; creates server-side cursor query: select * my_table department = 'xyz' order key; iterates on both cursors, , compares values. it worked fine, thought more efficient perform comparison inside stored procedure in postgresql. wrote stored procedure takes 2 cursors arguments, iterates on them , compares values. differences written temporary table. @ end, external tool iterates on temporary table - there shouldn't many rows there. i though...

Xamarin Live Error with SQLite -

i have error using sqlite xamarin live in shared project error : uncaught exception no body on method sqlite.sqliteasyncconnection.. the code connection is: [assembly: dependency(typeof(sqlitedb))] namespace helloworld.ios { public class sqlitedb : isqlitedb { public sqliteasyncconnection getconnection() { var documentspath = environment.getfolderpath(environment.specialfolder.mydocuments); var path = path.combine(documentspath, "mysqlite.db3"); return new sqliteasyncconnection(path); } } } the code in page is: public usingcrud() { initializecomponent(); //call getconnection() method , link our private field. _connection = dependencyservice.get<isqlitedb>().getconnection(); }

java - maven equivalent for gradle `compile fileTree(dir: 'libs', include: '*.jar')` -

what maven equivalent gradle's one-liner include jars lib(s) folder? i.e. : dependencies { compile filetree(dir: 'libs', include: '*.jar') } i have set of project mavenize, , average project ~50 jar in lib folder, takes @ least half day thorough searching on http://mvnrepository.com/ , guessing versions , jar dependencies looking inside jar etc work solve technical debt of jar hell. the problem old, , of july 2017, 1 can find - how include system dependencies in war built using maven - how add local jar files in maven project? listing similar answers limitations. new me plugins - addjars-maven-plugin , dead @ https://github.com/kahing/addjars-maven-plugin - non-maven-jar-maven-plugin @ https://github.com/stephenc/non-maven-jar-maven-plugin thinking on again, first step mavenize project should let compiler use existing jars focus on code, not on dependencies (that has jar put there case, or copied in bulk) <!-- not work --> ...

java - OSX App Bundle, main jar execs second jar in the same bundle -

i have osx app bundle .app containing 1 .jar file named client.jar . client.jar set "to run" javaapplauncher in info.plist . start .jar named server.jar by calling runtime.getruntime.exec("java -jar server.jar") in client.jar file. issue is, not know place other server.jar file run properly. the current file tree is: - contents |- info.plist |- java |- client.jar |- macos |- javaapplauncher |- plugins |- resources |- icon.icns |- en.lproj this bundle has been created using jar2app script. the info.plist : </plist> <dict> <key>cfbundledevelopmentregion</key> <string>english</string> <key>cfbundleexecutable</key> <string>javaapplauncher</string> <key>cfbundleiconfile</key> <string>icon.icns</string> <key>cfbundleidentifier</key> <string>com.jar2app.e...

.net - ASP.NET TicketDataFormat.Unprotect(cookieValue) returns null -

i trying decrypt authentication cookie set .net 4.6.2 mvc app created following in startup.auth: ticketdataformat = new aspnetticketdataformat( new dataprotectorshim( dataprotectionprovider.create(new directoryinfo(@"c:\keys\")) .createprotector("blah"))) this i'm doing try , decrypt it: // create data protector facilitate in decrypting cookie. var provider = dataprotectionprovider.create(new directoryinfo(keydirectory)); var dataprotector = provider.createprotector(dataprotectorpurpose); // decrypt cookie, obtaining authentication ticket. var ticketdataformat = new ticketdataformat(dataprotector); var ticket = ticketdataformat.unprotect(cookievalue); this working fine until started identity customisation. have created new identityuser inherits identityuser can add few fields. failing read identity maybe? thanks i have solved through lot of playing about. it turne...

ember.js - Rails ActionCable and Ember CLI app - Resource Bottlenecks -

we've implemented real time updates in our app using actioncable in rails , implemented consumer client service in ember cli, looking better, less-expensive approach. app/models/myobj.rb has_many :child_objs def after_commit actioncable.server.broadcast("obj_#{self.id}", model: "myobj", id: self.id) self.child_objs.update_all foo: bar end app/models/child_obj.rb belongs_to :myobj def change_job self.job = 'foo' self.save actioncable.server.broadcast("obj_#{self.myobj.id}", model: "child_obj", id: self.id) end frontend/app/services/stream.js here we're taking model , id data broadcast , using reload server. import ember 'ember'; export default ember.service.extend({ store: ember.inject.service(), subscribe(visitid) { let store = this.get("store") myactioncable.cable.subscriptions.create( {channel: "objchannel", id: objid}, { received(data) { ...

r - Faster calculation of onset days for rainy season -

i have huge set of csv datafiles (ca. 4 million) , each file contains climate data (temp, precip etc.) 30 years. want use these data calculate onset of rainy season. each file corresponds cell of grid (2544 rows x 1928 columns). wrote loop calculate onset days every row, resulting in file 57.840 rows (1928 x 30). scripts works fine, takes 18 minutes row, means need 31.8 days finish calculations. does have idea on how speed these calculations? here code: #set path working directory path="z:/md/projects/.../climate-data/row-0" setwd(path) files <- list.files(path =path, full.names = t, recursive = t, pattern=glob2rx("*col*.csv*")) results<-data.frame() name <- strsplit(path, "/")[[1]][6] (file in files){ asc<-read.table(file, sep=",", skip=0, header=t) name2 <- strsplit(file, "/")[[1]][7] name2<-str_sub(name2,-nchar(name2),-5) q<-mean(asc$precip) x<-1 vector <- vector(...

sapui5 - How to put set of links in Link List card in Fiori Overview page? -

i want put external links such as(google.com, yahoo.com) in link list card. if knows how great help. use sap.m.link. did simple demo you . var olink = new sap.m.link(); olink.settext("link url (target: www.sap.com)"); olink.settooltip("target: www.sap.com"); olink.sethref("http://www.sap.com"); olink.settarget("www.sap.com"); olink.placeat("content");

database - Oracle change Date to time stamp -

my table has date type column need see gmt information idea change timestamp column. how change column has value filled? create table pro_tfestivo ( oid_festivo number(10) not null, fecha_hora_envio date timestamp ); thank all!! you cannot change date/timestamp type without: create temporary column existing values; create new table original name; fill existing values "new" column. convert date timestamp time zone: alter table pro_tfestivo rename column fecha_hora_envio old_fecha_hora_envio; alter table pro_tfestivo add fecha_hora_envio timestamp time zone; update pro_tfestivo set fecha_hora_envio = from_tz(cast(old_fecha_hora_envio timestamp), 'gmt'); alter table pro_tfestivo drop column old_fecha_hora_envio; plus :) convert timestamp time zone date: alter table pro_tfestivo rename column fecha_hora_envio old_fecha_hora_envio; alter table pro_tfestivo add fecha_hora_envio date; update pro_tfestivo set fecha_hora_envio = cast(to_timestamp...

html - Scss files not compiling using Gulp -

i'm getting issue whereby i'm trying compile scss files, i'm getting error: $ gulp [17:02:35] using gulpfile c:\wamp\www\testsite\gulpfile.js [17:02:35] starting 'sass'... [17:02:35] starting 'copy-imgs'... [17:02:35] finished 'copy-imgs' after 4.14 ms [17:02:35] starting 'copy-assets'... [17:02:35] finished 'copy-assets' after 8.03 μs error in plugin 'sass' message: testsite\sass\test\_blog.scss error: undefined variable: "$lt-small". on line 19 of testsite/sass/test/_blog.scss >> @media($lt_small) { the issue have variables.scss file, defining these variables, @ same (folder) level. little unsure why coming undefined? variables.scss need sit somewhere else within structure? apologies if vague. it says error; undefined variable: "$lt-small". the $lt-small has defined before used also have import variables.scss file before _blog.scss file.

Fetch column from datafrom and use as array by python pandas -

i want fetch column dataframe array. then make new array array attach original dataframe. my dataframe(df) this. close per 0 637.0 -0.156740 1 638.0 0.789889 2 633.0 -1.555210 3 643.0 -1.832061 4 655.0 0.000000 then try fetch column dataframe , make moving average. newarray = pandas.rollling_mean(df.per,3) ## fetch array then want attach original datafrom df[sma] = newarray what want this close per sma 0 637.0 -0.156740 636 1 638.0 0.789889 638 2 633.0 -1.555210 643.6 3 643.0 -1.832061 nan 4 655.0 0.000000 nan however think there comfusion dataframe , array. maybe might misunderstanding. how can correct this?? depending on goals: in [39]: df['sma'] = df.close.rolling(3).mean() in [40]: df out[40]: close per sma 0 637.0 -0.156740 nan 1 638.0 0.789889 nan 2 633.0 -1.555210 636.000000 3 643.0 -1.832061 638.000000 4 655.0 0.000000 643.666...

react native - Listening for Auth Success From Realm Sync Server -

i'm playing around realm , realm object server , i've got things working structure of blocking me. i'm performing basic login so: realm.sync.user.login('http://ipaddress:9080', 'user', 'password', (error, user) => { if (!error) { console.log('success'); } else { console.log(error); } }); i know can create new realm object schema , sync config within closure. however, since want use realm object throughout application, i'd want auth process 1 step , once successful, create/get realm object can use throughout rest of application, including listening events. if had sort of structure so... - src -- realm ---- auth.js // auth ---- index.js // exports realm object -- app.js - index.ios.js - index.android.js with app.js being main entry point application, i'd want set state on changes when login successful, can allow other parts of application available. don't want auth code directly inside app.js ; i'...

jquery - Background become black but the content of the modal doesn't appear -

i'm trying use modal attribute. when user click on image suppose display text have write following code. <div class="col-md-4 gallery-left"> <a data-toggle="modal" data-target=".bs-example-modal-md" href="#mymodal" class="b-link-stripe b-animate-go thickbox"> <img class="img-responsive lot" src="{% static 'img/toothbrush.jpg' %}" alt=""> <div class="b-wrapper"> <div class="b-animate b-from-left b-delay03 "> <i class="plus second"> picture description </i> </div> </div> </a> </div> <div id="mymodal" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- modal content--> <div class="modal-content"> <div class="modal-header...

javascript - How can I get Current Local Time in California, United States using Moment.js? -

i searched doing can time zone of country var la = moment.tz("america/los_angeles").format('yyyy-mm-dd hh:mm:ssz'); but when california no time zone available ? running fiddle running example solution :america/tijuana have same timezone america/california because california not valid iana time zone identifier . also the moment-timezone docs : the moment.tz constructor takes same arguments moment constructor, uses last argument time zone identifier . what do? use america/los_angeles , or other identifier in same time zone need.

error in google sheets script: "TypeError: function split not found in object 0. (line16, file" SplitAuto ")." -

i have script worked before, few days, 1 no longer works ..... have error: "typeerror: function split not found in object 0. (line16, file" splitauto ")." can me please? my script : function splitalltest(){ var ss=spreadsheetapp.getactivespreadsheet(); var s=ss.getsheetbyname("réponses au formulaire 1"); var lr=s.getlastrow(); var lc=s.getlastcolumn()-8; //data columns num var range=s.getrange(1, 3, lr, lc).getvalues() var output=[]; var split=[]; var l = 0; // outout row count for(var i=0;i<range.length;i++){ //row roop // split column_data var split = []; var max1 = 0; for(var j=0;j<range[0].length;j++){ // column roop var colsplit = range[i][j].split(", "); split[j] = colsplit; if(max1 < split[j].length) max1 = split[j].length; } // push new rows data for(var k=0;k<max1;k++){ // max1 output [l] = []; for(var j=0;j<lc;j++){ // column if(k < split[j].leng...

firebase - FCM with Postman - The request was missing an Authentication Key (FCM Token) -

Image
//body this { "to": "/topics/news" , "data":{ "extra_information": "this information" }, //notification need give "notification":{ "title": "chitchat group", "text": "you may have new messages", "click_action":"chatactivity" } } the 401 error pertains authorization key invalid or incorrect. when using postman, add key= prefix value of authorization, so: key=aaa... see stack overflow documentation did sending downstream fcm messages using postman . also, notification message payload, text isn't 1 of valid parameters, think looking message instead.

sap - How do can I return a summation of the results of MB51 instead of the row-by-row transactions? -

i using sap windows (sap netweaver; 730 final release, version 7300.3.15.1085) , need find faster way part of routine. use form mb51 along criteria find transactions need. then, select quantity in une column , hit sigma (add values) symbol @ top. gives me sum total of rows @ bottom. the goal simplify process. want able add in material, plant, reference, , document header texts , return sum of rows. literally need final sum , nothing else. know of form in sap can me this? or know of way customize mb51 achieve desired output? in addition dirk's proposal use sap query, can consider creating sap transaction variant , running in background mode . this allows executing transaction specified parameters (including summation) periodically , sending results email . it looks lack development permissions on system, can simplest way acquiring mb51 sum. besides permissions, task requires knowledge of mb51 tables , relations.

reactjs - DRY react-router's getComponent functions -

routing react-router, redux , redux-saga entails lot of repeated code, have here . 21 lines single route. in app have dozens of routes, important dry out somehow. otherwise file routes.js mess 1000+ lines. any ideas? finally came this . works fine , helps make 1 route declaration 4 lines simple routes , 8 using sagas , childroutes.

c# - MvvmCross - Image failed to download Mvximageview -

i new mvvmcross , xamarin. making sample app showing image. now, have found few tutorial on how show image using mvximageview image url want show giving me error. here full error stack: 07-26 00:35:07.531 d/mono (25755): config attempting parse: 'system.core.dll.config'. 07-26 00:35:07.531 d/mono (25755): config attempting parse: '/usr/local/etc/mono/assemblies/system.core/system.core.config'. 07-26 00:35:07.531 w/mono (25755): request load assembly system.core v4.0.0.0 remapped v2.0.5.0 07-26 00:35:07.531 d/mono (25755): unloading image system.core.dll [0x96327100]. 07-26 00:35:07.536 d/mono (25755): image addref system.core[0x961f25a0] -> system.core.dll[0x9b95a000]: 48 07-26 00:35:07.536 d/mono (25755): config attempting parse: 'system.core.dll.config'. 07-26 00:35:07.536 d/mono (25755): config attempting parse: '/usr/local/etc/mono/assemblies/system.core/system.core.config'. 07-26 00:35:07.936 i/mvx (25755): 169.72 ...

c++ - Why does decltype(declval<T>().func()) work where decltype(&T::func) doesn't? -

i trying detect presence of member function baz() in template parameter: template<typename t, typename = void> struct implementsbaz : public std::false_type { }; template<typename t> struct implementsbaz<t, decltype(&t::baz)> : public std::true_type { }; but produces false: struct foo {}; struct bar { void baz() {} }; std::cout << implementsbaz<foo>::value << std::endl; // 0 std::cout << implementsbaz<bar>::value << std::endl; // 0 using declval , calling method work, though: template<typename t> struct implementsbaz<t, decltype(std::declval<t>().baz())> : public std::true_type { }; of course, can detect baz function 0 arguments. why specialization correctly selected when using declval<t>().baz() , not decltype(&t::baz) ? if use void_t "detection idiom", does work expected: template <typename...> using void_t = void; template <typename t> str...

wordpress - Find element with class and add one more in php string -

i'm trying make own filter audio shortcode in wordpress. find element class , add 1 more . i've got string html code , str_replace doesn't work. <div id="mep_0" class="mejs-container svg mejs-audio" tabindex="0" role="application" aria-label="audio player" style="width: 416px; height: 30px;"> i add ' test-class ' div ' mejs-container '. want add id ('mep_0') not fixed. you can use xpath purpose. this simple example: $dom = '<div id="mep_0" class="mejs-container svg mejs-audio" tabindex="1" role="application" aria-label="audio player" style="width: 416px; height: 30px;"> <div id="mep_1" class="mejs-container svg mejs-audio" tabindex="0" role="application" aria-label="audio player" style="width: 416px; height: 30px;"> <div id=...

windows - Value does not fall within the expected range in VS2015 Enterprise -

i facing 1 problem in using vs2015 here steps did. - created xamarin native project in vs2015 on windows - coded shared project , xamarin.ios project in vs2017 on mac - zipped , copy/paste above projects windows - extract zipped files solution , replaced old projects - open solution in windows - open files of shared project , xamarin.ios project(getting error here) i facing error message "value not fall within expected range" when trying open files edited in mac. how can fix , open files? thanks.

module - All Elements Changing on Hover Modular Jquery -

i'm experimenting modules , i'm unsure of how change scope of hover event in way. you'd guessed i'd image i've hovered on change. appreciated :) it's going obvious literally can't think of how fix it. console.log(this.$itemicon); returns [img, img, img, img, prevobject: m.fn.init(4), context: document, selector: ".work-item img"] where i'm trying return [img, context: img] here shortened version of code: (function () { var set = { init: function () { this.cachedom (); this.bindevents (); }, cachedom: function () { this.$item = $(".work-item"); this.$itemicon = this.$item.find("img"); }, bindevents: function () { this.$itemicon.hover(growshrink.grow.bind(this), growshrink.shrink.bind(this)); }, }; var growshrink = { grow: function() { this.$itemicon.animate({height: "...

java - Error scanning entry "module-info.class" when starting Jetty server -

i'm seeing when start java server. has else seen this? if whats fix? can confirm jar's , module-info.class present in relevant paths. multiexception[java.lang.runtimeexception: error scanning entry module-info.class jar file:jetty/9.2.4.v20141103/tempdirectory/webapp/web-inf/lib/slf4j-api-1.8.0-alpha2.jar, java.lang.runtimeexception: error scanning entry module-info.class jar file:jetty/9.2.4.v20141103/tempdirectory/webapp/web-inf/lib/log4j-over-slf4j-1.8.0-alpha2.jar, java.lang.runtimeexception: error scanning entry module-info.class jar file:jetty/9.2.4.v20141103/tempdirectory/webapp/web-inf/lib/jcl-over-slf4j-1.8.0-alpha2.jar] @ org.eclipse.jetty.annotations.annotationconfiguration.scanforannotations(annotationconfiguration.java:535) @ org.eclipse.jetty.annotations.annotationconfiguration.configure(annotationconfiguration.java:446) @ org.eclipse.jetty.webapp.webappcontext.configure(webappcontext.java:473) @ org.eclipse.jetty.webapp.webappcontext.startcontext(w...

c++ - Finding the memory location of a compile-time constructed class -

i'm trying memory-usage analysis of using compile-time constructed classes looking @ artifacts generated compilation. i've marked several class constructors "constexpr" , made sure they're trivial ensure compile-time construction. viewing map file, can see constructors , destructor functions not included in .text section more. where, though, these classes appear? had assumed included in .data section static instance of class, doesn't seem case. .text section has shrunk other sections seem same. data going? (i'm using gcc 5.2.0 , creating statically-linked elf.) edit: here's bit of sample code. #include <stddef.h> #include <stdint.h> struct abstractmemoryaccess { virtual uint32_t read() const = 0; virtual void write(const uint32_t data) const = 0; }; class concertememoryaccess : public abstractmemoryaccess { public: constexpr concertememoryaccess(const size_t baseaddress) : _baseaddress(baseaddress) ...

python - Django 'next' redirect for log in and new user -

i have e-commerce website users can view ads without logging in. when want post ad re-directed login page, after successful login directed 'create ad' page. functionality working fine. problem when user re-directed log in page, , clicks on 'new user' , creates account, not redirected 'create ad' page after successful account creation. my code looks far: login.html: #login form <form method="post" action="{% url 'login' %}"> {% csrf_token %} {% if request.get.next %} <input type="hidden" name="next" value={{ request.get.next }} /> {% endif %} <b>name:</b> {{ form.username }} <b>password:</b> {{ form.password }} <input type="submit" value="ok"> </form> # button redirect new account creation page <a href="{% url 'unauth_home_new' %}#section0"><button>new account...

python - VS2017 Django Web Project build fails without bin folder -

i have created django web project in visual studio 2017 , have tried serving static files directory defined in staticfiles_dirs in settings.py . settings.py: staticfiles_dirs = ( os.path.join( base_dir, 'static', ), ) once had in settings.py project didn't build anymore. after quite time battling ide (i had no errors, failed build , gave no reason why) figured out if copy bin folder hobby project made time ago ptvs , vs 2015, project builds fine. , have absolutely no idea why. the contents of bin folder 2 files: microsoft.pythontools.webrole.dll , wfastcgi.py . i don't have pc vs 2015 anymore can't check ide settings there , pretty sure didn't make changes nor have had trouble settings.py or serving static files in project. can explain why happening? why vs 2017 not creating bin folder vs 2015 did. there missing? using: vs2017 professional python development installed vs installer - pretty default settings

java - Cannot add a map in android studio without crashing -

i've tried million things fix map can't life of me. in app, have button open map locally , crashes every time press it. activity_map.xml: <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/map" android:name="com.google.android.gms.maps.supportmapfragment" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.jayster.jayster_app.mapsactivity" /> mapsactivity.java: package com.jayster.jayster_app; import android.support.v4.app.fragmentactivity; import android.os.bundle; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.onmapreadycallback; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.m...

ios - CloudKit: Get users firstname/surname -

i'm trying users first name using cloud kit following code not getting users first name , leaving firstnamefromfunction variable empty. know how achieve in ios 10? let container = ckcontainer.default() container.fetchuserrecordid { (recordid, error) in if error != nil { print("handle error)") }else{ self.container.discoveruserinfo( withuserrecordid: recordid!, completionhandler: { (userinfo, error) in if error != nil { print("handle error") }else{ if let userinfo = userinfo { print("givenname = \(userinfo.displaycontact?.givenname)") print("familyname = \(userinfo.displaycontact?.familyname)") firstnamefromfunction = userinfo.displaycontact?.givenname ...

python - how to run .py script with user input as parameters -

i have .py file, 'car.py'. takes 3 inputs (color, make, year). takes user input , reads file, returns matching instances of color, make, , year given in input. script runs fine. now, create web page works search page. asks 3 inputs, searches file (locally) , returns results. i using django first time , having difficulty figuring out how call car.py file , have run on background before returns result. i have html interface made know cant ref python script in it. there similar in django? can reference script , when button pressed, it'd run script given user input? i don't expect full coded response, want clarification or reference answer. haven't been able find similar online. gonna move response of how submit form in django here instead of comment, since it's more of answer now. when submit form, typically post request sent website form's values in it. when form submit route, mean post request sent particular view in django website, vie...

c# - PCLStorage FileSystem is only available in Android, not iOS -

i'm writing cross platform application in xamarin, android , ios, , need save text files local storage. i'm using pclstorage, whenever mouse on pclstorage code, says "myapplication.android: available, myapplication.ios not available". how can use pclstorage store files on both platforms? or there way can this? here's example of of code: public async task createrealfileasync(string filename, string filebody) { // hold of file system ifolder rootfolder = filesystem.current.localstorage; // create folder, if 1 not exist ifolder folder = await rootfolder.createfolderasync("dadappfiles", creationcollisionoption.openifexists); // create file, overwriting existing file ifile file = await folder.createfileasync(filename, creationcollisionoption.replaceexisting); // populate file text await file.writealltextasync(filebody); }

javascript - Promise moving onto next .then() before resolving? -

i have simple web app logging onto customer facing webservers , downloading log files on request. when send request route module initiates connects via sftp webserver , downloads logs locally, 2 separate servers. reason last then() method in chain getting triggered before promise resolves. router.js: var express = require('express'); var router = express.router(); var gather = require('../api/gather'); /* home page. */ router.get('/', function(req, res, next) { res.render('home'); }); router.get('/api/gather',function(req,res,next){ console.log('sending web9 target'); gather.logs(['web9']) .then((logsfound)=>{ console.log('sending web 11 target'); gather.logs(['web11',logsfound]) }) .then((logsfound)=>{ console.log(logsfound); console.log('downloading finished rendering home message'); res.render('home',{message: logsfound+' log files ready pic...

multiprocessing - How to increases the CPU usage of my Python program? -

i writing program in raspberry pi 3 read inputs using mcp3008 adc function generator. want read 2 channels @ same time , write file. when have 1 channel, 12000 samples per second, however, when have 2 channels, 6000 samples per second each channel. 12000 samples per second each channels, tried write 2 different scripts, 1 each channel , run them simultaneously in 2 different terminals. however, not solve problem , gives me 6000 samples per second each channel. when have 1 script, 9% cpu usage. when run 2 scripts @ same time in 2 different terminals, 5% cpu usage each process. how each process use 9% cpu each or higher? thank you! here code: import spidev, time, os # opens spi bus spi = spidev.spidev() spi.open(0, 0) #spi1 = spidev.spidev() #spi1.open(0, 1) ch0 = 0 #ch1 = 1 = time.time() * 1000 data = open("test_plot.dat", "w") #data1 = open("test_plot_1.dat", "w") def getreading(channel): # pull raw data chip rawdata = sp...

c# - MVC EditorFor date doesn't update the sub property in foreach loop -

i'm passing model view , want change user.bannenddate in view , send controller. no matter user.bannenddate actionlink pass value set arrived model. can me ? [model] [datatype(datatype.date)] public datetime? bannenddate { get; set; } [view] @foreach (var user in model.users) { @html.actionlink("bann", "bannuser", "account", new { userid = user.id, bann = true, bannenddate = user.bannenddate} , null) @html.editorfor(u => user.bannenddate) } [controller] public actionresult bannuser(string userid, bool bann, datetime? bannenddate){} as mike mccaughan stated, values @html.actionlink static, since they're written when call page. what do, give actionlink , editorfor specific id. @html.actionlink("bann", "bannuser", "account", new { userid = user.id, bann = true, bannenddate = user.enddate }, new { @id = "targetlink_" + user.id }) @html.editorfor(m => user.bannenddate,...

c# - Is it possible to add fields with invalid characters to a .net AnonymousType? -

i'm trying send json message facebook call game.achievement wanted create object using anonymoustype before posting. problem 1 of fields "game:points" (with colon). can see i've used @ prefix object field doesn't work game:points field. gets underlined in red , won't compile. var paramsjson = new { privacy = new { value = "all_friends" }, @object = new { app_id = "my app id", type = "game.achievement", title = "test", @"game:points" = 100, description = "test", image = "img.png" } }; i've tried many varieties of @, double quotes etc. possible or need use stringbuilder this? why don't use dictionary? var postdata = new dictionary<string, object...

dashboard - Real time Dash board for kafka -

i looking real time data visualization kafka. know a. how many messages kafka has processed b.messages pending in topic. c.what consumers live / dead / not consuming we using horton works cluster kafka 0.10 please let me know if know utility or open source api can plug n play. thanks in advance

c++ - string::insert produces a runtime error -

i have string b, want reverse it, append result string a. tried gives me runtime error a.insert(a.end(), b.rbegin(), b.rend()) which is terminate called after throwing instance of 'std::length_error' what(): basic_string::_m_create what's problem line of code ? update : here short program throws same exception : #include <iostream> #include <string> using namespace std; int main (int argc, const char* argv[]) { string result="bbb"; string tail="aaa"; result.insert(result.end(), tail.rend(), tail.rbegin()); cout << result << endl; return 0; } i using gcc 5.4.0 on ubuntu 16.0.4 the "insert" you're using doesn't work because: inserts characters range [first, last) before element pointed pos. overload not participate in overload resolution if inputit not satisfy inputiterator. (since c++11) the begin() of can't valid pos. case,...

.htaccess - How to redirect to https my domain with current htaccess settings? -

i'm new htaccess file, , current configuration follows: <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> now, find out if want redirect https, need use following: rewriteengine on rewritecond %{https} !^on$ rewriterule .* https://%{server_name}%{request_uri} [l,r] my question should put these lines? can delete current configuration? greatfull can explain current configuration does, or @ least point right direction. solved issue adding code @ top of .htaccess <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{server_port} !^443$ rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] </ifmodule> this let's serve static content (css, images) through https

spring - Java : Google Reverse Geocoding with jackson API -

i want address using google maps api. in project using jackson parser. i want know that, how can expected result i.e. :- "a10, dhamidhar rd, yashkamal society, vasna, ahmedabad, gujarat 380007, india" i want ignore other fields in api. there many objects in json file. want fetch : " "formatted_address" : "a10, dhamidhar rd, yashkamal society, vasna, ahmedabad, gujarat 380007, india"," http://maps.google.com/maps/api/geocode/json?latlng=23.0043673,72.5411868999996&sensor=false thank you this have tried package com.example.api.batch; import java.io.ioexception; import java.io.inputstream; import java.util.arraylist; import java.util.list; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.defaulthttpclient; import com.fasterx...

c# - Linq to SQL Distinct Value Dictionary -

i wish use linq sql query turn dictionary of distinct values. both key , value come query.. var model = db.landgrid_plss_sections .select(x => new {x.meridian_code,x.meridian}) .todictionary(kvp=> kvp.meridian_code string, kvp=> kvp.meridian string) .distinct(); this returns exception saying item key value exists. this dictionary need of type dictionary<string,string> update in table, meridian_code have same meridian value. occur multiple times in table. meridian user friendly version of code. need both available me in view. try this: var model = db.landgrid_plss_sections .groupby(s => s.meridian_code, s => s.meridian) .todictionary(s => s.key, v => v.first());

Accessing Lambda functionality in Amazon Lex console -

i started playing around amazon lex build chatbots. i've been following examples 1 issue can't see use lambda functionality in user console. can't tell if due resource 404s see in console or if functionality cannot controlled through ui. i'm not able type aws lambda function field under fulfillment on intent, can't figure out populate goes in dropdown. page have 404s, around loading /lex/api/iam resource. is familiar lex console? i've looked through documentation, i've disabled browser extensions might interfering, feel i'm missing don't know what. reading if got far. amazon lex console 404 errors - image amazon lex console - fulfillment dropdown - image the list populated lambda functions in same region. must have created lambda function list populated. aws lambda requires access permission lex below: aws lambda add-permission --function-name lex-test --statement-id chatbot-fulfillment --action "lambda:invokefunction...

Extracting a part of a Cell in Excel -

Image
i have particular cell example cn=cloud test1,ou=corp,ou=bt-users,ou=btatter,ou=test,ou=ad uat,ou=services,ou=managed users,dc=ngco,dc=com the number of ou= varies different records, goal extract has ou= infront of it, want: "ou=corp,ou=bt-users,ou=btatter,ou=test,ou=ad uat,ou=services,ou=managed users" as output. thanks again help! as array formula: =textjoin(", ",true,if(left(trim(mid(substitute(a1,",",rept(" ",999)),(row(1:99)-1)*999+1,999)),2)="ou",trim(mid(substitute(a1,",",rept(" ",999)),(row(1:99)-1)*999+1,999)),"")) being array formula, needs confirmed ctrl-shift-enter instead of enter when exiting edit mode. textjoin() available subscription office 365 excel. if not have textjoin(), put code in module attached workbook , use formula described above: function textjoin(delim string, skipblank boolean, arr) dim d long dim c long dim arr2() dim t l...

javascript - Targeting the nth element of certain class when nth checkbox is checked? -

so have dynamically listed set of elements, each structured follows: <div class="under-item-description"> <span class="under-compare-price">100</span><span class="under-price">50</span> <span class="under-compare-price-2">200</span><span class="under-price-2">100</span> <div class="under-quantity"> <label class="under-quantity-button"> <input type="radio" checked="checked" name="quantity-1" class="under-quantity-radio" value="1"/> </label> <label class="under-quantity-button"> <input type="radio" name="quantity-2" class="under-quantity-radio" value="2"/> </label> </div> </div> the amount of times .under-item-description div shown on page can change. currentl...

jquery - trigger event on selecting item from datalist, not when typing -

i have form this: <input list='data-list' id='list'> <datalist id='data-list'> <option>first</option> <option>second</option> </datalist> the user can select item datalist -or- can type in it's own value. connection database through json call php script fill in other information in rest of form. want trigger when user typed name in list-input (so when content blurred) or when user clicked option datalist. using $( ':input#list' ).on( 'change', function... function triggered when input loses focus, when item data-list selected waits 'till input loses focus, want event fire straight away using $( ':input#list' ).on( 'input', function... clicking item datalist triggers function straight away, want, typing trigger event well, each keystroke, sending lot of unwanted requests php script. i have tried binding event datalist directly, didn't work. i looking trigge...