Posts

Showing posts from April, 2012

stanford nlp - Identifying dates of the form \d\d-\d\d-\d\d using regexner -

i using stanford regexner alongwith ner in pipeline. want identify strings of form [0-9][0-9]-[0-9][0-9]-[0-9][0-9] (e.g., 27-02-16) date, ner identifies number. so, defined regex in mapping file , gave regexner. regexner not able identify such strings dates. ner these tokens still number. following mapping file: [0-9]{2}-[0-9]{2}-[0-9]{2} date number i ensured columns tab-separated. tried several versions of regex \d\d-\d\d-\d\d , [0-9][0-9]-[0-9][0-9]-[0-9][0-9], none of them worked. pointers on can wrong? using stanford corenlp 3.7. here java code running. properties props = new properties(); props.put("annotators", "tokenize, ssplit, pos, lemma, ner, regexner"); stanfordcorenlp pipeline = new stanfordcorenlp(props); pipeline.addannotator( new regexnerannotator("/home/jyoti/workspace-jee/qa_rest/src/main/resources/gazetter.txt")); i further investigated , found regex not matching string if consists wholly

html - How to configure npm pug-php-filter with gulp? -

i cannot figure out how configure pug-php-filter( https://www.npmjs.com/package/pug-php-filter ) gulp can use php in pug file. plz me this. var rename = require('gulp-rename'); var pug = require('gulp-pug'), pugphpfilter = require('pug-php-filter'); gulp.task('pug', function() { return gulp.src('./_pugfiles/**/*.pug') .pipe( pug({ pretty: "\t", filters: { php: pugphpfilter } }) ) .pipe(rename(function (path) { path.extname = ".php" })) .pipe(gulp.dest('./site')); });

angularjs - How to use same html but different model values in angular js? -

i have scenario in html of 2 partials same model different. instance see below code <ul class="feeds"> <li ng-if="scleanerdata.contact_no"> <div><i class="fa fa-phone color-grey" aria-hidden="true"></i></div>{{scleanerdata.contact_no}}</li> <li ng-if="scleanerdata.email"> <div><i class="fa fa-envelope color-grey" aria-hidden="true"></i></div>{{scleanerdata.email}}</li> <li ng-if="scleanerdata.address"> <div><i class="fa fa-globe color-grey" aria-hidden="true"></i></div>{{scleanerdata.address}}</li> </ul> i need same html in second partial time bindings <ul class="feeds"> <li ng-if="profile.house"> <div><i class="fa fa-phone color-grey" aria-hidden="true

linux - ACLs - the same acl's on all newly created files automatically -

i want set acl eg. /tmp/test folder this: /tmp/test owner user "gaspar", member of group "testgroup". user "testuser" member of group "testgroup", , want give rwx permissions user + owner (user "gaspar"). need set same acl newly created files/directories within /tmp/test automatically. when setfacl this: setfacl -rdm u:testuser:rwx,g:testgroup:-,o::- /tmp/test/ getfacl -p /tmp/test/ gives permissions: # file: /tmp/test/ # owner: gaspar # group: testgroup user::rwx group::--- other::--- default:user::rwx default:user:testuser:rwx default:group::--- default:group:testgroup:--- default:mask::rwx default:other::--- and user "testuser" has no permissions /tmp/test folder. can please suggest problem is, should correct? when set acl (without "d" option), user "testuser" has permissions should have, newly created files/directories don't have same acl: setfacl -rm u:testuser:rwx,g:testgroup

php - How to restrict user to enter unique email id by using ng-chnage directive + angularjs -

i want restrict user enter unique email id in form field , in case user enter email exist in database, display message email id exist. <div class="form-group"> <input name="email" class="form-control" ng-model="reg.email" required ng-change="getunique_id()" type="text"> <span class="errormessage" ng-show="myform.email.$dirty && myform.email.$error.unique">email in use</span> </div> i totally confuse how getunique_id .... there anyone,who can me this? any appreciated.thanks in advance

c - How to merge array elements with token merging ## operator??? -

i want merge 3, 7, 1 371. want know how merge it??? #include <stdio.h> int main(void) { int a[] ={3, 7, 1}; return(0); } you try this; #include <stdio.h> int main(void) { int a[] ={3, 7, 1}; int i, result = 0; for(i=0;i<sizeof(a)/sizeof(a[0]);i++) result += a[i] * pow(10, sizeof(a)/sizeof(a[0])-i-1); printf("result %d\n", result); return(0); }

android - How do I set up an icon (drawable) for a button in anko? -

Image
i want have icon in centre of plain button, using anko. tried button.backgroundresource = r.drawable.arrow_forward but got drawable covering whole button , getting background colour parent (setting background colour on button explicite nothing). i tried drawable = ... well, same effect. how set icon anko have original aspect ratio , centered? first off, in order set icon/iamge on button should use imagebutton. then it's easy. imagebutton{ imageresource = r.drawable.ic_cc_checkmark } if need use other resources or drawable, without getting resource not found error use ctx.getdrawable(r.x.y) hope helps someone

xcode - Firebase configuration fails - Swift -

in application i'm using firebase , in appdelegate setup: // ### initialize firebase firapp.configure() now unit tests on related target , when launch errors: 2017-04-14 14:53:22.351 myproject[28753] <error> [firebase/core][i-cor000004] app name __firapp_default not exist. 2017-04-14 14:53:22.354 myproject[28753] <error> [firebase/messaging][i-iid001000] firebase not set correctly. sender id nil or empty. 2017-04-14 14:53:22.356 myproject[28753] <notice> [firebase/analytics][i-acs023007] firebase analytics v.3800000 started 2017-04-14 14:53:22.356 myproject[28753] <notice> [firebase/analytics][i-acs023008] enable debug logging set following application argument: -firanalyticsdebugenabled 2017-04-14 14:53:22.381 myproject[28753:712475] *** terminating app due uncaught exception 'com.firebase.instanceid', reason: 'could not configure firebase instanceid. google sender id must not nil or empty.' versions: firebase/core (3.16.0) fi

javascript - Monaca app working in dashboard preview but not on Android 6 phone -

i'm trying modify basic todo-list example onsen-ui. i've added new button in menu. <ons-toolbar-button id="resptab" > <ons-icon icon="ion-pie-graph" size="28px"></ons-icon> table </ons-toolbar-button> and navigator wrapping list <ons-splitter id="splitter"> <ons-splitter-side id="splitter-menu" page="menu.html" side="left" width="220px" collapse swipeable> </ons-splitter-side> <ons-splitter-content> <ons-navigator id="mynavigator" animation="slide" page="list.html"/> </ons-splitter-content> </ons-splitter> i'm pushing new page script through event listener document.queryselector('#resptab').addeventlistener('click', this.setresptable.bind(this)); and function todo.setresptable = function() { ons.notification.prompt('s

botframework - How to change the size and other properties of the chat window -

i have created simple bot application using botframework. embedding chat window in iframe. how can control chat window size , other properties color, font etc. you can size iframe options of modifying what's in limited - css override body style content in iframe? . here's how typically integrate provided bot framework's iframe size control: <div id="bot"> <iframe src="https://webchat.botframework.com/embed/..." style="height: 600px; width: 500px; resize: both;"> </iframe> </div> if want have more control on how web chat renders, might want @ other more advanced options of integrating web chat. read more on github page: https://github.com/microsoft/botframework-webchat

conditional formatting - How to exempt specific cells from rules in Excel -

i trying use conditional formatting in excel alert users duplicate s/n's entered in column have rule ignore "n/a" or has spaces (i.e., note or message)... ignore isn't duplicate s/n. is possible using conditional formatting or have delve writing custom formula? any appreciated! if decide use custom formula, here one: =and(iferror(error.type(a1),0)<>7,1<countif(a:a,a1)) this exclude cells #n/a. if want exclude other errors, can apply iserror function.

r - How to fix error in legend()? -

i not place text in "topright" of plot using legend()instead text getting on "topleft".please me out. in advance. , here code library(ggplot2) library(reshape2) data_full <- read.table("household_power_consumption.txt",skip = 1,header = true, sep = ";") names(data_full) <- c("date","time","global_active_power","global_reactive_power","voltage","global_intensity","sub_metering_1","sub_metering_2","sub_metering_3") #subsetting required data data <- subset(data_full, data_full$date == "1/2/2007" | data_full$date == "2/2/2007") #transforming date , time variables objects of date , posixct resp datetime <- paste(as.date(data$date) ,data$time) data$datetime <- as.posixct(datetime) #using plot function plot(data$sub_metering_1,data$datetime,type = "n",ylab = "energy sub metering",xlab = "")

java - Map Depth to RGB Space -

Image
i'm using kinectpv2 library great poorly documented. with reference example "mapdepthtocolor" copied below i'm trying retrieve depth each rgb pixel. having managed tweak original example map depth rgb space i'm left strange duplicated edge (see bottom left image). can point out what's going on? /* thomas sanchez lengeling. <a href="http://codigogenerativo.com/" target="_blank" rel="nofollow">http://codigogenerativo.com/</a> kinectpv2, kinect windows v2 library processing color fepth example, color frame aligned depth frame */ import kinectpv2.*; kinectpv2 kinect; int [] depthzero; //buffer array clean de pixles pimage depthtocolorimg; void setup() { size(1024, 848, p3d); depthtocolorimg = createimage(512, 424, pimage.rgb); depthzero = new int[ kinectpv2.widthdepth * kinectpv2.heightdepth]; //set array 0s (int = 0; < kinectpv2.widthdepth; i++) { (int j = 0; j < kinectpv2.heigh

php - Getting JSON values from url -

this first time using stackoverflow, if doing wrong asking question, let me know! :) let's question. i developing public api, php , json. first time me using json php, kind of new it. the problem while getting values api (just wanted test out before let others use it) i have no problems encoding it, have ran through multiple validators , hurlit, , works fine. my guess there problem in retrieving code. this response api [{"recordid":"1","uuid":"5c298318-905e-3759-8762-150c7c77ef17","username":"fgh78","firstjoin":"2017-04-02","lastjoin":"2017-04-14","joincount":"81","lineswritten":"3545","currencyvalue":"0","rank":"default"}] and code use retrieving specific value. $url = 'http://localhost/api.zunarmc.se/api/v1/stats/api.php?apikey=828137163&player=fgh78'; $json = file_get_

