Posts

Showing posts from March, 2012

python - How to identify if a page of PDF contains text using PyPDF2? -

the original task crop pdf several seperated parts. have adjusted params complete task,but sometimes, croping method lead 'blank page' looks like,it has text(using extracttext method). want know how filter 'blank page' mentioned above. below part of croping method: original = 'input.pdf' target = 'output.pdf' pdf = pdffilereader(open(original, 'rb')) page in pdf.pages: in range(4): new_page = copy.copy(page) if == 0: # top left new_page.mediabox.upperright = (285.5, 780) new_page.mediabox.lowerleft = (20, 570) elif == 1: # bottom left new_page.mediabox.upperright = (285.5, 400) new_page.mediabox.lowerleft = (20, 190) elif == 2: # top right new_page.mediabox.upperright = (572, 780) new_page.mediabox.lowerleft = (306.5, 570) elif == 3: # bottom right new_page.mediabox

sql - Finding the least in Count(*) -

i'm trying find lid have committed least during given time period. following table: | requestdate | bid | lid | percentagecontributed | datecomitted | 1/10/2016 | s7444319c | s2262450a | 0.25 | 18/10/2016 | 1/10/2016 | s7444319c | s4495282i | 0.25 | 7/10/2016 | 1/10/2016 | s7444319c | s4792394d | 0.25 | 28/10/2016 | 1/10/2016 | s7444319c | s7173102k | 0.25 | 9/10/2016 | 25/10/2016 | s9981233w | s2848191x | 1.00 | 13/11/2016 | 28/10/2016 | s7611209x | s2848191x | 0.33 | 13/11/2016 | 28/10/2016 | s7611209x | s4792394d | 0.33 | 4/11/2016 | 28/10/2016 | s7611209x | s7145303q | 0.33 | 5/11/2016 i have tried following code: select lid, count(*) totalnumcommitte commits datecommitted between '2015-11-03' , '2017-01-09' group lid but managed following: | lid | totalnumcommitte | s2

angular - angular2 typescript function to sort an array of objects by multiple fields -

i trying convert this function angular2/typescript in order sort array of objects multiple fields. i new typescript, can please me check it's clean? i calling prodatatemp.sort(this.utilsservice.sort_by('brand', 'name', 'model')); and in utils-service.ts: sort_by(...args: any[]) { //multiple sort https://stackoverflow.com/questions/6913512/how-to-sort-an-array-of-objects-by-multiple-fields var fields = [], n_fields = args.length, field, name, reverse, cmp; var default_cmp = function(a, b) { if (a == b) return 0; return < b ? -1 : 1; }; var getcmpfunc = function(primer, reverse) { var dfc = default_cmp, // closer in scope cmp = default_cmp; if (primer) { cmp = function(a, b) { return dfc(primer(a), primer(b)); }; } if (reverse) { re

debugging - Vim airline customise settings -

in this screenshot of vimrc settings, have installed plugin vim-airline using vundle. after going through airlines docs, found set of lines customise airline. the problem ones highlighted in red. blue highlighted 1 works fine red 1 not. left 1 same right one. tried using different unicode symbols not work. workaround situation troubling ocd :p. thanks in advance. this well-known issue related font (size , family) used in terminal. for better display, have 2 solutions: do not use arrows separators configure terminal emulator use patched font right size if prefer first solution, make sure have code in .vimrc : let g:airline_right_sep = "" let g:airline_left_sep = "" if prefer other solution, take @ this: https://github.com/powerline/fonts i have used hack font size 11 long time , arrows displayed in editor...

javascript - Regex - Match whole string -

what regular expression (in javascript if matters) match if text exact match? is, there should no characters @ other end of string. for example, if i'm trying match abc , 1abc1 , 1abc , , abc1 not match. use start , end delimiters: ^abc$

How to specify which writing object (keyboard/barcode scanner) can be used to write in textbox using C#? -

Image
my question is: how can set input "object" enabled entering text textbox? case is: i'm making program need use barcode scanner, , in 1 form in program want constraint user can write down using barcode scanner. ideas how implement that? i can see both of them device manager (1. 1 barcode scanner): a barcode scanner uses keyboard interface of computer: i.e. point of view of textbox, keyboard. if want force user use barcode scanner instead of "normal" keyboard, have somehow disable normal keyboard in situation. not know how that.

