Posts

Showing posts from January, 2010

java - Edge webdriver fails on simple findElement -

i'm using selenium java & testng year testing web application being build dynamically . i'm testing chrome, ff , ie11 , feeling ready start edge webdriver. after implementing edge driver fits os build (release 14393), , loaded web page successfully, i got issue when trying find element using xpath string: ".//*[contains(@class,'cbola-layer in-content-container-wrapper')]" the error: org.openqa.selenium.nosuchelementexception: no such element that's simple code i'm using: string layertypeattribute = driver.findelement(by.xpath(consts.xpath_string)).getattribute("layer_attribute"); is there workaround finding xpath? installed java version 1.8.0_73 update: test fail when trying find element regardless of xpath. tried find class name , id , nothing came up. maybe important i'm testing web application being built async script runs inside page. can find simple html on page not related application, can't find

c# - StreamType deprecated. How to get the stream type? -

i'm trying implement playsound() method should play default notification sound. work perfectly. here's code: public void playsound() { mediaplayer mediaplayer = new mediaplayer(); var notification = ringtonemanager.getdefaulturi(ringtonetype.notification); mediaplayer.setdatasource(application.context, notification); ringtone r = ringtonemanager.getringtone(application.context, notification); mediaplayer.setaudiostreamtype(r.streamtype); mediaplayer.prepare(); mediaplayer.start(); } the compiler tells me r.streamtype deprecated. i've looked @ various locations can't find 'new' way streamtype. know? api 21 added mediaplayer.setaudiostreamtype replace mediaplayer.setaudiostreamtype , can runtime check determine api methods use: if (build.version.sdkint >= buildversioncodes.lollipop) { var attribs = new audioattributes.builder().setflags(audioflags.none).setlegacystreamt

ssl - import self-signed certificate in Android to sniff HTTPS traffic -

using titanium web proxy , able generate certificate sniff ssl traffic in computer. when try import certificate in android 4.4.4 phone sniff ssl traffic. couldn't import certificate there properly, when tried install internally (from sd card); researches, realized that's because doesn't accept in-house certificate security reasons. so question is: how force import certificate in android phone or generate 1 phone accept able sniff https traffic using proxy?

android - How to fix Minimum and Maximum crop size for an Image in Picasso -

how can fix image minimum size while cropping (zooming out) technology: android you have 2 options: 1. subclass transformation , implement crop logic 2. subclass 1 of transformations you've mentioned , apply logic

selenium - Null pointer exception when using extent report -

i have 2 classes baseclass , tescaseloginpage . when trying execute tescaseloginpage class without report/logger (extentreport),test case getting pass. when puttin extend report code, getting nullpointerexception .could please me i have written report.endtest(logger); in line no 51. tried comment line , executed. time got same error in line no 50 i.e. logger.log(logstatus.info,"browser closed"); . every time commenting error line, getting same error in new log related line only. error log below : url : http://store.demoqa.com//products-page//your-account// failed configuration: @afterclass close java.lang.nullpointerexception @ testcases.testcaseloginpage.close(testcaseloginpage.java:51) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl(nativemethodaccessorimpl.java:62) sun.reflect.delegatingmethodaccessorimpl.(delegatingmethodaccessorimpl. java:43) @ java.lang.reflect.method.invoke(met

android - How to configure an inner-layout programmatically -

i have layout defined in xml , looks this: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/footer_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_weight="1" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center"> <!-- add views here --> </relativelayout> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/app&qu

python - How to vectorize/tensorize operations in numpy with irregular array shapes -

Image
i perform operation if had regular shape, use np.einsum, believe syntax np.einsum('ijp,ipk->ijk',x, alpha) unfortunately, data x has non regular structure on 1st (if 0 index) axis. to give little more context, refers p^th feature of j^th member of i^th group. because groups have different sizes, effectively, list of lists of different lengths, of lists of same length. has regular structure , can saved standard numpy array (it comes in 1-dimensional , use alpha.reshape(a,b,c) a,b,c problem specific integers) i avoid storing x list of lists of lists or list of np.arrays of different dimensions , writing like a = [] in range(num_groups): temp = np.empty(group_sizes[i], dtype=float) j in range(group_sizes[i]): temp[i] = np.einsum('p,pk->k',x[i][j], alpha[i,:,:]) a.append(temp) is nice numpy function/data structure doing or going have compromise partially vectorised implementation? i know sounds obvious, but, if ca

How to position the -draw in imagemagick? -

i using imagemagick draw border on top of image. this code: convert source.jpg -stroke red -strokewidth 2 -fill transparent -draw \"roundrectangle 10,10 628,151 10,10\" source.jpg this works fine need able position -draw want. i tried position border using -geometry so: convert source.jpg -stroke red -strokewidth 2 -fill transparent -geometry +5+15 -draw \"roundrectangle 10,10 628,151 10,10\" source.jpg but not position want. tried using - gravity , doesn't work either! could please advise on this? thanks in advance. bonzo correct, cannot use -geometry -draw. in imagemagick -draw can translate want center , specify +- distances corners center placement. suppose have 100x100 size box want draw , want centered @ 250,250, then convert input.jpg -stroke red -strokewidth 2 -fill transparent -draw "translate 250,250 roundrectangle -50,-50 50,50 10,10" output.png that makes easier draw same size boxes @ different locati

c# - How to stream STT file to IBM Watson (Unity)? -

i using ibm watson unity sdk there examples in web on how send file ibm watson. but no exact examples how stream long file split parts. want do: i have log audio file (about 1-3min) , want sent watson recognize speech. ibm watson accepts <5mb files, file larger, need split , send parts. here code: private void onaudioloaded (audioclip clip) { debug.log ("audio loaded , starting stream..."); _chunkscount = 0; float[] clipdata = new float[(int)(clip.length * chunk_size)]; clip.getdata (clipdata, 1); try { _speechtotext.startlistening (onrecognize); (int = 0; < math.ceiling (clip.length / seconds_to_split); i++) { debug.log ("iteration of recognition #" + i); _chunkscount++; // creating array of floats clip array float[] chunkdata = new float[seconds_to_split * (int)chunk_size]; array.copy (clipdata, * seconds_to_split * (int)chunk_size, chunkdata, 0

python - is it ok to use files inside pip packages without installing them -

Image
i working on project , have cloned repository github. after first compile realized project cloned has dependencies , in requirements.txt file. i know have install these packages, dont want cause on windows development environment , after finishing project going publish ubuntu production environment , dont want take hassle of double installation. i have 2 options: using virtualenv , installing packages inside it downloading packages , use them direct way using import foldername i wanna avoid first option cause have less control on project , problem gets bigger , bigger if example inside project's virtualenv , wanted run project's main.py file own virtualenv , etc... moving virtualenv windows (bat files) linux (bash / sh files) seems ugly me , directs me approaches choose better avoid. the second option choice. example need use future package. scenario downloading package using pip download future , when done extracting tar.gz file, inside src folder

Asterisk Background function not playing ivr as expected -

hi trying play ivr in background during call. have no need ringing sound. have tried following far extensions.conf file exten => _x.,1,progress() exten => _x.,2,background(you_have&minutes&dollar&you_have&dollar) exten => _x.,3,agi(mybilling.php) exten => _x.,n,hangup its not working. working playback() , call starting (initiating) after ivr finished. i need play ivr background while call being sent user any idea regarding playing background music appreciated. i have tried m option dial() no idea how play ivr instead default file. using phpagi ivr playing agi script. if can solve issue using agi script acceptable. asterisk version 1.8 i think not readed do. it work waitexten after it. i.e if this exten =>s,1,background(file) same => n,waitexten(5);wait upt 5 sec, still play file exten => 1,1,noop(1 pressed) then works. no other variant. to want need play conference bridge or chanspy in additional channel.

amazon s3 - Issues querying Athena table where source bucket is from a different account -

i have created athena tables files in s3 bucket not belong account. tables partitioned , when run msck repair table command successful , shows partitions not in metastore. when query table gives following error "your query has following error(s): insufficient permissions execute query. this query ran against "......" database, unless qualified query. please post error message on our forum or contact customer support query id: ..........." what issue here? the issue describing caused wrongly set access policy. guess, athena account has listbucket privilege, not getobject . as sample, used following bucket policy test cross account access. { "version": "2012-10-17", "statement": [ { "action": [ "s3:getobject", "s3:listbucket" ], "effect": "allow", "resource": ["arn:aws:s3:::bucketname","arn:a

can i use array index as order in cakephp? -

i have use array condition, , @ same time, need use array index order. why because unable records in order. here code: my array- (which not in order) array ( [0] => 252 [1] => 262 [2] => 297 [3] => 310 [4] => 322 [5] => 386 [6] => 1173 [7] => 1236 [8] => 205 [9] => 234 [11] => 256 [13] => 929 [18] => 389 [19] => 401 [21] => 1119 ) i want display results based on these values (id's), when using records in cake php, getting sorted (default - desc) order, not using order. code: $this->paginate = array ( 'conditions' => array( 'forum.id' => $final_list,'forum.is_active' => 1),); $forum_list = $this->paginate ( 'forum' ); can me, how can results array index order? thanks.

glsl - Passing QML Array to ShaderEffect -

i try render grid different colors each field, depending on input. in imagination suitable input array: property var fields: [0, 1, 0, 1, 0, 1, 0, 1, 0] might appropriate describe 3x3 (colorful) chess board. the corresponding shadereffect this: shadereffect { width: 600 height: 600 property var fields: [0, 1, 0, 1, 0, 1, 0, 1, 0] fragmentshader: " varying highp vec2 qt_texcoord0; uniform highp int fields[9]; void main() { highp int field = int(floor(qt_texcoord0.x * 3.0) + (floor(qt_texcoord0.y * 3.0) * 3.0)); gl_fragcolor = vec4(fields[field], field / 9.0, 0.0, 1.0); } " } but value fields[field] seems 0 though field proven not be. how can array working in shader? have it, access wrong?

php - check for valid 5 and 6 digit zipcode -

i able autofill state,city , area based on 6 digit zipcode.the issue comes when want check validity of zipcode starting 5th digit.i know show invalid zip code error comparing value against database value..here goes code have used. there way can hide error of invalid zip code after 5th digit while still continuing validate after 5th digit of zipcode? <script> require([ 'jquery' ],function($){ $(document).ready(function(){ $('#seller_zipcode').keyup(function() { pincode = $('#seller_zipcode').val(); pincode1 = $('#seller_zipcode').slice(0,-1); //pincode1 = pincode.slice(0,-1); //console.log(pincode1); if(pincode.length == 6 || pincode1.length == 5){ $.ajax({ type: 'post' ,url: "<?php echo $block->geturl('marketplace/zipcode/zipcode');?&g

How to update existing Polyline in android mapbox? -

in map when click marker poly line , distance. again when click marker in map new line when click 2nd marker need update poly line, no need add multiple polylines. you can use add polyline : polyline mpolyline = this.mmap.addpolyline(new polylineoptions().....); and remove call : mpolyline.remove(); hope helps!!!

c# - Why does my character/camera stutter in Unity 2d? -

ever since i've added new camera script, character (which camera trying follow) keeps on stuttering when moving. if keep character still, won't stutter anymore. here's video of mean. using unityengine; using system.collections; using system.collections.generic; public class camerafollow : monobehaviour { public transform lookat; private bool smooth = true; private float smoothspeed = 0.1f; private vector3 offset = new vector3 (0, 0, -6.5f); void lateupdate() { vector3 desiredposition = lookat.transform.position + offset; if (smooth) { transform.position = vector3.lerp (transform.position, desiredposition, smoothspeed); } else { transform.position = desiredposition; } } } please - it's driving me crazy! edit: ignore error @ bottom - it's part of else i'm working on. edit2: never mind, turning on interpolation in rigidbody2d fixed it! help! first of all, make sure code changing position of lookat tra

marklogic - Read and write using DocumentMetadataHandle and InputStreamHandle -

trying read document 1 location , write different location. using documentmetadatahandle metadata , inputstreamhandle read content. write when use same inputstreamhandle used read throwing stream closed exception. same not happening when don't use documentmetadatahandle in read. code below. using java client api 3.0.7 xmldocumentmanager documentmanager = client.newxmldocumentmanager(); transaction transaction = client.opentransaction(); inputstreamhandle handle = new inputstreamhandle(); documentmetadatahandle metadatahandle = new documentmetadatahandle(); documentmanager.read(uri, metadatahandle, handle,transaction); documentmanager.write(newuri, metadatahandle, handle, transaction); if want buffer document in memory writing server, might consider using byteshandle instead of inputstreamhandle. documentmetadatahandle buffer metadata.

Error: This is not a typed array when using gulp autoprefixer -

Image
i have following gulp file: 'use strict' var gulp = require('gulp'), rename = require("gulp-rename"), cssbeautify = require('gulp-cssbeautify'), autoprefixer = require('gulp-autoprefixer'); gulp.task('css-prefix', function() { return gulp.src('css/*.css') .pipe(autoprefixer()) .pipe(gulp.dest('fcss')); }); now when run gulp command folllowing error: gulp css-prefix error: not typed array. why getting error ? it appears need upgrade node.js version @ least >= 4.5. see github typed array issue , autoprefixer dependencies.

xamarin.forms - What does x:Double mean for a Xamarin Button? -

my code has: <button x:name="correctbutton" heightrequest="60" horizontaloptions="fillandexpand" verticaloptions="startandexpand"> <button.fontsize> <onplatform x:typearguments="x:double" ios="25" android="20" /> </button.fontsize> </button> can explain x:double means i have broken down comments in xaml. <!-- here button declared, note how see x:name here --> <button x:name="correctbutton" heightrequest="60" horizontaloptions="fillandexpand" verticaloptions="startandexpand"> <!-- besides giving properties control, in case button, attributes, can set them adding them child nodes. happens fontsize here --> <button.fontsize> <!-- not setting fontsize here, letting value dependent on platform running on. ios value 25, android 20. --> <onplatform x:typearguments="x:do

listview - Converting android file browser ListActivity example into a Fragment -

i trying figure out way use example in fragment: http://sampleprogramz.com/android/browse.php i have changed oncreate method oncreateview method , have tried correct of errors android studio flags can't seem working. here code: import java.io.file; import java.io.filenamefilter; import java.util.arraylist; import java.util.collections; import java.util.comparator; import java.util.list; import android.app.listactivity; import android.content.context; import android.content.intent; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.listfragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.imageview; import android.widget.listview; import android.widget.textview; import static android.app.activity.result_ok; public class filepicker extends listfragment { public final static string extra_file_path = "file_path&quo

ruby - Selenium Cabybara testing with stripe3 -

we migrated our app form stripe 2 stripe 3, selenium test stopped working. have feature example and bob enters input "5555555555554444" in "cardnumber" text field in code and(/^(\s*) enters input "([^"]*)" in "([^"]*)" text field$/) |user, txt, field| fill_in(field, :with => txt) end and receive error unable find field "cardnumber" (capybara::elementnotfound) my question is possible enter values new stripe3 fields, it's kind of iframe, , how? old stripe fields regular inputs. tried and(/^(\s*) enters frame "([^"]*)" in "([^"]*)" text field$/) |user, txt, field| within_frame '__privatestripeframe4' find("input[name='cvc']").set(1234) end

vb.net - Visual Basic generate random number -

i new coding , want make simple program moves windows random location on desktop. right code this: me.location = new point(27, 55) me.location = new point(502, 624) me.location = new point(858, 477) me.location = new point(564, 50) me.location = new point(898, 41) me.location = new point(468, 944) me.location = new point(417, 7) me.location = new point(841, 697) me.location = new point(953, 438) i had put in code myself never random , repeat itself. how make numbers random number? first declare variable in scope of class: dim rnd new random then put code in whatever event want use set window random position: me.location = new point(rnd.next(0, my.computer.screen.workingarea.width - me.width), rnd.next(0, my.computer.screen.workingarea.height - me.height)) this make sure window stay within bounds of screen when put new random position.

python - Round Date in Pandas Dataframe -

this question has answer here: pandas: convert date in month 1st day of next month 1 answer i'm attempting round date dataframe below 1st day of next month - i.e. 1997-10-10 result in 1997-11-01: date 1997-10-10 1997-05-27 1997-04-30 1997-12-19 1997-08-12 currently code looks like: df = pd.read_csv(xxx) df['date'] = pd.to_datetime(df.date) df['date'] = df['date'].dt.date.replace(day = 1) according python library documentation , date.replace(year=self.year, month=self.month, day=self.day) return date same value, except parameters given new values whichever keyword arguments specified. example, if d == date(2002, 12, 31), d.replace(day=26) == date(2002, 12, 26). i had presumed use .replace 1 argument - day -however i'm receiving number of errors. i think need monthbegin(0) : df['date'] = pd.to_datetime(

Not able to receive push notification to iOS devices when using Amazon SNS -

i have followed steps mentioned in official documentation . able register device tokens in application endpoint list successfully. message has been published registered tokens. delivery status says success (status code 200) in cloud watch console. device isn't able receive notifications in ios devices. reason? note : have enabled notification settings in devices , ios project.

javascript - React Transition Group slide elements up -

my current version hiding each row, happens quickly, can see here in codepen . repro deleting top element. i prefer if events unfolded this: fade out slide up i'm unsure how using css transitions , reacttransitiongroup if can stage see element disappearing, bunching great start!! my transition stuff: const customerlist = ({ ondelete, customers }) => { return ( <div class="customer-list"> <transitiongroup> {customers.map((c, i) => <csstransition key={i} classnames="customer" timeout={{ enter: 500, exit: 1200 }} > <customerrow customer={c} ondelete={() => ondelete(i, c)} /> </csstransition> )} </transitiongroup> </div> ); } my css: .customer-enter { opacity: 0.01; } .customer-enter.customer-enter-active { opacity: 1;

how to load an image from url in native (cpp) and load it in android -

i looking on research based on loading image in native cpp side , calling function in java class display image in android app. currently adding image passing string (url) cpp side. loading image part done in java class itself private class downloadimagefrominternet extends asynctask<string, void, bitmap> { imageview imageview; public downloadimagefrominternet(imageview imageview) { this.imageview = imageview; toast.maketext(getapplicationcontext(), "please wait...", toast.length_short).show(); } protected bitmap doinbackground(string... urls) { string imageurl = urls[0]; bitmap bimage = null; try { inputstream in = new java.net.url(imageurl).openstream(); bimage = bitmapfactory.decodestream(in); } catch (exception e) { log.e("error message", e.getmessage()); e.printstacktrace(); } return bimage; } protected void onpostexecute(bitmap result) { imageview.setimagebitmap(result); }

c++ - Blurring images of an image pyramid - Vector subscript out of range -

i trying load image, calculate image pyramid (save every image) , blur every single image of pyramid opencv 3.2 in c++. when run program receive error: vector line:1740 expression: vector subscript out of range here code: #include "stdafx.h" #include <opencv2/highgui/highgui.hpp> #include <opencv2/xfeatures2d.hpp> #include <iostream> #include <opencv2/shape/shape.hpp> using namespace std; using namespace cv; using namespace cv::xfeatures2d; int main(int argc, char** argv) { // read image mat img_1; img_1 = imread(argv[1], cv_load_image_grayscale); // build image pyramid , save in vector of mat vector<mat> img_1_pyramid; int pyramid_octaves = 3; buildpyramid(img_1, img_1_pyramid, pyramid_octaves); /* void cv::buildpyramid (inputarray src, outputarrayofarrays dst, int maxlevel, int bordertype = border_default) */ // initialize parameters first image pyramid vector<mat> re

javascript - How to pass data from child custom element back to parent element from where it is called in Polymer 2 -

i have custom element in polymer below <parent-element> <child-element mydata="{{data}}"> </child-element> <!--modifies data--> <!-- want pass updated data child-element-2--> <child-element-2> </child-element-2> </parent-element> let me know how pass updated data 2nd child element data-binding way go here. should using dash on attribute while in properties camelcase. can read in polymer documentation property name attribute name mapping . <dom-module id="my-element"> <template> <my-child-one data="{{data}}"></my-child-one> <my-child-two add-data="[[data]]"></my-child-two> </template> <script> polymer({ is: 'my-element', properties: { data: { type: string, }, }); </script> </dom-module> also not forget set notify true on property

javascript - Passing Elements (SVG) to web worker -

i have website need able take "snapshots" of animated svg @ different stages of animation (slow process). in parallel, animation running (fast process). i'm creating clone , in background i'm serializing svg @ different animation stages , uploading resulting images server. however, being ran in background quite slow , tends slow down animation of original svg. possible in web worker? if necessary, worker can fetch svg source file itself. i know passing dom element isn't possible: //main.js var s = new xmlserializer(); worker.postmessage(s.serializetostring(svg)) //worker.js parser = new domparser(); doc = parser.parsefromstring(e.data, "text/html"); //error uncaught referenceerror: domparser not defined and seems passing object isn't option either: //main.js worker.postmessage(json.stringify(svg)) //worker.js svgobject = json.parse(e.data); console.log(svgobject) //console output (just empty object prototype) object {} is web work

Django-Haystack: ResultSet contains which object -

i have indexed storypost our django-model stored in postgres . pretty confused object being returned searchqueryset . >>> results=searchqueryset().all() >>> results[0] <searchresult: kyc_connect_data_models.storypost (pk=u'429')> >>> results[0].object <storypost: <sarahh:first channel post>=qmvdxjvqxtzu9dwly7ktamyywrvwao9pd98kpyvz1jxrmg> in single result of type searchresult ok, when .object returns exact model, had stored model in elasticsearch? db, referring original object in postgres db. if how maintains fast indexing bcoz had hit db fetch it?

r - Extract table values from website -

Image
is there way scrap coordinates here ? i know must like: library(rvest) library(stringi) url <- "http://www.imo.org/en/ourwork/environment/pollutionprevention/airpollution/pages/emission-control-areas-%28ecas%29-designated-under-regulation-13-of-marpol-annex-vi-%28nox-emission-control%29.aspx" page <- html(url) coords <- page %>% html_nodes(".") %>% html_text() but not sure how find put in html_nodes. i trying run firebug in order find out it's mess (i don't have experience though web scrap or using firebug). slightly different approach: library(sp) library(rvest) library(stringi) library(hrbrthemes) library(tidyverse) target_url <- "http://www.imo.org/en/ourwork/environment/pollutionprevention/airpollution/pages/emission-control-areas-%28ecas%29-designated-under-regulation-13-of-marpol-annex-vi-%28nox-emission-control%29.aspx" pg <- read_html(target_url) now have page we'll need proper elements

reverse proxy - Apache set new header not working -

i'm trying put new header called myheader request proxied backend in apache reverse proxy 2.4 using following configuration. header not getting inserted. can apache expert please <location /dashboard> authtype form sethandler form-logn-handle authname dashboard authformprovider dbd authformloginrequiredlocation http://example.com/login.html authformlogoutlocation http://example.com/logout.html authdbduserpwquery "select cust_password table user=%s" require valid-user rewriteengine on session on sessionmaxage 6000 sessioncookiename session path=/ sessionheader x-replace-session rewritecond %{request_filename} -f rewritecond %{request_filename} -d rewritecond %{la-u:remote_user} ^[a-z].* rewriterule ^/(.*)\.(gif|jpg|png|jpeg|css|js|map|ttf|woff|woff2)$ http://localhost/dashboard/%{la-u:remote_user}/$1 [ns,nc,qsa,p,l] rewritecond %{la-u:remote_user}

Returning the sum of a select statement SQL -

i have created select statement: select arii2.amount ar_customer arc2 inner join ar_customer_site arcs2 on arc2.customer_id = arcs2.customer_id , arcs2.customer_id = arc2.customer_id inner join ar_customer_system arcsys2 on arcs2.customer_site_id = arcsys2.customer_site_id inner join ar_branch arb2 on arb2.branch_id = arc2.branch_id inner join ar_invoice arin2 on arin2.customer_site_id = arcs2.customer_site_id inner join ar_invoice_item arii2 on arii2.invoice_id = arin2.invoice_id inner join sy_system sysy2 on arcsys2.system_id = sysy2.system_id arin2.invoice_date > dateadd(year, -1, getdate()) , arc2.customer_number = '300000' , arii2.[description] ('warranty credit') or arii2.[description] = ('warranty credit t') group arii2.amount that returns following results. 2031.00 1458.98 1272.50

javascript - Laravel mix how to require a jquery library (parsely js) -

i have problem using parsley js (jquery plugin validation) in js file can require wouldn't work $(...).parsley not function , use laravel mix , use sweet alert , works properly, tried change parsley.js : module.exports = parsley; instead of return parsley; but still have same problem: $(...).parsley not function here code require , try use parsley: var parsley = require('../libs/parsleyjs/parsley.js'); $('[registerform]').parsley().validate(); please , thank you thank @apokryfos , solved problem, solution install parsley via npm , require : var parsley = require('parsleyjs') from package.json instead of var parsley = require('../libs/parsleyjs/parsley.js');

android - How correctly test if subscriber is called with correct data in onNext() (RxJava2) -

i test method: void updateavailablescreens() { safiecam.availablecameras() .flatmap(this::getavailablescreensforcameras) // causing failure .observeon(schedulers.mainthread()) .subscribe( screens -> { view.setavailablepagesonviewpager(screens); view.setavailablepagesonbottomsheet(screens); }, timber::e ); } with test (so giving known data, expect calling view expected enum list): @test public void widgetsshouldgetallscreens() { when(camera.availablecameras()).thenreturn( observable.just(arrays.aslist( safiecam.cameratype.selfie, safiecam.cameratype.rear))); testedvppresenter.updateavailablescreens(); list<viewpagerview.pages> pages = arrays.aslist( viewpagerview.pages.selfie, vie

sql - How to compare with date in mm/yy format in MySQL? -

i have column named 'exp_date' , date mm/yy. i.e: 07/17. want select rows exp_date less or equal 2 months remaining today. how can this? you need post sql dialect using. assume sql92. cast function first step: cast('20' || substring (exp_date,4,2) || '/' || substring (exp_date, 1,2) date) . mssql uses ' + instead of || . after that, compare current_date - interval '1 month' . caps here optional.

Street and Road names in Google Map -

i retrieve road , street names, if enters area in search box. possible in google api ? i have checked list of street , road names in google in api solution, there been given auto complete box , request not requirement. also learnt open street maps provide these data, unfortunately perform operations based upon google api's. can suggest me way, otherthan osm. google maps api not provide such functionality. however, there google maps roads api 1 of premium paid apis lets query nearest road names , other road metadata. can check out here: https://developers.google.com/maps/documentation/roads/intro you can try overpass-turbo ( https://overpass-turbo.eu/ ) lets query osm data. can set bounds , osm tags interested in.

hp ux - Limitation of HP awk -

a simple awk script works fine in linux , own hpux 11.31 platform, doesn't work in other hpux 11.31 system. can't access problematic hpux system not able test now. @ input data mystring my.linuxsrc running 16840 yourstring your.linuxsrc running 41794 @ myawk.awk /mystring / { printf "%s#%s#%s#%s",$1,$2,first,$3; printf "\n"; flag="yes"} @ error in other hpux system syntax error source line 1 error context <<< >>> awk: quitting source line 1. the version of awk in other hpux system: other_hpux] /usr/bin/awk /usr/bin/awk: main.c $date: 2009/02/17 15:25:17 $revision: r11.31/1 patch_11.31 (phco_36132) run.c $date: 2009/02/17 15:25:20 $revision: r11.31/1 patch_11.31 (phco_36132) $revision: @(#) awk r11.31_bl2010_0503_1 patch_11.31 phco_40052 my hpux system: my_hpux] /usr/bin/awk /usr/bin/awk: main.c $date: 2008/05/19 14:40:42 $revision: r11.23/3 patch_11.23 (phco

Python Pandas Dataframe Column of Lists, convert list to string in new column -

i have dataframe column of lists can created with: import pandas pd lists={1:[[1,2,12,6,'abc']],2:[[1000,4,'z','a']]} #create test dataframe df=pd.dataframe.from_dict(lists,orient='index') df=df.rename(columns={0:'lists'}) the dataframe df looks like: lists 1 [1, 2, 12, 6, abc] 2 [1000, 4, z, a] i need create new column called ' liststring ' takes every element of each list in lists , creates string each element separated commas. elements of each list can int , float , or string . result be: lists liststring 1 [1, 2, 12, 6, abc] 1,2,12,6,abc 2 [1000, 4, z, a] 1000,4,z,a i have tried various things, including converting panda df list string : df['liststring']=df.lists.apply(lambda x: ', '.join(str(x))) but unfortunately result takes every character , seperates comma: lists liststring 1 [1, 2, 1

html5 - Whether browser recognize document HTML version -

i have html document written in html 4. used required attribute html 5 worked surprise. saw error red border when input empty. think browser recognized document html 5 document , ignored doctype. question is, how browser google chrome recognize html document version. thanks hints. <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <style> input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } </style> </head> <body> <form> <label for="name">name</label> <input id="name" name="name" required> <button>submit</button> </form> </body> </html> how browser google chrome recognize html document version they don't. parse html. (the ex

node.js - Why would someone create an index on a collection in MongoDB? -

db.collection.createindex()¶ creates indexes on collections. i understand why need indexes on documents, why on collections? thanks helping! we not creating indexes on documents, index documents on collections, selecting 1 or more keys. index columns in tables on relational db world. just find right document (row) collection (table).

c# - Validating binding, depending on which button is clicked -

i searched lot, didn't find right solution. i have textbox , datagridview , 3 button s , bindingsource . when click button 'change' set binding , data loaded datagridview textbox , works: textbox.databindings.add("text", bindingsource, "name", true, datasourceupdatemode.onpropertychanged); when click button 'cancel' binding cleared: textbox.databindings.clear(); but data still transferred datagridview . think it's because of onpropertychanged . when change onvalidation , know saved, when it's validated. but how can validate or refuse validation? have 2 button s, , depending on whether 'save' button or 'cancel' button clicked, should transferred datagridview or not. and event textbox.validating += textbox_validating; i didn't running, because function called before can click button. how can achieve this? you can create binding datasourceupdatemode.never , store in form level varia

php - exclude file with Glob -

i using glob list of files in directory. foreach(glob(dirname(__file__) . '/{data-,list-}*.{php}', glob_brace) $filename){ $filename = basename($filename); echo "<option value='" . $filename . "'>".$filename."</option>"; } let file list in directory follow data-financebyyear.php data-finance.php data-hrbyyear.php how exclude files byyear in filename ? i tried , not working ..all files still displayed foreach(glob(dirname(__file__) . '/{data-,list-}*.{php}', glob_brace) $filename){ $filename = basename($filename); if (strpos($filename, 'byyear') !== false) { echo "<option value='" . $filename . "'>".$filename."</option>"; } } foreach(glob(dirname(__file__) . '/{data-,list-}*.{php}', glob_brace) $filename){ $filename = basename($filename); if (strpos($filename, 'by

excel - How to plot graphs on their corresponding sheet? -

i taking data multiple spreadsheets , plotting them on chart, each of respective spreadsheets. want data spreadsheet1 plot graph on spreadsheet1. currently, code plots of graphs on last sheet, graphs sheets 1,2,3, etc plotted on last sheet. unsure how fix new vba. recorded macro code plot data. here plotting code: for j = 1 size 'creates chart activesheet.shapes.addchart2(240, xlxyscatter).select activesheet.shapes("chart 1").incrementleft 696.75 activesheet.shapes("chart 1").incrementtop -81.75 activesheet.shapes("chart 1").scalewidth 1.3333333333, msofalse, _ msoscalefromtopleft activesheet.shapes("chart 1").scaleheight 1.6909722222, msofalse, _ msoscalefromtopleft application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false application.cutcopymode = false activechart.seriescollection.newseries activechart.fullseriescollection

angular - how to perform multiple buttons event handling onclick in listview -

i have 3 buttons in listview. need perform multiple button click trigger same method checkinstall . dont know how do. have added relevant code: html file: <listview [items]="allappslist" class="list-group"> ....... ....... <stacklayout row="0" col="2"> <button text= "install" (tap) ="checkinstall($event, myindex)" > </button> <button text= "open" (tap) ="checkinstall($event1, myindex)" > </button> <button text= "remove"(tap) ="checkinstall($event2, myindex)" > </button> </stacklayout> </listview> ts file: checkinstall(args: eventdata, index : number) : void { } for performing first button, checkinstall method working fine.but dont know how button id second , third button trigger separately checkinstall handle functionalities hide , show buttons. $event angul

Sort highscores in file python programming -

i have game programming, highest score saved down onto file in shall sorted after best score etc. have coded class , way save down score, cannot figure out how sort them after eachother like: ex: 16 9 3 the final score process! # display final score. drawboard(mainboard) scores = getscoreofboard(mainboard) change def save_highscore(self, highscore): highscores = set(self.get_highscores(false)) if highscore in highscores: return highscores.add(highscore) open(self.highscore_file, "w") f: f.write(" ".join(str(score) score in highscores)) to def save_highscore(self, highscore): highscores = set(self.get_highscores(false)) if highscore in highscores: return highscores.add(highscore) open(self.highscore_file, "w") f: f.write("\n".join(str(score) score in sorted(highscores, reverse=true)))

Trying to execute HTML after PHP code -

i making website can log in using http basic authentication. once person logs in correct credentials, start new session , have link continue page. on other page want check see if session has been started getting username session variable created on last page. if session variable exists, want execute pages html code. if session variable not exist, should give user link login page. know how can achieved? // second page checking see if session variables exists code <?php session_start(); if (isset($_session['username'])) { $username = $_session['username']; // command execute rest of webpage after php closing tag } else { die("<a href='index.php'>login</a>"); } ?> <!-- html code needs executed --> <p>hi!</p> you try , wrap webpage content around if in php tags. <?php session_start(); if (isset($_session['username'])) { $username = $_session['username'];

c# - Why does WebClient freeze my program? -

i can try string url when program gui freezes private void button1_click(object sender, eventargs e) { try { if (listbox1.items.count > 10) { messagebox.show("wow ! try hack iran ? :)"); application.exit(); } long fromnumber = convert.toint64(textbox1.text); long = convert.toint64(textbox2.text); int badn = 0; int godn = 0; int ern = 0; string slas; long gethow = ((to - fromnumber) + 1); if (fromnumber < 9010000000 && > 9399999999 && fromnumber > to) { messagebox.show("you entered wrong numbers !"); } if (fromnumber >= 9010000000 && >= 9010000000) { this.text = "myirancell bruteforce [ status : attacking ]"; (long = 1; <