visual studio - Google tests don't work with class in other project in solution -

i'm trying test simple class building (that has constructor). file testclass.h #pragma once class testclass { public: testclass(); }; file testclass.cpp #include "testclass.h" testclass::testclass() { } and add new project in solution: tests . project contains 1 file. file test.cpp #include <gtest/gtest.h> #include "../example/testclass.h" test(test0, all) { expect_eq(true, true); } /* test(test1, part1) { testclass t; }*/ int main(int argc, char* argv[]) { testing::initgoogletest(&argc, argv); return run_all_tests(); } if build code - (and tests). if uncomment commented block - have such output error: 1>------ rebuild started: project: example, configuration: debug win32 ------ 1> testclass.cpp 1> example.vcxproj -> d:\alex\documents\visual studio 2015\projects\tests\debug\example.lib 2>------ rebuild started: project: tests, configuration: debug win32 ------ 2> test.cpp

php - Get doctrine outside controller -

i tried doctrine outside controller goes wrong , don't understand why. so created service : services: doctrine.service: class: app\desktopbundle\lib\doctrineservice arguments: [ "@doctrine.orm.entity_manager" ] and doctrineservice file : namespace app\desktopbundle\lib; use doctrine\orm\entitymanager; class doctrineservice { protected $manager; public function __construct(entitymanager $manager) { $this->manager = $manager; } } and want doctrine in file : namespace app\desktopbundle\lib\game; use app\desktopbundle\entity\onelevelhistory; use app\desktopbundle\lib\doctrineservice; use symfony\component\yaml\yaml; use doctrine\orm\entitymanager; class onelevel{ } but don't know how call service created before. can me please? why didn't inject orm entity manager directly in onelevel class? //services.yml services: one_level.service: class: app\desktopbundle\lib\game\onelevel arg

