Posts

Showing posts from February, 2013

refresh - MS Access 2013 (Update records to multiple users) -

i've trolled these forums years, came across needed ask for. i have developed desktop application using ms access 2013. split database in each user has copy of front-end on desktop (there no sharing of front-end). a supervisor must approve record(and sub-records) while person created record waits approval (both supervisor , operator in different, physical locations). currently, once supervisor approves record, operator must click refresh button in order refresh screen , reveals record has been approved. is there way force update/refresh on operator's screen when supervisor approves record without following: 1. operator clicking button 2. using form time interval thanks in advance input.

c# - performance counter: value is zero -

i've decided play performance counters. i'm creating them powershell: $categoryname = "testlocal"; $categoryhelp = "testlocal"; $categorytype = [system.diagnostics.performancecountercategorytype]::multiinstance; $categoryexists = [system.diagnostics.performancecountercategory]::exists($categoryname); if (-not $categoryexists) { $objccdc = new-object system.diagnostics.countercreationdatacollection; $objccd3a = new-object system.diagnostics.countercreationdata; $objccd3a.countername = "average time per request in db"; $objccd3a.counterhelp = "average time per request in db"; $objccd3a.countertype = "averagetimer32"; $objccdc.add($objccd3a) | out-null; $objccd3b = new-object system.diagnostics.countercreationdata; $objccd3b.countername = "average time per request in db base"; $objccd3b.counterhelp = "average time per request in db base"; $objccd3b.countertype =

Raspberry Pi MJPEG video stream - start application at reboot -

i making mjpeg video stream using raspberry pi dedicated pi camera. using jpeg libraries , following web application found on github . use pretty straightforward, type cd mjpg-streamer/mjpg-streamer-experimental , ./mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so" . however, make run on every reboot, camera "maintenance free". i researched need put path , executable file in /etc/rc.local . nevertheless, when put path ( mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so" ) executable file, did not work @ all. tried run stream 1 command in terminal, did not work either. tried set variable path in .bashrc in order access /etc/rc.local , did not want work. i suspect might have command ./mjpg_streamer needing input work ( -o "output_http.so -w ./www" -i "input_raspicam.so" ) do have idea how start every reboot? thanks time , help

Set a property declared in one qbs project from another -