angular - ionic 2 custom directives not working in android 5 -

i have custom directive below limit number of characters in input field in ionic 2 app. see below. unfortunately works in android 4.2.2 not on android 5.1.1. can help? import { directive, input, hostlistener } '@angular/core'; /* generated class limitto directive. see https://angular.io/docs/ts/latest/api/core/index/directivemetadata-class.html more info on angular 2 directives. */ @directive({ selector: '[limit-to]' // attribute selector }) export class limitto { @input('limit-to') limitto; constructor() { } //hostlistener decorator handle event handlers input (onkeypress) @hostlistener('keypress', ['$event']) onkeypress(ev) { const limit = +this.limitto; //convert number // once reaches limit set, stop propgating event. if (ev.target.value.length === limit) { ev.preventdefault(); } } } thank you, ashley

json - Google Maps Directions API, No 'Access-Control-Allow-Origin' header is present -

if send ajax , set type json. $.ajax({ url: $url, type: "get", datatype: 'json', cache: false, success: function(response){ alert(response); } }); will have no 'access-control-allow-origin' header present on requested resource. origin ' http://127.0.0.1 ' therefore not allowed access." i have used type jsonp $.ajax({ url: $url, type: "get", datatype: 'jsonp', cache: false, success: function(response){ alert(response); } }); will have error uncaught syntaxerror: unexpected token : line 2 { "destination_addresses" : [ "3 king ling rd, tseung kwan o, hong kong" ], "origin_addresses" : [ "hong kong, kwun tong, 鴻懋工業大廈&q

Comparing 2 consecutive Rows of XML using XSLT -

hi trying compare 2 consecutive entries following xml. <wd:report_data xmlns:wd="urn:com.workday.report/test"> <wd:report_entry> <wd:location_changes> <wd:employeeid>111111</wd:employeeid> <wd:countrycode>us</wd:countrycode> <wd:regioncode>rx</wd:regioncode> <wd:startdate>2013-07-01</wd:startdate> </wd:location_changes> <wd:location_changes> <wd:employeeid>111111</wd:employeeid> <wd:countrycode>us</wd:countrycode> <wd:regioncode>md</wd:regioncode> <wd:startdate>2009-09-14</wd:startdate> </wd:location_changes> <wd:location_changes> <wd:employeeid>111111</w

javascript - Vue.js - Add Class on Click Event -

i dynamically toggle class on click event on div in vue.js without using properties/data so. here div <div class="quiz-item" @click="checkanswer(1)"> when div clicked, add class quiz-item--correct or quiz-item--incorrect (the logic handled elsewhere). cannot use properties there many answers in quiz maintainable/viable approach. does have ideas on how can achieve functionality? you can this: <div class="quiz-item" @click="$event.target.classlist.toggle('classname')"> you can check fiddle demonstrating this: here

enums - How to iterate a string literal type in typescript -

how can iterate string literal type in typescript? for example define type type name = "bill gates" | "steve jobs" | "linus torvalds"; i want iterate this for (let name of name) { console.log("possible name: " + name); } or not possible in typescript? since typescript compiler, none of typing information present in runtime. means unfortunately cannot iterate through type. depending on you're trying possible use enums store indices of names can retrieve in array.

RabbitMQ - federated queues Vs exchange federation -

i have set rabbit cluster , publish messages fanout exchange every time changes in database. i have dedicated queues bound exchange of microservices consume these updates , set dedicated queue external client can federate own rabbit infrastructure , consume copy of every message. now i'm wondering whether allowing exchange federation rather creating new dedicated queue each new external consumer better approach since more , more users come. what pros , cons? thanks as long manage permissions properly, final decision you. can give try variants first , find fit actual needs. having local queue may have pros , cons: allows end-user survive outage infrastructure or network issue @ cost of disk/memory, however, may limit queue length and/or size. i'd suggest take @ shovel plugin , dynamic shovels . local queue may server job. comparing federation, shovel simpler, e.g. doesn't sync content between upstream , downstream moves message 1 queue in reliable

c# - uri scheme property meaning -

perhaps it's not practical question still... var u1 = new uri("esnode0:9200"); var u2 = new uri("esnode1:9200"); var u3 = new uri("esnode2:9200"); var u4 = new uri("esnode3:9200"); var u5 = new uri("esnode4:9200"); var urilist = new list<uri>() { u1, u2, u3, u4, u5 }; if (urilist.select(u => u.scheme).distinct().count() > 1) throw new argumentexception("all uris should of same scheme"); in code declaring 5 uris without uri scheme. in end when try see have same uri scheme in list turns out that... well, no. scheme uri uri without port. know can fixed prepending protocol each of uris. what's reason such behavior? isn't safer set uri null in case?

Ant running from maven-antrun-plugin can't find scripting engine on Java 9 -

i have maven project using ant build file: <?xml version='1.0' encoding='utf-8'?> <project> <modelversion>4.0.0</modelversion> <artifactid>my-test-app</artifactid> <groupid>my-test-group</groupid> <version>1.0-snapshot</version> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-antrun-plugin</artifactid> <version>1.8</version> <executions> <execution> <id>compile</id> <phase>compile</phase> <configuration> <target> <ant antfile="build.xml" inheritrefs="true"> <target name="all"/> </a

javascript - jqGrid doe not render correctly in chrome -

Image
its same problem here jqgrid not render correctly in chrome/chrome frame , bu same solution not work me. have chrome 56.0.2924.87 , jqgrid version 4.7.1. the $.browser .... lines not exsist in jqgrid code anymore. how can fix problem now. (and no can not update jqgrid version). this looks like. blanked out text on table. , in firefox problem not exsist. image data rows. seen filter row still broken.

Ms Dynamics Integration with Azure Active Directory -

i using adal libs java connect ms dynamics crm in backend application. registered trial version of crm azure active direstory , got clientid , clientsecret there. can able connect crm. but question if have multiple crm account how should this.is there api register crm in azure active directory or there api using crm crendials? can please explain me. afaik, ms dynamics crm support authorization code grant flow(oauth). if developing web app, should works scenario. since every user sign-in web app , web app can delegate user integrate msdynamics. more detail authentication microsoft dynamics 365, can refer document below: connect microsoft dynamics 365 web services using oauth

Conditional References in HAPI FHIR -

hl7 fhir release 3 (stu) introduced concept of conditional references in transaction bundles: when constructing bundle, client may not know logical id of resource, may know identifying information - e.g. identifier. situation arises commonly when building transactions v2 messages. client resolve identifier logical id using search, mean resolution logical id not occur within same transaction commit (as complicating client). because of this, in transaction (and in transaction), references resources may replaced search uri describes how find correct reference: <bundle xmlns="http://hl7.org/fhir"> <id value="20160113160203" /> <type value="transaction" /> <entry> <fullurl value="urn:uuid:c72aa430-2ddc-456e-7a09-dea8264671d8" /> <resource> <observation> <subject> <reference value="patient?id

vba - Run-time error '1004': Method 'Range' of object '_worksheet' failed while merging -

Image
option explicit public sub compile_workbook_data() dim master_wkbk workbook: set master_wkbk = thisworkbook dim master_sht worksheet: set master_sht = thisworkbook.worksheets("task tracking-internal & org.") dim current_wkbk workbook dim current_sht worksheet dim wkbk_list(1 3) string dim x integer dim last_row integer dim last_col integer wkbk_list(1) = "sub project_workbook - core services.xlsm" wkbk_list(2) = "sub project_workbook - esp2.0.xlsm" wkbk_list(3) = "sub project_workbook - p2e.xlsm" x = 1 ubound(wkbk_list) set current_wkbk = workbooks.open("d:\delta dental\" & wkbk_list(x)) set current_sht = current_wkbk.worksheets("task tracking-internal & org.") last_row = current_sht.cells.find("*", searchorder:=xlbyrows, searchdirection:=xlprevious).row last_col = current_sht.cells.find("*", searchorder:=xlbycolumns, searchdirection:=xlprevious).column

java - Spontaneous up spring boot context in test -

i have issue spring-boot-test during deep dive in spring testcontext configuration. example project: github example project i have 3 spring configurations beans ( config1 - heavyweight config, , need cache it) i use @contexthierarchy separate configs in context, , expect config1 loaded once. (used @contexthierarchy because did not find analogue in spring-boot-test) full code: @contexthierarchy({ @contextconfiguration(classes = {config1.class}), @contextconfiguration(classes = {config2.class}), }) if run test, config1 cached! however, see following: started configtest1 two times and started configtest2 only once. in opinion, possible because configtest1 cached testcontext (it happens, because configtest1 , configtest2 contained in same package) that means spring boot spring context 3 times! why? see spring boot logo 3 times in log: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| |

arduino - efficient prepending to array -

i porting 1 of known libraries arduino called i2cdevlib embedded system. , meet problem, time far being first one, when function interface looks like: void function(uint8_t dev_addr, uint8_t reg_addr, uint8_t *data, uint8_t len); and need firstly write dev_addr i2c bus reg_addr , data . i2c driver(i use 1 keil mdk packs) function used send data i2c bus has definition this: void send_i2c(uint8_t dev_addr, uint8_t *data, uint8_t len); and because of i2c properties can not call sequentially. every time when function called have create new array, set first item reg_addr , memcpy data looks awful , seems not efficient(to honest there little data flow when working these sensors nevertheless...). can not see solution except modifying i2c driver or writing new 1 don't feel rewriting sustainable , tested driver because of 1 function. so there way improve solution without doing this? the problem how i2cdevlib implemented. should not force user specify register a

css - In an SVG, can I right align text with a leading shape/icon -

Image
i'd right align text in svg, using text-anchor="end" , have leading icon/shape. this: the issues "morgs32" in case variable field. need able change it. can't export text path outlines. from digging around several hours, not sure it's feasible. love wrong, though.

My application dll's are not properly loaded when launching application through Python Script -

i have used below script launch application. import subprocess subprocess.call('c:\program files (x86)\terrain\track3d\track™.exe') i able launch application few dll's of application not loaded. application launches when launched manually. there many errors displayed out of few : 1) failed load type modules schedulescontroller. error was: not load file or assembly 'schedules.dll' or 1 of dependancies. system cannot find file specified. system.io.file not found exception. 2) error window has title "microsoft.practices.prism.moduletypeloadingexception" could give me solution problem ? a trait of python on windows forward slashes in paths need escaped, , directory or file names containing spaces need enclosed in quotes. further, have unicode (tm) @ end of filename. import subprocess subprocess.call('c:\\"program files (x86)"\\terrain\\track3d\\r"track™.exe"') the 3 changes made are: pytho

php - Wordpress query to only include posts that have certain content -

i query show posts if contains , text comes geodir_special_offers echo <?php global $post; $args = array( 'posts_per_page' => 4 , 'post_type' => 'gd_arts',); $lastposts = get_posts( $args ); foreach ( $lastposts $post ) : setup_postdata( $post ); ?> <h2><a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a></h2> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(array(486,226)); } ?> <php echo $post->geodir_special_offers; ?> <?php endforeach; wp_reset_postdata(); ?> i quite new wp queries bare me. sorry in advance if not structured 100%. cheers shaun try this!it checks if special offers set before echoing out content. hope that's looking for. <?php global $post; $args = array( 'posts_per_page' => 4 , 'post_type' => 'gd_arts',); $lastposts = get_posts( $args ); foreach

C++ class template for automatic getter-setter methods - good/bad practice? -

is practice use template class objects implicit getters , setters attributes in (nearly) pod classes? consider following template example: template<typename t> class attribute { protected: t m_val; public: t * getaddress() { return &m_val; } t get() { return m_val; } void set(t v) { m_val = v; } }; and usage: class { public: attribute<float> floatattr; attribute<int> intattr; attribute<long> longattr; }; with possible have encapsulated data less implementation overhead. is bad or practice (and why)? edit: state advantages see in this. there no need implement every getter setter function hand, there still usual advantages of these functions: the data encapsulated , client needs use getter setter functions, still can implemented in different way later on. the internal usage still hidden , can changed. getter , setter functions can passed around lambda functions. in other other languages, getters , se

How to connect MS Teams with Bonobo Git Server? -

our team using ms teams since couple of weeks. see few connectors repositories new ms slack, there nothing connect our bonobo git server any 1 knows way connect repositorie bonobo ms teams? read ms bot framework, i'm not sure how used in case. thanks in advance!

compression - recipe for working with compressed (any)dbm files in python -

i have big-ol' dbm file, that's being created , used python program. saves amount of ram, it's getting big, , suspect i'll have gzip lower footprint. i guess usage involve un-gzipping disk, using it, , erasing extracted dbm when i'm done. i wondering whether there perhaps exists nice way of compressing dbm , keep working somehow. in spcific usecase, need read it. thanks. you can gzip value or use key/value store support compression wiredtiger.

Handling multilingual documentation (for multiple apps) -

we have (web)apps used in multiple countries , therefore apps/documentation translated languages being used. we're starting have problems keeping documentation date in languages. normal scenario: change made in app changes made eng documentation same changes language-specific screenshots should done other languages (and different people responsible of different translations) we never seem in status, our documentation date. currently our documentation handled powerpoints (i know!!!). find better solution. have tested atlassians confluence, not seem meet our need in multilingual-part. we should able that: this english documentation then should able that: a missing norwegian documentation a's norwegian documentation has not been updated, though english on has changes. english master , should have date documentation in - if missing part b norwegian, english shown. i rid of old powerpoints (which have thousands of pages , versions)... :) think i&#

facebook graph api - FB SDK produces a PHP Fatal error -

this question has answer here: facebook graph api not work 2.2 2.3 1 answer fb sdk produces php fatal error 3 answers starting now, fb sdk integration worked allowing people login our site via facebook account stopped working. server logs show following error php fatal error: cannot use object of type stdclass array in fb-sdk/facebookredirectloginhelper.php on line 191 we have not done relevant code change should have initiated it. have missed upgrade? replace "$response['access_token']" "$response->access_token" on line 186 , 187 in facebookredirectloginhelper.php

ffimageloading - Organize layout xamarin -

i have following command in layout , want organize layout textview category stays on ffimageloading <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_weight="1" android:layout_gravity="center" android:gravity="center" android:background="#000000" android:id="@+id/l_imgf1f2"> <linearlayout android:layout_width="0dip" android:layout_height="125dp" android:orientation="vertical" android:gravity="bottom" android:layout_weight="1" android:id="@+id/imgf1" android:layout_marginright="2dp"> <ffimageloading.vie

cmd - Delete the oldest file from the files in the folder and subfolders -

setlocal set folder=c:\test\ set filemask=*.* set oldestfile= /f "delims=" %%a in ('dir /b /o:d "%folder%\%filemask%" 2^>nul') ( set oldestfile=%%a goto break ) :break if "%oldestfile%"=="" ( echo no files found in '%folder%' matching '%filemask%'! ) else ( echo del "%folder%\%oldestfile%" ) pause here delete oldest file (the file in folder or directory in folder). how delete oldest file files in folder , subfolders? necessary subfolders checked. @echo off setlocal enableextensions disabledelayedexpansion set "folder=c:\test\" set "filemask=*.*" set "oldestfile=" %%f in ("%folder%\.") /f "tokens=2,*" %%a in (' robocopy "%%~ff" "%%~ff" %filemask% /njh /njs /nc /ns /l /is /ndl /ts /s ^| 2^>nul sort ^| find ":" ') set "oldestfile=%%b&q

asp.net - Trimming Strings within C# .Net application -

new enough c#. just can't head around trimming string. want able trim whitespace after string messing database amount of whitespace get. here's 1 of entities i'd in. [regularexpression(@"^[a-za-z0-9 ]+$", errormessage = "use letters , numbers please")] [display(name = "serial number ")] public string serialno { { try { string serialnumber = serialno.trim(); return serialnumber; } catch (exception e) { console.writeline(e); return serialno; } } set { this.serialno = serialno; } } i don't know if i'm going wrong appreciated! edit: error "an unhandled exception of type 'system.stackoverflowexception' occurred in photocopierinformationmanagementservices.dll" the following end in stackoverflow excption keep executing infinitely, set block getting called again , due this.serial

javascript - Appending json file in html -

i have json file ticket.json "{\"item1\":[{\"id\":2,\"title\":\"support\",\"totalunresolveditems\":14},{\"id\":8,\"title\":\"helpdesk\",\"totalunresolveditems\":1},{\"id\":7,\"title\":\"hostmaster\",\"totalunresolveditems\":1},{\"id\":4,\"title\":\"salg\",\"totalunresolveditems\":1}],\"item2\":[{\"id\":8,\"fullname\":\"person 1\",\"totalunresolveditems\":5},{\"id\":3,\"fullname\":\"person 2\",\"totalunresolveditems\":4},{\"id\":11,\"fullname\":\"person 3\",\"totalunresolveditems\":3},{\"id\":14,\"fullname\":\"person 4\",\"totalunresolveditems\":1},{\"id\":12,\"fullname\":\"person 5\",\"totalunresolveditems\

configuration - What is the max size of a single POST variable in PHP? -

is there way in php set max size of single post variable (not whole post size post_max_size )? edit: looking way limit size of single post param, not whole post. seems can't in php , have use post_max_size (therefore set limit of whole post). you need change php.ini file post_max_size = 16m upload_max_filesize = 16m memory_limit = 128m change these value in php.ini if you've access it, otherwise can try change them in .htaccess file. php_value upload_max_filesize 16m php_value post_max_size 16m this work if allowoverride settings permit it. otherwise, you've ask hosting company.

node.js - Which from these approaches is better while using Socket IO, Node and Redis for production? -

i want know best approach production. 1 create redis client each socket connected socket io in node backend. example: io.on('connection', function (socket) { var redis = redis.createclient(); redis.on("message", function(channel, data) { //emit sockets, emit socket or broadcast } } 2. create 1 redis client , store in hashmap (nodejs/js object) connected sockets , when receive redis event emit sockets want (you may use whatever filtering logic want on users array). example: var redis = redis.createclient(); redis.subscribe('some-channel'); redis.on("message", function(channel, data) { (var = 0; < users.length; i++) { io.to(users.socketid).emit("your-event", "your-data"); } } io.on('connection', function (socket) { users.push({ socketid: socket.id }); } in first approach worried about the performance,

Ellipses under new keyword in c#? -

Image
why there ellipses underneath new keyword. cant find article on internet. there multiple instances have used new keyword in same method. normal except one. edit - using visual studio 2017 community edition. developing uwp. code runs fine , not shown error. pressing ctrl+. gives nothing. i guess it's telling you can use object initializer . if have code like folderpicker pickfolder = new folderpicker(); folderpicker.suggestedstartlocation = pickerlocationid.desktop; folderpicker.commitbuttontext = "take it!"; visual studio recommends use this folderpicker pickfolder = new folderpicker { suggestedstartlocation = pickerlocationid.desktop, commitbuttontext = "take it!" }; instead.

ImageResizer Watermark not appearing -

i have azure function attempting add watermark existing image using imageresizer version 3.4.3. function executes without error, watermark not applied. here code, following along here : private static void applywatermark(stream inputstream, string blobname) { var imageconfiguration = config.current; var plugin = imageconfiguration.plugins.get<watermarkplugin>(); if (plugin == null) { plugin = new watermarkplugin(); plugin.install(imageconfiguration); } plugin = imageconfiguration.plugins.get<watermarkplugin>(); var imagelayer = new imagelayer(imageconfiguration) { path = hostingenvironment.mappath(_configuration.get<string>("badgeurl")), align = contentalignment.middlecenter }; plugin.namedwatermarks["badge"] = new layer[] { imagelayer }; inputstream.position = 0; var outputstream = new memorystream(); imageconfiguration.currentimagebuilder.b

Cannot open IE through selenium -

i trying run automation script in ie , have downloaded ie driver , giving in path reason not opening , getting error org.openqa.selenium.sessionnotcreatedexception: unable create new remote session i setting path via batch file java -jar selenium-server-standalone-2.53.1.jar -dwebdriver.chrome.driver="chromedriver.exe" -dwebdriver.ie.driver="iedriverserver.exe" here code creating iedriverinstance else if (automationconstants.browser_type.equalsignorecase("ie")) { browser ie = new iebrowser(); system.out.println(ie); try { webdriver = new remotewebdriver(new url(seleniumproperties.gethost()), ie.getcapabilities()); } catch (malformedurlexception mue) { logger.error(mue); } } private static final string name = "ie"; private static desiredcapabilities capabilities; static { capabilities = new desiredcapabilities(); capabilities = desiredcapabilities.internetexplor

Sort and Remove unused usings in C# code -

is there way sort , remove unused usings in c# in visual studio 2015 , 2017? if not, addition future visual studio code version? there command built vscode out removing unused usings. the default keybinding defined as: { "key": "ctrl+.", "command": "editor.action.quickfix", "when": "editorhascodeactionsprovider && editortextfocus && !editorreadonly" }, as sorting usings: did not find built explicitly using statements, there command sort lines. add similar following keybindings file: { "key": "ctrl+q", "command": "editor.action.sortlinesascending", "when": "editorfocus && !editorreadonly" }, then, select using statements , press ctrl+q sort them.

vba - Pivot Report Filter - if only one value avaliable select else ALL -

Image
requesting working on macro based pivot table have 5 columns in report filter. looking vba code these 5 filer, should show value if filter contains single value else should remain (all). currently using following code pivot filer: sub insertpivottable() 'declare variables dim psheet worksheet dim dsheet worksheet dim pcache pivotcache dim ptable pivottable dim prange range dim lastrow long dim lastcol long 'delete preivous pivot table worksheet & insert new blank worksheet same name on error resume next application.displayalerts = false worksheets("pivot").delete sheets.add before:=activesheet activesheet.name = "pivot" application.displayalerts = true set psheet = worksheets("pivot") set dsheet = worksheets("report") 'define data range lastrow = dsheet.cells(rows.count, 1).end(xlup).row lastcol = dsheet.cells(1, columns.count).end(xltoleft).column set prange = dsheet.cells(1, 1).resize(lastrow, lastcol) 'defi

unit testing - Typed racket error with check-random -

i'm trying convert project on typed racket racket , i'm encountering errors working code because of testing engine. i've reduced smallest piece of code can create reproduces problem: #lang typed/racket ; provides check-expect , others testing (require typed/test-engine/racket-tests) (: bar (-> positive-integer integer)) (check-random (bar 6) (random 6)) (define (bar x) (random x)) (test) and errors are: . type checker: type mismatch expected: pseudo-random-generator given: in: (check-random (bar 6) (random 6)) . type checker: type mismatch expected: positive-integer given: in: (check-random (bar 6) (random 6)) . type checker: summary: 3 errors encountered in: (check-random (bar 6) (random 6)) (check-random (bar 6) (random 6)) (check-random (bar 6) (random 6)) does have advice on how fix this? want able use type checking features if possible. thanks sure, can help, depends lot on want, , you're going this. short overvi

javascript - Jquery form element access -

i'm new jquery , trying following: i have form: <form method="post" class="add-product" > ... <label name="message"></label> ... </form> and script: $(document).ready(function() { $(".add-product").submit(function(e) { e.preventdefault(); var form = this; $.ajax({ type: "post", url: "/product/add/", data: $(this).serialize(), success: function(data) { $(form.elements["message"]).html(data.message); } }); }); }); i'm trying update label message, doesn't work. seems have mistake in syntax: $(form.elements["message"]).html(data.message); the issue because label not appear in form.elements collection. instead need select directly: $(".add-product").submit(function(e) { e.preventdefault(); var form = this; // inside ajax callback... var data = { m

Infopath 2013 Buttons -

we have developed form being used via sharepoint 2013. audience able click on list item open infopath form , when in infopath form, press on created buttons load different views of form , hide/show sections....without being in edit mode. the premise being end user has interactive form quick , easy use upon loading. is there way user can activate rules applied buttons in read mode or edit mode have activated first? many in advance hints or tips! well technically can create read-only form making pages read-only in settings , use data connections pull data form fields want. so make landing page buttons change view, run query , set fields values want display each read-only page/view.

Wix Project not available in VS 2017 -

i've installed wix toolset visual studio 2017 extension still cannot find wix in other project types. there else need do? probably version have installed not supported 2017. try this one .

IBM MobileFirst Platform is not triggering Remote disable message on iOS for Hybrid app -

we have hybrid application doesn't show remote disable message once change state "active" "access disabled" though app getting disabled can't use anymore. worklight.properties: wl.remotedisable.cache.enabled=true wl.remotedisable.cache.refreshintervalinseconds=1 initoption.js (i have added console.log see error in between): onerrorremotedisabledenial : function (message, downloadlink) { console.log("onerrorremotedisabledenial ......... triggered"); wl.simpledialog.show( appstoreupdatetitle, message, [{text: notnowbutton, handler: function() {wl.app.close();}}, {text: downloadnewversionbtn, handler: function() {wl.app.openurl(downloadlink, "_blank");}}] ); console.log("onerrorremotedisabledenial ......... endded"); }, console.log (from xcode): 2017-03-28 10:51:57.312 grsmobile[73