can python read .ini file like php Yaconf -

this question has answer here: how read , write ini file python3? 5 answers php yaconf can read .ini file a=123 b=45 c.e.f=987 output like ['a' => 123] ['b' => 45] ['c' =>['e'=>['f'=>987]]] can python read this? thx hi, all, may did not describe question well, sorry that firstly, did tried configparser, parse config key=value . have config a.b.c=value , e.g: [cache] redis.master.host='10.10.10.10' redis.master.port='6379' redis.master.auth='xxxx' redis.slave_1.host='10.10.10.12' redis.slave_1.port='6389' redis.slave_1.auth='xxxx' so, read config like cfger.get('cache', 'redis') and hope result {'redis': { 'master': { 'host': '10.10.10.10', 'port': '6379&#

vba - MS Access: DB is crashing when trying to delete a spreadsheet -

i have button exports file, first checks see if file exists. if does, deletes file , writes new 1 in place. problem clicking button crashes database. ideas why? problem showed - working fine before on both acess 2013 , access 2016. environment business setting (company laptops, not personal ones) majority of managed i.t. admin. the code: private sub command370_click() dim myqueryname string dim myexportfilename string myqueryname = "qry_sap_fgcheck" myexportfilename = "j:\2017\sap\sapexports\dailyfgcheck_export.xlsx" if len(myexportfilename) > 0 on error goto err_msg kill myexportfilename end if docmd.transferspreadsheet acexport, acspreadsheettypeexcel12xml, myqueryname, myexportfilename application.followhyperlink myexportfilename err_msg: if (err.number = 70) msgbox "error: (" & err.number & ")" & err.description & ". must close spreadsheet in order export."

actionscript 3 - How can i hitTesObject a movieclip inside a movieclip AS3? -

i want zombie collect brains(g1b1,g1b2,g1b3,g1b4). these brains inside movieclip 'platform1' because need have scrolling background effect. zombie character can walk can't collect brains. import flash.display.movieclip; import flash.events.keyboardevent; import flash.events.event; import flash.ui.keyboard; import flash.display.sprite; public class z extends movieclip { private var score:int=0; private var zombiespeed:int=7; //speed zombie private var gravity:int=1; private var jumpspeed:int=0;//current speed jump private var jumpspeedlimit:int=15; //how quick jump private var jump, left, right, down, mainjump:boolean=false; //zombie not jumping public function z() { } public function game1() { stop(); stage.addeventlistener(keyboardevent.key_down, keypressed); stage.addeventlistener(keyboardevent.key_up, keyreleased); zombie.addeventlistener(event.enter_frame, movecharacter1); gameplay1(

javascript - github three.js editor: make a java file from html file in node -

when want make java file html file in node got errors main html file : https://github.com/mrdoob/three.js/blob/dev/editor/index.html with line numbers: 1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <title>three.js / editor</title> 5 <meta charset="utf-8"> 6 <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> 7 </head> 8 <body ontouchstart=""> 9 <link href="css/main.css" rel="stylesheet" /> 10 <link id="theme" href="css/light.css" rel="stylesheet" /> 11 12 <script src="../build/three.js"></script> 13 <script src="../examples/js/libs/system.min.js"></script> 14 15 <script src="../examples/js/controls/editorcontrols.js"></script>

Ruby rescue TypeError is not catching TypeError exception -

i'm using gem called bindata has following code block: def assign(val) raise argumenterror, "can't set nil value #{debug_name}" if val.nil? unless has_parameter?(:value) raw_val = val.respond_to?(:snapshot) ? val.snapshot : val @value = begin raw_val.dup rescue typeerror # can't dup fixnums raw_val end end end this code meant dup object sent assign function, fixnum cannot dup'd creators put rescue block in there. have tested code multiple times in rails console , rescue works fine. however: i, [2017-04-08t00:03:47.165387 #27899] info -- : *** below find recent exception thrown, (but not certainly) exception made application exit abnormally *** e, [2017-04-08t00:03:47.165450 #27899] error -- : can't dup fixnum (typeerror) /home/blueserver/.rvm/gems/ruby-1.9.3-p327-turbo@symphony/gems/bindata-1.4.3/lib/bindata/base_primitive.rb:90:in `dup' /home/blueserver/

python - pyspark Error Caused by: java.lang.IllegalStateException: Input row doesn't have expected number of values required by the schema -

i have below pyspark code join 2 data frames. looks simple output not coming erro. unable proceed further, can please identify fundamental issue here? input c.csv 100,2015-09-03,sg,7 200,2016-01-30,at,9 300,2016-01-25,au,8 400,2016-01-22,au,7 u.csv 248,248,country,sg,singapore 66,66,country,at,austria 65,65,country,au,australia output 100,singapore 200,austria 300,australia 400,australia source pyspark code :test.py from pyspark import sparkconf, sparkcontext pyspark.sql.types import stringtype pyspark import sqlcontext conf = sparkconf().setappname("hybrid - read csv hive ") sc = sparkcontext(conf=conf) sqlcontext = sqlcontext(sc) c_rdd = sc.textfile("./hybrid/c.csv").map(lambda line: line.split(",")) r_rdd = sc.textfile("./hybrid/u.csv").map(lambda line: line.encode("ascii", "ignore").split(",")) c_df = c_rdd.todf(['c_no','op_dt','try_cd','lb']) r_df = r_rd

MongoDB Java - Fetching id in nested json -

i have following json structure. trying retreive run following mongo query in java hdata._id not null. mongodb query: db.collection.find({},{"hdata._id":1, "hdata.createdby":1} ) { "_id" : objectid("55567e594e3256a23565ce58"), "hdata" : { "isdeleted" : false, "candelete" : false, "canupdate" : false, "createdby" : “xyz”, "createddate" : "2015-05-15t15:05:30", "_id" : "7" }, "changedate" : "2015-02-19t16:02:12", } the code have written in java fetch hdata._id is mongocursor<document> cur = col.find(new basicdbobject("hdata._id", new basicdbobject("$ne",null)))).iterator(); try{ while(cur.hasnext()){ system.out.println(cur.next().getobjectid("hdata._id")); i++; }

Where is stored captured variable in Java? -

i'm trying understand concept of captured variable in java. i found quite detailed article it: http://www.devcodenote.com/2015/04/variable-capture-in-java.html and i'm not sure bytecode part: similarly, accessing local variables of enclosing method, hidden copy of variable made , kept in inner class file accesses variable. how can saved class file (during compilation), when final primitive values may not known in compile time? for example: void foo(int x){ final int y = 10 + x; class localclass(){ localclass(){ system.out.println(y); // works fine } } } if author wrong, local variables copied localclass's space in method area in runtime? the author seems referring fact captured variables translated fields of local/anonymous class. if disasemble localclass can see (where main name of enclosing class): class main$1localclass { final int val$y; final main this$0; main$1localclass(); cod

android - Error:(2367, 40) No resource found that matches the given name (at 'colorButtonNormal' with value '@color/blue_grey_500') -

i´m using android studio , when generate signed apk show me error: error:execution failed task ':app:processreleaseresources'. com.android.ide.common.process.processexception: failed execute aapt error:(2367, 40) no resource found matches given name (at 'colorbuttonnormal' value '@color/blue_grey_500'). error:(2367, 40) no resource found matches given name (at 'colorbuttonnormal' value '@color/blue_grey_500'). and error in here (in file res/values/styles.xml): <style name="themeoverlay.mydarkbutton" parent="themeoverlay.appcompat.dark"> <item name="colorbuttonnormal">@color/blue_grey_500</item> <item name="android:textcolor">@android:color/white</item> </style> how fix this? just add color manually in colors.xml <color name="blue_grey_500">#9e9e9e</color>

c - Program keeps running even after the error appeared -

i have program retrieves numbers file array. last problem have program keeps running though cannot open file, instead of ending it. when says program over, menu main appears again doesn't show data int main (void) { int choice, max, min; float avg; int test[max_number_of_students]; int file_opened; int number_of_students; file_opened = get_test_scores(test, &number_of_students); if (file_opened == 0) { { choice = menu(); switch (choice) { case 0: printf("\nprogram over.\n"); break; case 1: test_avg(&avg, test, number_of_students); printf("\naverage score on test = %5.2f\n", avg); break; case 2: test_max_min(number_of_students, &max, &min, test); printf("\nmaximum score = %3d\n" "minimum score = %3d\n", max, min); break; case 3: print_test(test,number_of_students); break; default:

javascript - kendo grid grouping does not display groups in alphabetical order -

i having issue trying grid display grouped on particular column show groups listed in alphabetical order. have 200+ records whereby 1 particular column has 5 different unique data elements. want group grid display on field. when drag column header group of grid, grid displays data grouped field, not in alphabetical order. expect results be: group a: (multiple rows...) group b: (multiple rows...) group c: (multiple rows...) group d: (multiple rows...) group e: (multiple rows...) instead, random listing of groups without headings being sorted @ all group c: (multiple rows...) group a: (multiple rows...) group d: (multiple rows...) group e: (multiple rows...) group b: (multiple rows...) i have not found in progress/telerik online documentation can tell grouping list groups group headers in alphabetical order. any explanation of link example code being done appreciated? thank you...

How to deduct 100 to zero using nested for loop c++ -

basically program deduct 100 2 person until reach zero. i'm using nested loop. 1 loop each person person need enter integer. integer deducted 100. but main problem can't repeat 1st loop without losing current value of 100. i'm beginner. for( int x = 1; x<=100;) { cout <<"\n\n"<< np1 <<" how many of remaining " << chips<<" chip(s) like?"<<endl; cin >> p1c; result = chips-p1c; cout <<result; for( int y = 1; y <=100;) { cout <<"\n\n"<< np2 <<" how many of remaining " << result<<" chip(s) like?"<<endl; cin >> p2c; result = result-p2c; cout <<result; break; } screenshot for-loops aren't suited – "repeat until zero", you're describing problem, different "repeat 1 hundred times", tried solve it. if playing in real life, this: while

GLOBAL Array gets deleted... - WP All Import function.php - -

Image
at moment i'm writing on additional code functions editor wp import plugin. additional code supposed move datas... nothing special... anyway. problem is, $globals["productsxml"] array gets flushed every time wp import loading new function. here code: add_action('pmxi_before_xml_import', 'wp_all_import_before_xml_import', 10, 1); add_action('pmxi_saved_post', 'my_saved_post', 10, 2); $globals["productsxml"] = array(); function wp_all_import_before_xml_import($import_id){ ... } function my_saved_post($pid, $xml_node){ ... } as can see, add functions , i'm initializing $globals["productsxml"] array. plugin works this: call wp_all_import_before_xml_import function @ beginn of entire import. (here load values in $globals["productsxml"] array) call my_saved_post function every time post gets saved (here want access on $globals["productsxml"] array -> empty...) does knows,

javascript - Snap.svg: How to pause/resume animation? -

i have example below runs circle around edge of svg root drawing. can stop , restart no problem. however, rather restart(resume) @ last position, rather resetting start position. is possible snap? <!doctype html> <html> <head> <title>snap pause/resume animation</title> <script type="text/javascript" src="http://svgdiscovery.com/_snp/snap.svg-min.js"></script> </head> <body onload=runanim()> how pause/resume animation? <div id="svgdiv" style='background-color:lightgreen;width:400px;height:400px;'> <svg id="mysvg" width="400" height="400"> </svg> </div> <button id=pauseresumebutton onclick=pauseresumebuttonclicked() >pause</button> <script> var snpsvg = snap("#mysvg"); var stretchline=snpsvg.line(200,200,20,20).attr({id:'stretchline',stroke:'black',strokewidth:4}) /

opengl - CMake sucessful, resulting makefile error -

this follow-up question 1 asked previously, if pleases may found here . summarize, have been trying understand build process linking necessary libraries opengl. aware there boilerplates , other methods make process easier; interested in being able autonomously. my issue although cmake sucessfully processes cmakelists.txt file, resulting makefile throws error. if helpful, file structure contextualized here: + infuriating_project + bin // post compile results + src // humble code + deps // external code +glew + include + src +glfw + include + src +glm +soil + lib + src here contents of cmakelists.txt file: cmake_minimum_required (version 3.0) # version information --------------------------------------------------------- project (opengl-practice) set (version_major 1) set (version_minor 0) set (version_feature 0) set (version_patch 0) set (version "${versi

c# - Click Once Installer - Publishes to site but not sure how to access file -

i have learned click once in visual studio , wanted create application website people can download. the application built , have published ftp/website. however, have looked @ other sources on here, youtube , google , have not been able find how can file install when goes webpage. or, how reference file in link on webpage when click file start install process? thanks ahead of time , help. -colt you can installation folder url going project properties in visual studio, going publish tab , taking whatever url in installation folder url. for example if installation url https://mywebsite/myapp/ want go https://mywebsite/myapp/setup.exe .

php - What does setting Content-Encoding to true do? -

i've come across line in php code i've inherited: header('content-encoding: ', true); looking @ mdn docs content-encoding 'true' not valid value. expecting gzip or deflate, not true. i looked , can't see special behaviour in php if set true. however in code looking @ line has following effect: makes file being output zipped. adds empty content-encoding header http response headers. latter understand - former not. there interaction here use of php's ob_gzhandler() has been called , have have correctly set content-encoding header correctly gzip. if comment out line file not zipped. what appears happening this: ob_gzhandler() sets content-encoding header gzip. subsequent line: header('content-encoding: ', true) - called after ob_end_clean() somehow enables prior setting - without prior setting ob_gzhandler not 'activated'. make sense? basically - why want do: header('content-encoding: ', true);?

c# - MobileServiceTable.InsertAsync ZUMO-API-VERSION Error -

i'm trying migration azure mobile service azure app services. in c# i'm using mobileserviceclient.gettable mobileservicetable object. try insert object using mobileservicetable.insertasync . after upgrading getting error- an invalid api version specified in request, request needs specify zumo-api-version of 2.0.0 i understand error, don't know how update request headers add this. possible? you need update sdk. remove windowsazure.mobileservices sdk , add microsoft.azure.mobile.client sdk. if use offline-sync, replace equivalent sqlitestore packages well. for more information, see https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-net-upgrading-from-mobile-services

arduino - why the output not follow the setcursor? -

why output of function not follow lcd.setcursor position? when type in, output pops out @ different position instead of determined setcursor. need use function multiple times different variables hold different number different purpose. however, need display of numbers on lcd according set position. here code: #include <keypad.h> #include <liquidcrystal_i2c.h> liquidcrystal_i2c lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, positive); // set lcd i2c address const byte rows = 4; //four rows const byte cols = 3; //three columns char keys[rows][cols] = { {'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}, {'*', '0', '#'} }; byte rowpins[rows] = {9,8,7,6}; //connect row pinouts of keypad byte colpins[cols] = {5,4,3}; //connect column pinouts of keypad keypad keypad = keypad( makekeymap(keys), rowpins, colpins, rows, cols ); void setup() { serial.begin(9600); lcd.begin(20

java - Unable to get column names as headers into JTable -

i have code should create jtable column hearders based on field names returned query. reason code not working, new java , have been doing research cant seem find issue is. appreciated. public void inittable(){ try { defaulttablemodel tblmodel = new defaulttablemodel() { @override public boolean iscelleditable(int row, int column) { return false; } }; tblmain.setmodel(tblmodel); tblmain.setselectionmode(listselectionmodel.single_selection); //tblmain.gettableheader().setreorderingallowed(false); connection dbconn = dbconn(); statement stmt = dbconn.createstatement(); string qry = "select * services"; resultset rs = stmt.executequery(qry); int numcols = rs.getmetadata().getcolumncount(); system.out.println("num cols: " + numcols); (int col = 1; col <= numcols; col++){

jquery - Web API OWIN receives null data from $.AJAX POST withCredentials:true -

i'm calling web api hosted on windows service via owin, jquery ajax post asp.net mvc application (posting data via 'data' option). working until decided add integrated windows authentication. added xhrfields: { withcredentials: true } $.ajax call complete client side of authentication. data returned null. here server side startup: public class startup { public void configuration(iappbuilder appbuilder) { var config = new httpconfiguration(); var listener = (httplistener)appbuilder.properties["system.net.httplistener"]; listener.authenticationschemes = authenticationschemes.integratedwindowsauthentication; //maps http routes based on attributes config.maphttpattributeroutes(); config.filters.add(new authorizeattribute()); //enable webapi var cors = new enablecorsattribute("*", "*", "*"); cors.supportscredentials = true; conf

ionic2 - Ionic 2 change name of main.js ( webpack.js output.filename setting) -

we have ionic 2 app deployed natively , web. when building use npm run build --prod --release . wraps ionic build. i'm trying update our build process able swap out default main.js. in index.html so want able change file from: <script src="build/main.js"></script> with (autogenerated hash) <script src="build/main.7b297e8f7d1c2760a1bc.js"></script> step 1 generate file. able generate right file each build using webpack output.filename setting. module.exports = { entry: [process.env.ionic_app_entry_point, './web.config', './src/ai.min.js'], output: { path: '{{build}}', filename: '[name].[chunkhash].js', when build can see it's correctly generating source file shortly after completing ionic build fails message saying can't find build/main.js. original file name think need somehow let ionic know i'm changing name of main.js file. error: [11:00:32]

c# - Slack Event Subscription -

i'm trying create bespoke functionality software team , thought of great solution using slack event subscriptions. problem is, having problems getting event information after...so far have managed configure slack call wcf service, however, 'event' parameter includes information after null. here have far: [servicecontract] public interface islacktrelloservice { [operationcontract] [webinvoke(method = "post", uritemplate = "slackpost", requestformat = webmessageformat.json, bodystyle = webmessagebodystyle.wrapped, responseformat = webmessageformat.json)] string slackpost(string type, string token, string challenge, string team_id, slackevent slackevent); } the concrete implementation: public class slacktrelloservice : islacktrelloservice { public string slackpost(string type, string token, string challenge, string team_id, slackevent slackevent) { return challenge; } } the slackevent class: [jsonobject(id =

c# - HockeyApp doesn't show exception detail from a shared project -

i new hockeyapp have implemented windows uwp app project. far, see. using crash reporting during testing , can stack trace crash via hockeyapp investigate , fix. therefore, having full detail such class name, method name , line number in stack trace reported key. i did make sure follow step step guides setup includes making sure of pdb symbols uploaded hockeyapp portal. my solution has shared project share code. noticed if exception happens in class located in shared project, not stack trace info. lot of lines "shared library" in general no class name, method name or line number. however, if exception happens inside of actual project, works fine , of detail need. for example, stack trace when exception in shared project: exception stack: unknown location system.runtime.exceptionservices.exceptiondispatchinfo.throw() sharedlibrary!+0x36fd1b sharedlibrary!+0x36fbe9 sharedlibrary!+0x36fbb9 pactracmobile.windows10!+0xdc555d system.runtime.exceptionservi

java - this code is giving me this error : Error: Could not find or load main class undefined -

i working on project on android studio , editing app , code giving me error. signin app public void signin() { showpdialog(); customrequest jsonreq = new customrequest(request.method.post, method_account_login, null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { if (app.getinstance().authorize(response)) { if (app.getinstance().getstate() == account_state_enabled) { intent = new intent(getapplicationcontext(), mainactivity.class); startactivity(i); activitycompat.finishaffinity(loginactivity.this); } else { app.getinstance().logout(); toast.maketext(loginactivity.this, gettext(r.string.msg_account_blocked), toast.length_short).show(); }

sammy.js - Pass the request to server sammyjs -

new sammyjs. broadly have 2 modules, 1 server side rendered , de-coupled client app. have implemented ko , sammy , working good. requests, need pass on server. possible sammy? sammy(function () { this.get( ".*", function () { var view = window.location.pathname; if( view == "/" ) appviewmodel.currentview( "home-page" ); else if( view == "/product" ) appviewmodel.currentview( "product-page" ); else if( view == "/admin" ) return false; // ssr page }); }).run(); the answer turned out simple, don't capture request in first place. this.get( "^(?!\/admin$).*$", function() { // });

python - zip freezing PySide QFileDialog on Linux -

this code behaves different on linux(centos 7) , windows(win 10). variable src passed trough qfiledialog.getexistingdirectory() . on windows machine after clicking ok folder qfiledialog window closes on linux machine remains frozen until zip operation done. def zipfolders(src, dst, id=none): #pers = 100/len(os.listdir(src)) #num = 0 if id == 'zipproject': zipfile(dst, 'w', allowzip64 = true) zf: root, dirs, files in os.walk(src): f in files, dirs: s in f: if not s == []: fullpath = os.path.join(root, s) filename = fullpath.rpartition(os.path.basename(src))[2] if filename == '': filename = '.'+fullpath.rpartition(os.path.basename(src))[1] zf.write(fullpath, filename) #num += pers #se

vb.net - Visual Basic Error Message -

i'm new visual basic realize question remedial... when try run program using following code following error message: an unhandled exception of type 'system.invalidcastexception' occurred in microsoft.visualbasic.dll additional information: conversion string "" type 'double' not valid. i realize similar questions have been asked want display code folowing: private sub txtgrade1_textchanged(sender object, e eventargs) handles txtgrade1.textchanged dim numgrade decimal numgrade = cdec(txtgrade1.text * 0.15) + cdec(txtgrade2.text * 0.25) + cdec(txtgrade3.text * 0.2) + cdec(txtgrade4.text * 0.4) msgbox("your grade is" + numgrade) end sub i have no idea going on here. program allow me put in 1 digit in text box when runs error message well, solve type mismatches. may not want show message box every time txtgrade1.text changes... private sub txtgrade_textchanged(sender object, e eventargs) handles txtgra

php - Laravel Uncaught exception 'ReflectionException -

im getting error when trying launch laravel app . fatal error: uncaught exception 'reflectionexception' message 'class log not exist' in c:\xampp\htdocs\vendor\laravel\framework\src\illuminate\container\container.php:735 i have checked .env file spaces , found none. replaced each file in config folder in attempt find out 1 throw error. tried doing dump mentioned line dump($concrete, debug_backtrace()); i have tried running composer dump-autoload , composer dump-autoload -o promted me put composer.json file config directory when ran again threw error stating "could not scan classes inside database not appear file nor folder". how can isolate , sort issue out ?