i have typical application dev scenario, library + application, both qbs projects. in library project declared boolean property staticbuild default true follow: project { // library property bool staticbuild: true product { type: staticbuild ? "staticlibrary" : "dynamiclibrary" name: "lib" } } in application project use depends item add lib dependency follow: project { // application product { type: "application" depends { name: "lib" } lib.staticbuild: false // want link dll. } } but property referencing not work, error telling me property not declared. how fix ?. first of all, library not have property; parent project does. if did, not visible, less settable, outside. keep in mind library exists once, while there many dependencies on it. if want make decision how library built, need @ higher level, both products take information. common parent projec

c++ - char* concatenation not working properly -

i ran issue wasn't able find solutin till now. have function should act string.concat in c#: char* va(char* text, ...) { char buffer[1000]; va_list parameters; va_start(parameters, text); vsprintf(buffer, text, parameters); return buffer; } but reason if this: for (int = 0; < 12; i++) addoption(va("option %i", i)); the menu fields display "option 11", seems text overwriting. tried disableing "string pooling" in project settings, didn't change anything! appreciated! you should use char *buffer = new char[1000] for return of function char* va() need heap variable

java - Passing and casting a Comparator as argument of method using Lambdas -

how can create method accept comparator wildcard argument, , capture class , use comparator ? public list<string> myfilter(comparator<?> comp, object value, class c){ return mylist.stream() .filter(s-> comp.compare(c.cast(s), c.cast(value))>=0 ).collect(tolist()); } edit: ok, in fact, andrew's answer interesting , works quite :) yet,given comments, should want is: instead of trying cast within method, expect cast had been done within comparator so give: public list<string> filter(comparator<string> comp){ return mylist.filter(s->comp.compare(s, null)>=0).collect(tolist()); } and when calling it, should like list<string> mynewlist= filter((string s1, string s2)->{ try{ int i=integer.parseint(s1); return integer.compare(i, myrealcomparevalue); }catch(exception e){ e.prin

jquery - Compare 2 arrays and remove duplicates -

i trying compare 2 arrays using jquery , remove duplicates that. this code.is logic correct? var list1 = [6, 7, 3, 4, 1, 2]; var list2 = [2, 4, 6, 5, 1, 9, 8, 7, 8]; var newarray = []; var index1, index2; $.each(list1, function(i, value)) { index1 = $.inarray(list1[i]); index2 = $.inarray(newarray[i]); if (index2 == -1) { newarray.push(list2[i]); } } expected output: [3,5,9,8] try this <script type="text/javascript"> var arr1=[6,7,3,4,1,2]; var arr2=[2,4,6,5,1,9,8,7,8]; $(document).ready(function(){ var newarray=$.merge($(arr1).not(arr2).get(),$(arr2).not(arr1).get()); console.log(newarray); }); </script> it give out put as [ 3, 5, 9, 8,8 ] another answer with using $.each,$.inarray , .push try var list1 = [6, 7, 3, 4, 1, 2]; var list2 = [2, 4, 6, 5, 1, 9, 8, 7, 8]; var newarray = []; $.each(list1, function(i, value){ if($.inarray(value,list2)==-1){ newarray.push(value); }

java - Button not doing anything -

no error message in android studio. 'pick image button' not respond when clicking on it. i have looked @ similar questions none specific issue, , did not help xml file: <de.hdodenhof.circleimageview.circleimageview android:layout_width="85dp" android:layout_height="85dp" android:src="@drawable/noprofileimg" android:id="@+id/profilepic" android:layout_marginbottom="37dp" android:layout_alignbottom="@+id/imageview" android:layout_centerhorizontal="true" /> <button android:id="@+id/pick_image_button" android:layout_width="80dp" android:layout_height="23dp" android:text="pick image" android:textsize="12dp" android:padding="0dp" android:background="@color/gray" android:layout_marginbottom="13dp" android:layout_above="@+i

c# - IoC registration across multiple projects/solutions - when does it happen? -

i'm little confused regarding ioc registration. assuming have visual studio project called 'project 1'. within project dependent , it's dependency. register dependency implementation within installer in project 1. now project 2 wants use dependent described in project 1. right in saying project 2 must same registration dependency inject dependent? i.e. isn't registration in project 1 pointless? the reason ask because under impression registration all done calling code, 'final consumer' of these implementations. i've seen installer files within 'project 1' equivalent in solution i'm looking at.

assembly - What does this code imply: ss:dword_410CC5[ebp]? -

Image
using ida pro analysing file, have run across code don't quite understand: mov eax, ss:dword_410cc5[ebp] ; call eax; indirect call near proc going address - 410cc5 - see this: ile.........clos ehandle......... i assumed in first code snippet in eax name of library function stored, called call eax; indirect call near proc but problem address 410cc5 not correspond name (see attachment). @ address zeroes. does anyway means @ call eax; indirect call near proc we call closehandle? if so, why isn't right address passed eax? when call instruction appears in disassembly, means routine/function called @ point. if routine has absolute address, instruction appear call 0xaabbccdd . if address of function being called dynamic address (this kind of addresses resolved when os loads executable), it's called via enregistered value. however, instruction used calling routine—that's all.

javascript - How to write unit test for loading handlebars template file in Jest? -

in reactjs project, using handlebars generate source code template. these templates saved in files. in order load these files javascript, configured below configuration in webpack : { test: /\.handlebars|hbs$/, loader: 'handlebars-loader?helperdirs[]=' + path.join(__dirname, '../src/helpers/handlebars') }, it works fine when launch production. doesn't work in unit tests. using jest unit test framework. have seen people suggest use handlebars.registerhelper . know works template string . how solve issue when load template files? i created preprocessor put handlebars template module when imported in javascript via es6 import, can used. // preprocessor.js module.exports = { process(src) { return ` const handlebars = require('handlebars'); module.exports = \`${src}\`; `; }, }; then in package.json... // package.json "jest": { "collectcoverage": true,

arrays - Storing values obtained from for each loop Scala -

scala beginner trying store values obtains in scala foreach loop failing miserably. basic foreach loop looks currently: order.orderlist.foreach((x: orderref) => { val references = x.ref})) when run foreach loop execute twice , return reference each time. i'm trying capture reference value returns on each run (so 2 references in either list or array form can access these values later) i'm confused how go doing this... i attempted retrieve , store values array when ran, array list doesn't seem hold values. this attempt: val newarray = array(order.orderlist.foreach((x: orderref) => { val references = x.ref })) println(newarray) any advice appreciated. if there better way achieve this, please share. thanks use map instead of foreach order.orderlist.map((x: orderref) => {x.ref})) also val references = x.ref doesn't return anything. create new local variable , assign value it.

printing - Android BlueTooth Printer Connectivity -

i've created app i'm printing text data app bluetooth printer. app working fine 1 thing there i've given harcoded name of bluetooth printer print data. i want make app send text data android compatible bluetooth printer. or small hint helpful. is there property of bluetoothdevice can helpful in finding out whether connected device bluetooth printer or not? in advance! if use bluetoothdevice class, can call getbluetoothclass() function. returns bluetoothclass object, , on can use getmajordeviceclass() major device class , getdeviceclass() minor device class. believe printers should have 1536 major class , 1664 minor device class. might want oduble check device classnumbers, though.

java - SpringBoot Configuration with application.yml -

i have little springboot application, can execute different functions via openldap. getuser createuser deleteuser etc. that works fine. want create application.yml, can manage different environments different credentials. read tutorials, still have understanding problems. code looks that: usercontroller: ... protected static string serverurl = "xxxxx:90xx"; protected static string ldapbinddn = "cn=admin, xxxxx"; protected static string ldappassword = "xxxx"; ... @requestmapping(value = "/{userid:.+}",method = requestmethod.get,consumes="application/json",produces = "application/json") public userdata getuser(@pathvariable string userid) { dircontext context = connecttoldap(); //some operations... context.close(); return user; } ... // same other functions my plan now, want specify credentials in application.yml instead of @ beginning of usercontroller (see above). then have c

bash - Loop through files within a path (with spaces) -

i wanted pass path name script, path has spaces (eg. /users/netto/itunes \media/music/). have tried putting actual path directly on loop, , able files. unfortunately, not pass variable. have tried both double quote, , single quote. have currently $path=$1 f in $path; echo "processing file $f " done please let me know on how this. thank in advance. spaces in variables expanded @ command level, solve problem can either put quotation marks around "$1" (so spaces escaped) or use bash arrays. here 2 example should work: #!/bin/bash dir="$1" f in "$dir"/* echo "processing file $f " done or using bash arrays: #!/bin/bash files=("$1"*) f in "${files[@]}" echo "processing file $f " done

android - Notification without using firebase console -

i'm newbie in android, have created program send notification using firebase without using firebase console.i have used php backend happeing i'm getting notification when send through firebase console, when send through wamp server can't.though i'm getting success:1 you can send notification using following php code server function sendnotification($fields = array()) { $api_access_key = 'your key'; $headers = array ( 'authorization: key=' . $api_access_key, 'content-type: application/json' ); $ch = curl_init(); curl_setopt( $ch,curlopt_url, 'https://fcm.googleapis.com/fcm/send' ); curl_setopt( $ch,curlopt_post, true ); curl_setopt( $ch,curlopt_httpheader, $headers ); curl_setopt( $ch,curlopt_returntransfer, true ); curl_setopt( $ch,curlopt_ssl_verifypeer, false ); curl_setopt( $ch,curlopt_postfields, json_encode( $fields ) ); $result = curl_exec($ch ); curl_close( $ch ); return $result; } $title = 'whatever'

scala - How to convert a Spark Dataframe to JSONObject -

my goal convert dataframe valid jsonarray of jsonobject. i'm using: val res = df.tojson.collect() but i'm getting array[string] - array of json-escaped strings, i.e: ["{\"url\":\"http://www.w3schools.com/html/html_form_action.asp?user=123\",\"subnet\":\"32.2.208.1\",\"country\":\"\",\"status_code\":\"200\"}"] i'm looking way convert strings actual jsonobjects, found few solution suggested find , replace characters , i'm looking cleaner. i tried convert each string jsonobject using org.json library, it's not serializable object. any suggestion? fast scala json library can work? or how in general suggested work tojson method. update this bit wasteful, option works me: val res = df.tojson.map(new jsonobject(_).tostring).collect() since jsonobject not serializable - can use tostring valid json format. if still have suggestion on how can improve - plea

angular - Is it possible to build an admin website using Firebase Admin SDK with Angular2 -

i'm working on mobile application uses firebase backend , i'm going implement admin website using angular2 , host on firebase hosting want know possible use firebase admin sdk angular2. , if not, there solution ? the firebase admin sdk designed run server side , not client side. can use webfrontend in combination firebase admin sdk have develop custom interface between webfrontend , server side code (e.g. have create own rest services)

In R, with get() call a function from an unloaded package without using library -

i want call function unloaded package having function name stored in list. normally use library(shiny) pagelist <- list("type" = "p") # object function name (will loaded .txt file) get(pagelist$type[1])("display text") but since when writing package you're not allowed load library i'd have use like get(shiny::pagelist$type[1])("display text") which doesn't work. there way call function function name stored in list, without having load library? note should possible call many different functions (all same package), using e.g. if (pagelist$type[1] == "p"){ shiny::p("display text") } would require quite long list of if else statemens. use getexportedvalue : getexportedvalue("shiny",pagelist$type[1])("display text") #<p>display text</p>

c# - How to get the Entity name and type from DataGrid? -

this seems should straight forward, can't seem models entities type , name? i can class name/type, not properties inside class accessing while editing datagrid . this event in trying values: protected void ondatagrid_celleditending(object sender, datagridcelleditendingeventargs e) { if (e.editaction == datagrideditaction.commit) { var usercontrol = findvisualparent<userview>(sender uielement); var rowtype = e.row.item.gettype(); //this gets class type //trying name , type of entity here var name = e.row.item. ?????? var type = e.row.item.gettype(). ?????? } } and model , using code first entityframework public partial class bank { public system.guid id { get; set; } // id (primary key) public string section { get; set; } // section (length: 50) public string name { get; set; } // name (length: 50) public bank() { initializep

angular 2 dynamically validate multiple forms together and apart -

i'm building angular 2 page have dynamic amount of forms. (the user can add elements each have form). right i've got 1 big form loops on elements , adds fields accordingly. way can validate every field. add controls show user element still has invalid fields. think done best giving each element it's own form cna validate individually. problem i'm not sure how create dynamic references. maybe should looking validating specific fields instead? my current code looks little this: <form *ngif="ready" (ngsubmit)="formsubmit()" id="ngform" #form="ngform"> <ng-container *ngfor="let element of elements"> form fields ..... </ng-container> <button class="btn primary-button [disabled]="!form.form.valid">submit</button </form> so thought needed more this: <ng-container *ngfor="let element of elements"> <button [class.valid]="#{

Prediction interval in python for time series analysis -

i looking package/library in python compute prediction interval. found ressources confidence interval not prediction one. thanks help if looking time-series prediction suggest pyflux . you can learn here .

Angular 2 : bottom border on click -

i have 3 tabs , want bottom border when clicking on tab. when click on tab bottom border should given tab. i have tried below code. .features_selection_menu .menu_div { display: inline-block; margin-left: -3px; vertical-align: bottom; } .features_selection_menu .menu_div .menu_text_div { display: table-cell; vertical-align: bottom; height: 50px; border-bottom: 2px transparent solid; } .features_selection_menu .menu_div .menu_text_div span { position: relative; bottom: 8px; font-size: 18px; } .features_selection_menu .menu_div .menu_text_div_border_bottom { border-bottom: 2px #3a3f51 solid; } .features_selection_menu .menu_div .default_feature_text_color { color: #98a6ad; } .features_selection_menu .menu_div:first-child { margin-left: 0px !important; } .features_selection_menu .menu_div:nth-child(n) { margin-left: 40px; } <div class="features_selection_menu" [ngswitch]="currentfeature">

c - Is typecasting a char* to int* undefined? -

i have function print contents of character array: #include <stdio.h> void print_array(char * array, int n) { char* start; for(start = array; start - array < n && printf("%d\n", *start); start++); } int main() { char array[5] = {'a', 'b', 'c', 'd', 'e' }; print_array(array, 5); return 0; } this works nicely printing: 97 98 99 100 101 the trouble begins if change function this: void print_array(int * array, int n) { int* start; for(start = array; start - array < n && printf("%d\n", *start); start++); } and call function this: print_array((int*)array, 5); this prints junk. 1684234849 101 1973473280 8388443 80884992 i've turned on -wall when compiling , throws no warnings. why getting junk when typecast pointer? as others have pointed out, second implementation undefined . and others have stated, since cast address of array (char

node.js - AWS API Gateway Gzipped JSON file -

i have got setup api endpoint responds catalogue file around 18mb json file*, exceeds api gateways limit of 6mb. i can gzip compress file 256kb in api gateway cannot set content-encoding gzip. last november started allowing binarymimetypes examples have seen require data base64 encoded ( standard lambda example , serverless example ). require client not handle gzip base64. however ( aws-serverless-express example ) seems include app.use(compression(()) makes me think possible send json response gzipped. i have tried use aws-serverless-express example when try npm run setup fails create/update cloud formation stack. i have local working node/express endpoint working using following code var express = require('express'); var app = express(); var compression = require('compression'); var jsonfile = require('jsonfile'); const cors = require('cors'); var router = express.router(); app.use('/api', router); app.use(

git - How can display maps on Jupyter notebook when we put in Github -

i started put few python project github. project created jupyter notebook , have few maps when shared project on github ok cannot see maps , few specific graphs (the plotly graphs). do have solution it? i tried many times put ipynb. code shall change ipynb html? i need advise.

Robust fit in Python: weighted and generalized nonlinear least squares -

i have heteroscedastic data set has fitted logistic function. in respect have few quesions. is there nonlinear generalised least squares (ls) implmentation in python? what advantages of using generalised ls on iteratively reweighted ls? an additional question regarding scipy.optiize.least_squares . there keyword f_scale , commonly set 0.1. how defined in general? understand f_scale gives range of inliers, how determine optimal range?

SAP Adobe Form: UOM not appearing on the second page -

i have 2-page adobe form. in footer section (master page) of form, have uom totals. when executing form, uom appears in first page (footer section) not in second page. other data except uom displayed both in first , second page footer section. idea have missed? thanks! just found solution problem. tables not allow in master pages (header , footer) make data appear in header , footer (to first page , subsequent pages), variable (for example: uom) or data should transferred global data , use global data data binding. hope helps having same issue.

vue.js - Is there an issue retriving json data when using vue, axios, and laravel? -

i trying replicate tutorial on vuecasts ( https://laracasts.com/series/learn-vue-2-step-by-step/episodes/18 ). everything looks fine , don't errors except warning: resource interpreted document transferred mime type application/json: " http://vueme.app:8000/skills " i tried change content-type text/html suggested here: resource interpreted document transferred mime type application/json warning in chrome developer tools web.php: route::get('/', function () { return view('welcome'); }); route::get('skills', function(){ return ['javascript', 'php', 'python']; }); welcome.blade.php: <!doctype html> <html lang="{{ app()->getlocale() }}"> <head> <meta charset="utf-8"> <title>laravel</title> </head> <body> <div id="root"> <ul> <li v-for="

python - ValueError on jsonify -

i new flask , python, have convert mysql query json format. on converting, facing value error , unable understand, please me, thankyou in advance. valueerror: dictionary update sequence element #0 has length 8; 2 required on executing jsonify(r) @app.route('/post') def display(): cursor.execute("select * tablename") result=cursor.fetchall() r = [dict((cursor.description[i][0], value) i, value in enumerate(row)) row in result] return jsonify(r) there's better way create dictionaries mysql queries, , around error you're receiving. when define cursor, should have return query results list of dictionaries, so: cursor = connection.cursor(dictionary=true) that way each row of table returned query exist dictionary within list. this: [ {'firstcol': 'value1row1', 'secondcol': 'value2row1'... 'tenthcol': 'value10row1'}, {'firstcol': 'value1row2', 'secondcol':

Is there any way to create a tool with darg and drop mechanism to create a JSON file of intents in api.ai? -

i looking tool or way through can create drag , drop mechanism containing intents messages user inputs , respective response it. should able create json file of multiple intents can upload api.ai, , intents visible there. kindly me on issue. i dont know or not try postman not entirely situation mentioned removes lot of pain head https://www.getpostman.com/docs/postman/collections/creating_collections

linq - overload resolution failed because no accessible 'And' accepts this number of arguments When using Predicatebuilder in Vb.net -

Image
i'm trying build dynamic linq query predicate builder in vb.net. however, when try use predicate "and" clause filter query following error appears. none of similar questions here answered. here code: dim ds datatable = loaddata("select i.itm_code code,itm_barcode barcode,itm_description description,itm_price price,subgrp_name subgroup, itm_expiry, itm_active visible, itm_featured featured, itm_photo photo, itm_brand brand, itm_title title, itm_size size, itm_measurement unit items i, groups g, subgroups s, item_barcode b i.itm_code = b.itm_code , i.itm_subgroup = s.subgrp_id") dim tmp ienumerable(of datarow) = new datatable().asenumerable() dim predicate system.linq.expressions.expression(of func(of datarow, boolean)) = predicatebuilder.true(of datarow)() 'the error appears here predicate = predicate.and(function(x datarow) x("itm_brand") = brand) tmp = ds.asenumerable().where(predicate.compile()) this predicatebuilder class cl

java - Reference a specific password-encoder in my security-config.xml -

i using spring security login authorization. in security-config.xml using following code: <authentication-manager> <authentication-provider> <password-encoder hash="md5"/> <jdbc-user-service data-source-ref="datasource" users-by- username-query="select username, password,1 enabled users username=?" authorities-by- username-query="select username, authority,1 enabled users username =?" /> </authentication-provider> </authentication-manager> but in database have encrypted password using customized function not pure md5 hash. question can call function security-config.xml instead of <password-encoder hash="md5"/> or if there way? thank in advance. you can register custom password encoder (create class implements passwordencoder ) call customiwed function. in xml, change : <password-encoder hash

java - Unirest is caching basic authentication information -

we calling backend 2 rest services (a, b) (get method), these 2 services have different credentials (username , password), faced strange behavior: 1- if called first, authentication successful, if called b, receive forbidden (authentication failed) then deploy application again , scenario: 2- call b first, authentication successful, if called a, receive forbidden (authentication failed): this sample code of calling backend services: httpresponse<string> resp; try { resp = unirest.get(url) .basicauth(username,password).asstring(); string jsonstr = resp.getbody(); } catch (exception e) { e.printstacktrace(); throw e; } any help? i figured out. try this... final credentialsprovider provider = new basiccredentialsprovider(); final usernamepasswordcredentials credentials = new usernamepasswordcredentials(getusername(), getpassword()); provider.setcredentials(authscop

android - Adding imageView on ViewGroup with setOnTouchListener -

edit: question solved! i'm facing a, hopefully, simple problem. need it's show/add image on ontouch position when user click on image/area. layout: activity_test_diff.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".testdiff" android:orientation="vertical"> <relativelayout android:id="@+id/relative_layout" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <imageview android:id="@+id/img_rectangle" android:layout_width="match_parent" android:layout_height="match_parent" android:scaletype="fitcenter" android:visibility="invisible"/> <

Porting web service (SOAP) application to Tandem NonStop -

can suggest simplest way implement soap web service that: implements simple protocol (incidentally, used secure key management) unwraps xml digital signatures interacts enscribe file system does not have fault-tolerant standard non-stop process by "simplest" mean "has least dependencies". lower cost not worry now. i have been advised xpnet might 'platform' use possibly there better ways. thanks! there other products besides xpnet designed - csl soap example. know bit csl, imagine competitor products function in broadly same way. csl lets implement business end of logic pathway servers can (of course) access enscribe resources, , expose functionality web services, providing/generating required code packaging/unpackaging soap messages. probably best check out available products , see 1 gives of functionality require.

twiml - Hunt Group for Twilio, using Twilio Functions. (aka FindMe ) -

i trying set hunt group twilio twiml do have set different twimlbin each number in hunt group? or there way join single twimlbin? twimlbin 1: <response> <dial action="http://www.ourapp.com/webhook;failurl=/twimlbin 2" timeout="10" callerid="555-555-5555"> number1 </dial> </response> twimlbin 2: <response> <dial action="http://www.ourapp.com/webhook;failurl=/twimlbin 3" timeout="10" callerid="555-555-5555"> number2 </dial> </response> ... repeat n times each agent ... thank :-) twilio developer evangelist here. twiml bins great static bits of twiml, use case needs bit more that. i recommend check out twilio functions allow run node.js code in twilio's infrastructure. i've built , tested version of works twilio functions . here's explanation of ho

c++ - finding wildcard entries efficiently -

i have map contains strings keys; string resemble wildcards. a key can have * @ end, means when lookup performed, string has key prefix shall match key. how can efficiently retrieve closest matching entry in such map? i tried sorting map entries in custom way , using lower_bound , sorting not produce correct result: #include <map> #include <string> #include <iostream> #include <algorithm> struct compare { bool operator()(const std::string& lhs, const std::string& rhs) const { if (lhs.size() < rhs.size()) { return true; } if (lhs.size() > rhs.size()) { return false; } bool iswildcardlhsatend = (!lhs.empty() && lhs.back() == '*'); bool iswildcardrhsatend = (!rhs.empty() && rhs.back() == '*'); if (iswildcardlhsatend && iswildcardrhsatend) { return lhs < rhs; } auto lhsubstring =

Cassandra WriteTimeoutException exception in CounterMutationStage - node dies eventually -

i'm getting following exception in cassandra system.log: warn [countermutationstage-25] 2017-07-25 13:25:35,874 abstractlocalawareexecutorservice.java:169 - uncaught exception on thread thread[countermutationstage-25,5,main]: {} java.lang.runtimeexception: org.apache.cassandra.exceptions.writetimeoutexception: operation timed out - received 0 responses. @ org.apache.cassandra.service.storageproxy$droppablerunnable.run(storageproxy.java:2490) ~[apache-cassandra-3.9.jar:3.9] @ java.util.concurrent.executors$runnableadapter.call(unknown source) ~[na:1.8.0_112] @ org.apache.cassandra.concurrent.abstractlocalawareexecutorservice$futuretask.run(abstractlocalawareexecutorservice.java:164) ~[apache-cassandra-3.9.jar:3.9] @ org.apache.cassandra.concurrent.abstractlocalawareexecutorservice$localsessionfuturetask.run(abstractlocalawareexecutorservice.java:136) [apache-cassandra-3.9.jar:3.9] @ org.apache.cassandra.concurrent.sepworker.run(sepworker.java:109) [apache-

(STILL NOT FIXED) PHP - Website loading because of file size -

this question has answer here: php change maximum upload file size 13 answers i making basic website can sign , login. working fine, except uploading image file use profile picture. whenever file around 300+ mb , submit form, page keeps loading , gives me '502: bad gateway' as error. i tried changing max_file_size in php.ini , did not change anything. tried increasing memory_limit in php.ini , again, did not fix problem edit 1: getting the 502: bad gateway error still whenever use phpstorm. when uploading nas (which has phpmyadmin , apache installed) works there. changed settings in php.ini, did not change said few times. stop giving me answer, since found answer billion times. edit 2: edited post , said has been answered already. not case. still having same problem!!! in php.ini need set both of following values: ; maximu

angularjs - Create HTML output to copy and paste into a 2 column Excel page -

i'm working on creating web page allow me paste in bunch of text in textarea , show me cleaned output of need. example, can have 5000+ lines this: 2015-08-11 15:45:44 info filecount:135 - identifier: 198743247, reg-category: 255, dailycount: 1 , durationcode: 112 the information need dailycount number , durationcode number. have written code extract information , store results in array looks this: [{ "dailycount" : 1, "durationcode" : 112 }, { "dailycount" : 5, "durationcode" : 17 }, { "dailycount" : 2, "durationcode" : 6 }] what i'm trying achieve display output in 2 column view can copy output page , paste in 2 column excel sheet. currently, pasting output in excel results in data going 1 column. tried selecting 2 columns , pasting data, excel complains clipboard not having same size , shape selected cells. any appreciated. i'm using angular 1.4 repeat on array display output. if

c - Equivalent to Arduino millis() -

i working on integration of "shunt" type sensor on electronic board. choice on linear (ltc2947), unfortunately has arduino driver. have translate in c under linux compatible microprocessor (apq8009 arm cortex-a7). have small question 1 of functions: int16_t ltc2947_wake_up() //wake ltc2947 shutdown mode , measure wakeup time { byte data[1]; unsigned long wakeupstart = millis(), wakeuptime; ltc2947_wr_byte(ltc2947_reg_opctl, 0); { delay(1); ltc2947_rd_byte(ltc2947_reg_opctl, data); wakeuptime = millis() - wakeupstart; if (data[0] == 0) //! check if in idle mode { return wakeuptime; } if (wakeuptime > 200) { //! failed wake due timeout, return -1 return -1; } } while (true); } after finding usleep() equivalent delay(), can not find millis() in c. can me translate function please? arduino millis() based on timer trips overflow interrupt @ close 1 khz, or 1 millisecond

Android Studio Notification Lights -

why led lights not working notification? notificationcompat.builder notificationbuilder = new notificationcompat.builder(this) .setdefaults(0) .setsmallicon(r.mipmap.ic_launcher) .setcontenttitle(remotemessage.getdata().get("username")) .setcontenttext(remotemessage.getnotification().getbody()) .setvibrate(new long[]{1500, 0, 1500, 0}) .setlights(color.blue, 2000, 1000) .setwhen(remotemessage.getsenttime()) .setautocancel(true) .setpriority(notificationcompat.priority_high) .setstyle(new notificationcompat.bigtextstyle().bigtext(remotemessage.getnotification().getbody())) .setsound(ringtonemanager.getdefaulturi(ringtonemanager.type_notification)) .setcontentintent(pendingintent); notificationmanager notificationmanager = (notificationmanager) getsystemservice(context.notif

c# - JpegBitmapEncoder QualityLevel has no effect -

i want save image jpeg jpegbitmapencoder setting qualitylevel has no effect? resulting jpeg same size (~4mb 2200x1500px). rendertargetbitmap rtb = new rendertargetbitmap(collage.breite, collage.hoehe, dpi, dpi, system.windows.media.pixelformats.default); canvas.updatelayout(); rtb.render(canvas); jpegbitmapencoder jpgencoder = new jpegbitmapencoder(); jpgencoder.qualitylevel = 35; // no effect, image big jpgencoder.frames.add(bitmapframe.create(rtb)); using (var fs = system.io.file.openwrite(myfilename, variables))) { jpgencoder.save(fs); fs.close(); fs.dispose(); } i changed to: var fs = new filestream(myfilename, variables), filemode.create); jpgencoder.save(fs); fs.close();

oauth - OAuthToken app script google sheets not going to "Unverified auth flow" -

recently google changes policy oauthtoken requests. if app not verified supposed "unverified auth flow". have script convert sheet pdf , email it. when share "google sheets" has script users getting error 400 : invalid_scope , not "unverified auth flow". ideas why?

php - How can it be possible to divide in batches of AWS SNS topic based push notification? -

basically, using aws cloud application (concept of application based on posts , comments) in have thousand of users registered application , subscribed aws sns topic. whenever posts in app, users notified push notification same time using aws sns topic.so, user may active on app. traffic has been increased on database server , has been hanged. is there way divide topic in multiple topics , set delay (delay won't affect application requirement) between them , send push notification ? or else best resolution handle database load promblem

ios - Show an alert that looks like SKStoreReviewController -

how can show alert thats similar skstorereviewcontroller? i how looks , want use similar ui on app. make new view controller let vc = uiviewcontroller() vc.preferredcontentsize = cgsize(width: 250,height: 300) create want on view, example picker view let pickerview = uipickerview(frame: cgrect(x: 0, y: 0, width: 250, height: 300)) pickerview.delegate = self pickerview.datasource = self then add view controller vc.view.addsubview(pickerview) with can create alert view , set view controller key contentviewcontroller let customalert = uialertcontroller(title: "title", message: "", preferredstyle: uialertcontrollerstyle.alert) customalert.setvalue(vc, forkey: "contentviewcontroller") let okaction = uialertaction(title: "ok", style: .default) { uialertaction in // should happen when click ok } customalert.addaction(okaction) customalert.addaction(uialertaction(title: "abort", style: .cancel,

elasticsearch - logstash geoip filter returns _geoip_lookup_failure -

i working on logstash . have installed logstash-filter-geoip but when tried use returns _geoip_lookup_failure thi in logstash.conf file filter{ geoip { source => "clientip" } } this input logstash 55.3.244.1 /index.html 15824 0.043 it returns { "duration" => "0.043", "request" => "/index.html", "@timestamp" => 2017-07-25t14:33:30.495z, "method" => "get", "bytes" => "15824", "@version" => "1", "host" => "des-0033", "client" => "55.3.244.1", "message" => "55.3.244.1 /index.html 15824 0.043", "tried use returns _geoip_lookup_failuretags" => [ [0] "_geoip_lookup_failure" ] }

node.js - Find what NPM modules depend on yours in a local Verdaccio registry -

previously, similar question asked . however, question never received answer addressed attempting complete same task on local verdaccio repo. ben burns noted in comments, making api call used in highest rated answer result in server returning { "error" : "no such package available" } . is there way find dependents on local verdaccio registry? , if so, how?

javascript - Building an $http request from form field in AngularJS -

i trying build basic angularjs weather app takes users zip code form , makes api call current forecast. app has 2 views/routes. first view has input field , submit button collect user's zip. second view display forecast. what want have happen have user put zip code form , upon submitting it, build url make http request call with. final url like: baseurl + userzipfromform + .json i tried using angular's $http, won't let me pass in variable url expecting string. don't think trying qualify query parameter , i've read things creating factory little turned around @ moment. if using ng-submit trigger building url, how make $http request , put response right scope use in forecast view? html: <div class="text-center"> <h2>enter zip</h2> <form name="myform" ng-submit="submitmyform()"> <input type="text" ng-model="zipcode" /> <button type="submit" value

Spring MVC - REST Api, keep getting 400 Bad Request when trying to POST -

i have rest api service should receive post calls. i'm using postman test them, keep getting 400 bad request error, no body, maybe i'm building bad controller... this controller @postmapping("/object/delete") public responseentity<?> deleteobject(@requestbody long objectid) { logger.debug("controller hit"); object o = service.findbyobjectid(objectid); if(o!=null){ service.deleteobject(object); return new responseentity<>(httpstatus.ok); } return new responseentity<>(httpstatus.not_found); } using @requestbody should send request in json, in way: { "objectid":100 } but 400 error, , strange think logger logger.debug("controller hit"); it's not printed in logs... sending { "objectid":100 } result in receiving object x objectid attribute in java method. if need send id, can use @pathvariable @postmapp

node.js - angular 2 : file upload progress bar working incorrectly -

Image
i using ng2-file-uploader upload single image file node server. during upload, progress bar not indicating progress when click on "upload" button, though image saved node server. but when click on "cancel" button, progress indicator shows progress. component.ts @component({ selector: 'button-view', template: ` <input type="file" class="form-control" name="single" ng2fileselect [uploader]="uploader" /> queue length: {{ uploader?.queue?.length }} <table class="table"> <thead> <tr> <th width="50%">name</th> <th>size</th> <th>progress</th> <th>status</th> <th>actions</th

ios - Cannot invoke initializer for type 'User' with an argument list of type '(snapshot: (DataSnapshot)) Swift 3 -

after update firebase pod got error : cannot invoke initializer type 'user' argument list of type '(snapshot: (datasnapshot))' and here code enter image description here any idea solve ..??? func loaduserinfo(){ let userref = databaseref.child("users/\(auth.auth().currentuser!.uid)") userref.observe(.value, with: { (snapshot) in let user = user(snapshot: snapshot) self.usernamelabel.text = user.username self.usercountry.text = user.country! self.userbiographytextview.text = user.biography! let imageurl = user.photourl! self.storageref.reference(forurl: imageurl).data(withmaxsize: 1 * 1024 * 1024, completion: { (imagedata, error) in if error == nil { dispatchqueue.main.async { if let data = imagedata { self.userimageview.image = uiimage(data: data) } } } else {

asp.net mvc - Certain Razor views not publishing -

using vs 2017 mvc 5 razor views. when publish application, handful of specific views not copied over. i'd discovered several se questions on same issue in 2010-2011 timeframe. @ time, issue build action in file's properties not set content due bug in rc has since been resolved. well, of mine do day content build action. any reason why small number of views not making in publish? as far i'm aware, there 2 things can cause happen. as in question, build action each view needs set "content" the view files need included in project file, in .csproj file there should line this: <content include="views\controllername\index.cshtml" />

java - How to mock external dependencies for final objects? -

public class a{ private final b b; public void meth() { //some code integer = b.some_method(a,fun(b)); //some code } private fun(int b) { return b; } } when(b.some_method(anyint(),anyint())).thenreturn(100) how mock externally dependency when writing unit tests class a. when mock dependency in above way, value of "a" not getting assigned 100 expected. actually answer of jakub correct. maybe need example understand how it. check main method , contructor of example. public class { private final b b; public a(b b) { this.b = b; } public void meth() { //some code integer = b.some_method(5,fun(5)); //some code system.out.println(a); } private int fun(int b) { return b; } public static void main(string[] args) { b b = mockito.mock(b.class); when(b.some_method(anyint(), anyint())).thenreturn(100); new a(b).meth(); }

windows installer - Fail installation of MSI for certain value of registry value -

can installation of msi creating wix fail (non zero) value in windows registry . value of registry changing on 1 of custom action. sequence of action need taken care through msi : 1) calling exe modifying windows registry check. 2) need read value registry , setting in property. 3) based on property value, need go ahead insallation (for 0 value) else need fail insallation. below wix file had created this. (pasting actions in sequence) <property id="inst"> <registrysearch id="instgo" root="hkcu" key="software\abc" name="result" type="raw" win64="no" /> </property> <setproperty id="instval" after="appsearch" value="-1" /> other logic... <binary id='verifyexepath' sourcefile='$(var.productsource)\myfile.exe '/> <customaction id=&q

linux - How to have simple and double quotes in a scripted ssh command -

i writing small bash script , want execute following command via ssh sudo -i mysql -uroot -ppassword --execute "select user, host, password_last_changed mysql.user password_last_changed <= '2016-9-00 11:00:00' order password_last_changed asc;" unfortunately command contains both simple , double quotes can't do ssh user@host "command"; what recommended way solve issue ? using heredoc you can pass exact code on shell's stdin: ssh user@host bash -s <<'eof' sudo -i mysql -uroot -ppassword --execute "select user, host, password_last_changed mysql.user password_last_changed <= '2016-9-00 11:00:00' order password_last_changed asc;" eof note above doesn't perform variable expansions -- due use of <<'eof' (vs <<eof ), passes code remote system exactly , variable expansion ( "$foo" ) expanded on remote side, using variables available remote shell. this consume