Posts

Showing posts from April, 2011

excel - Issue in Running imported Macros in VBA -

i want import macro files specified location in workbooks in specified folders , want run macros on each workbook, able import in workbooks through code mentioned below can not able run macros. sub recursivefolders() dim filesys object dim objfolder object dim objsubfolder object dim objfile1 scripting.file dim wkbopen workbook dim szimportpath string dim objfso scripting.filesystemobject dim cmpcomponents vbide.vbcomponents set objfso = new scripting.filesystemobject set filesys = createobject("scripting.filesystemobject") set objfolder = filesys.getfolder("c:\users\yashika vaish\desktop\testform") application.screenupdating = false each objsubfolder in objfolder.subfolders each objfile in objsubfolder.files set wkbopen = workbooks.open(filename:=objfile) szimportpath = folderwithvbaprojectfiles & "c:\macros" set cmpcomponents = wkbopen.vbproject.

javascript - jest mock for multiple cases -

// file.js import fun1 ‘package1/src’ if (fun1) { return “hello world”; } else { return “good bye” } i want cover branch file.js in test file // file-test.js describe(‘test fun1’, () => { it(’should return hello world when fun1 true’, async() => { expect blabla }); it(’should return bye when fun1 false’, async() => { expect blabla }); }); in case, how jest mock fun1 in file-test? thank much!

c# - WPF- Combobox Binding -

i have class named "employee": public string forname { get; set; } public string lastname { get; set; } public employeegroup group { get; set; } a class "employeegroup": public string groupname { get; set; } public short groupid { get; set; } and wpf: <combobox x:name="cmbgroup" selecteditem="{binding group}" horizontalalignment="left" margin="342,226,0,0" verticalalignment="top" width="129"/> <textbox x:name="txtforename" text="{binding forname}" horizontalalignment="left" height="24" margin="342,21,0,0" textwrapping="wrap" verticalalignment="top" width="129" verticalcontentalignment="center" gotfocus="selecttext"/> <textbox x:name="txtlastname" text="{binding lastname}" horizontalalignment="left" height="24" margin="342,47,0,0" t

How to add jquery-ui css/images with webpack -

i using jquery-ui webpack have problems regarding how load bundled css , images node_modules folder. i have own scss files need load jquery-ui css. acomplish added following webpack config rules. { test: /\.scss$/, include: [ path.resolve(__dirname, "client/css/scss"), ], use: [{ loader: "style-loader" // creates style nodes js strings }, { loader: "css-loader" // translates css commonjs }, { loader: "sass-loader" // compiles sass css }] }, { test: /all\.css$/, include: [ path.resolve(__dirname, "node_modules/jquery-ui/themes/base"), ], use: [{ loader: "style-loader" // creates style nodes js strings }, { loader: "css-loader" // translates css commonjs }] } note versions: "jquery": "3.2.1", "jquery-ui": "1.12.1", next in js entry file: require("../css

ubuntu 14.04 - Why might a virtual link work, but the actual folder not work? (Linux and Vagrant) -

this @ least me mysterious mystery. i running vagrant box running ubuntu 14 linux, , standard lamp stack. there no .htaccess file. if have folder /library/css , call page of type in net::err_empty_response . but , if rename folder css-actual , do: ln -s css-actual css # symbolic link everything works. behavior baffling, ideas? it's there's "something" saying "hey, won't serve content folder named /library/css, i'll serve through symlink." never experienced before.

html - Repeat thead on each page generating pdf using iTextSharp -

Image
generating html pdf using itextsharp library. scenario different have here 1 tr in repeating number of div after conversion overlapped. sharing images/code clarify. <html> <head> <style> body { margin: 0; } table { width: 100%; border-spacing: 0; border-collapse: collapse; text-align: center; } thead.t1 { background: #dac8c8; } table td, table th { padding: 10px; } table { margin-top: 20px; } @media print { @page { size: a4 landscape; } } thead { display: table-header-group } table { -fs-table-paginate: paginate; } @media print { thead { display: table-header-group; } } .div-tr>div { width: 200px; display: table-cell; vertical-align: inherit; padding:

Tibco SPOTFIRE 7.5 Data Connector witn Custom query and fields prompted -

someone have used data connector custom queries , definition of prompt? i have data connector custom query on oracle db view around 30 mln of record. we have defined set of prompts on data connection around 5 fields, filter rows when use analyst. the issue when open data connector, analyst spent more time pass prompt if query underlying spent few seconds retrive list of value visualize in single selection prompt. someone can me?

ftp - How to use SFTP in PHP -

a quick question, im using line scan file in other site "$sfs = scandir('ftp://'" wondering if site using sftp - ssh, should still use command below instead of ftp i'll use sftp? "$sfs = scandir('sftp://'"" i appreciate answer. thanks! sftp has complete guide @ page . you should make connection first , can tansfer files. (copy stream variable in example below @ own direction. create new file fopen , print $stream in new file) example php.net: <?php $connection = ssh2_connect('shell.example.com', 22); ssh2_auth_password($connection, 'username', 'password'); $sftp = ssh2_sftp($connection); $stream = fopen("ssh2.sftp://$sftp/path/to/file", 'r'); ?>

user interface - how to enable/disable multiple TextInput on focusing in kivy in python -

Image
i'm trying enable/disable textinput in kivy. multiple textinput there. (1) when click on textinput, particular textinput editable. (2) default set on disable mode. (3) scrollbar should there, suppose there hundreds of inputs there.(i unable bring that). (4) 1 more problem facing is: text of textinput not visible when there hundreds of inputs. there option set default size not affect whether there 2-3 inputs or 100s of inputs. (5) values @ textinput , label should dynamic, should stored @ variable globally. @palimpalim helped me existing code. thank everyone. from kivy.app import app kivy.uix.tabbedpanel import tabbedpanel kivy.uix.boxlayout import boxlayout kivy.properties import stringproperty kivy.uix.textinput import textinput kivy.lang import builder kivy.uix.scrollview import scrollview kivy.properties import stringproperty rows = ['ac', 'asd', 'kjhgf', 'b' ,'bn', 'sdf', 'ytrwd', 'hfs' ,'erf', ...]

java - Mahout: Training of generated vector is throwing exception -

i having mahout 0.13.0 job running on hadoop 2.7.3(using aws). when trying train generated vector, throwing below exception: container killed applicationmaster. container killed on request. exit code 143 container exited non-zero exit code 143 17/07/25 10:21:39 info job: task id : attempt_1500972617227_0091_m_000008_2, status : failed error: java.lang.illegalargumentexception: wrong numlabels: 0. must > 0! @ com.google.common.base.preconditions.checkargument(preconditions.java:88) @ org.apache.mahout.classifier.naivebayes.training.weightsmapper.setup(weightsmapper.java:44) @ org.apache.hadoop.mapreduce.mapper.run(mapper.java:143) @ org.apache.hadoop.mapred.maptask.runnewmapper(maptask.java:796) @ org.apache.hadoop.mapred.maptask.run(maptask.java:342) @ org.apache.hadoop.mapred.yarnchild$2.run(yarnchild.java:164) @ java.security.accesscontroller.doprivileged(native method) @ javax.security.auth.subject.doas(subject.java:422) @ org.apache.had

javascript - Returns the wrong character in SubString method -

i new js, have tried below code, var str = "\">2\"" var res = str.substring(2,1); return: > expected: 2 i have checked below code, var str = "\">2\"" var res = str.substring(2); return: "2\" expected: "2\" please let me know if misunderstand anything, why returns > instead of 2 . in c# works correctly. thanks in advance actually doing incorrect in case 1 when str.substring(2,1); that means str.substring(1,2); from docs if indexstart greater indexend, effect of substring() if 2 arguments swapped; example, str.substring(1, 0) == str.substring(0, 1). since char @ 1,2 > , getting same. however when str.substring(2); it equals str.substring(2, str.length-1); if indexend omitted, substring() extracts characters end of string.

Java array with around 20000 values declaration -

i encounter issue java array around 20000 values, full array can found here my code: public class usableids { private final static int idsarray[] = {615,616,617,618,...}; private final static int ids = idsarray.length; public static string checkid(int x){ for(int i=0;i<ids;i++){ if(x==idsarray[i]) return "usable"; } return "notusable"; } } in other method try call with: string temp = usableids.checkid( xyz ); here @ point program crash crash i use netbeans. i'll happy if can me piece of code running. you seeing error because java limits size of static initializer blocks 65535 bytes. best separate data source code, i.e. put ids separate file. the below code equivalent yours, assuming data within array stored (comma-separated, without brackets or line breaks) /temp/usableids.txt . import java.nio.file.files; import java.nio.file.paths; public class usableids

php - Check if value if exists and return the object in multidimensional array -

i need check if value exists in array , once exists need object. array ( [0] => array ( [_id] => array ( [purok] => test [year] => 2017 [options] => below-1 ) [data] => array ( [58cf4935572d6e32900057ab] => array ( [age-sex-distribution] => array ( [age-range] => array ( [options] => below-1 ) [gender] => array ( [male-distribution-count] => 12 [female-distribution-count] => 12

html lists - How to make ul li more responsive -

i have converted table ul , li lists , trying make responsive design. unable do. here code: <div class="panel-body"> <ul id="category" class="col-md-12"> <li id="" class="result-title col-md-12"> <div class="col-md-3">subject</div> <div class="col-md-3">chapter</div> <div class="col-md-3">date&amp;time</div> <div class="col-md-3">action item</div> </li> <li id="results" class="results col-md-12"> <ul id="inner-category" class="col-md-12"> <li class="col-md-12"><div class="col-md-3">math</div>

java - Android webview whitescreen -

i looked many times , changed code should work (e.g. verified answer on stackoverflow), still doesn't work , don't know why. so created webview , want display page. tried google.com, white space on window webview lays (no errors, unclickable white space) here's code: main activity: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); /*webview wv = (webview) findviewbyid(r.id.webview); wv.setwebviewclient(new mybrowser()); wv.loadurl("http:\\www.google.com"); */ drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); actionbardrawertoggle toggle = new actionbardrawertoggle( this, drawer, toolbar, r.string.navigation_drawer_open, r.string.navigation_drawer_close); drawer.setdra

How to replace Invoke-RestMethod into PowerShell 2.0 -

i have created script in powershell 5.1 retrieves mail messages not older 1 day 'report' subject , save attachments local drive. problem in production environment have powershell 2.0. using invoke-restmethod in code this: $url = "https://outlook.office365.com/api/v1.0/me/messages" $date = (get-date).adddays(-1).tostring("yyyy-mm-dd") $subject = "'report'" $messagequery = "" + $url + "?`$select=id&`$filter=hasattachments eq true , datetimereceived ge " + $date + " , subject eq " + $subject $messages = invoke-restmethod $messagequery -credential $cred foreach ($message in $messages.value) { $query = $url + "/" + $message.id + "/attachments" $attachments = invoke-restmethod $query -credential $cred foreach ($attachment in $attachments.value) { $attachment.name # save attachment code here } } is there simple way convert code in order sui

javascript - Dynamic properties has not effect in my Angular Directive -

i'm coding custom directives , necessary have custom properties setted directive. i've done that, dynamic properties not make effect. i'm testing angular ui-mask . when put ui-mask directly on html template works, when cames mdiattrs directive don't. , worst thing is: same on chrome inspector. i've tried use $scope.$apply() , doesn't work too. dynamic properties directive app.directive('mdiattrs', function() { return { restrict: 'a', replace: true, link: (scope, elem) => { let attrs = scope.mdicustomproperties || {}; object.keys(attrs).foreach(attrkey => elem.attr(attrkey, attrs[attrkey])); } }; }); my input directive app.directive('mdiinput', () => { return { restrict: 'e', replace: true, templateurl: 'templates/mdi-input.html', scope: (() => { const inputscope = angular.copy(directi

php - How to ignore only warnings with a specific message? -

as workaround another issue set error handler only specific warning. should check whether warning starts string, , if not should hand warning on original handler. what i've got far: function filesize_for_url_ignoring_error_handler($severity, $message, $file, $line, $context) { if (strpos($message, 'warning: filesize(): stat failed https://') === 0) { return; } restore_error_handler(); throw new errorexception($message, e_warning, $severity, $file, $line); } set_error_handler('filesize_for_url_ignoring_error_handler', e_warning); $file = file_save($file); restore_error_handler(); however, there seems several problems: i can't override error handler single error type. i've tried passing e_error , ~e_warning , e_all , 0 error type set_error_handler , seems setting error handler given type removes error handlers other types. correct? can work around setting error handler error types. i don't know how handle warnin

security - How to set different CookiePath for each area in ASP.NET MVC -

as security guidelines recommends cookiepath must changed default value '/' specific folder of application, cause problem when use area concept of asp.net mvc, how can set different cookiepath each area. ps. use asp.net identity membership check this: public class homecontroller : controller { public actionresult index() { controllercontext.httpcontext.response.cookies.add( new httpcookie("test", "hello") { path = @"/admin", expires = datetime.now.adddays(1)}); return redirecttoaction("about", "admin"); } } public class admincontroller : controller { public actionresult about() { var cookiecount = httpcontext.request.cookies.count; return view(); } } hope helpful :)

c++ - On the implementation of atomic_exchange_strong_explicit for shared_ptr -

please see this link: template<typename _tp> bool atomic_compare_exchange_strong_explicit(shared_ptr<_tp>* __p, shared_ptr<_tp>* __v, shared_ptr<_tp> __w, memory_order, memory_order) { shared_ptr<_tp> __x; // goes out of scope after __lock _sp_locker __lock{__p, __v}; owner_less<shared_ptr<_tp>> __less; if (*__p == *__v && !__less(*__p, *__v) && !__less(*__v, *__p)) { __x = std::move(*__p); *__p = std::move(__w); return true; } __x = std::move(*__v); *__v = *__p; return false; } to me looks *__p == *__v , !__less(*__p, *__v) && !__less(*__v, *__p) both state fact pointers *__p , *__v equal. why both used there? thanks. as touched on by great answer need both su

FocusChange is not Triggered in Xamarin Android 2.3.7 -

the environment android 2.3.7. the focuschange listener triggered when focus switches between 2 edittexts. however, if user switches edittext ui element button callback method never called. particular issue isn't seen in newer versions of android. leads me believe might issue android 2.3.7. if known issue, there known workaround?

git - How can I check a remote's HEAD of a different branch from a shallow clone? -

i changed way servers clone shallow, speed deployment: git clone -b $branch --depth 1 git@github.com:initech/rounding.git . the problem is, update mechanism following: local=$(git rev-parse head) remote=$(git rev-parse origin/$newbranch) if [ $local = $remote ]; echo "up-to-date" else blah... fi previously fine, fatal: needed single revision , because git not know existence of other branches. how can pull in information branch want switch to, , check head commit on origin without checking out (since want leave checkout - it's running server)? you cannot directly: information not there. if can consult another, more-complete git repository, can find answer there. precise mechanism (obviously) depend on how go reaching , talking other, more-complete git repository—but there built-in mechanism: git ls-remote . run git ls-remote manually, in 1 of own repositories, see in action. note calls remote (usually origin you can choose remote; s

ex - Differences in running vim via command line vs. running it in the vim editor -

i trying process series of files. have noticed there discrepancies in running particular command command line (i.e. ex mode). e.g. $cat poo.txt big red dog small black cat $vim -c "2,$g/^dog/d|wq" poo.txt $cat poo.txt big small black cat it appears 2,$g/^dog/d|wq has deleted lines red , dog . confuses me because command should : start on line 2 (going eof) , delete lines beginning dog . in instance, i'd expect output be: $ cat poo.txt big red small black cat in fact, if try in vim editor exact behavior observed. question: cause of discrepancy between vim -c version , vim version of running command? i think need replace double quotes single quotes prevent shell expanding $g . man bash : enclosing characters in double quotes preserves literal value of characters within quotes, exception of $, `, \, and, when history expansion enabled, !. currently, shell expands $g inside string, if environment variable. it's not defined, e

php - populate select in Laravel form with value from model -

i made form select. here code: {!! form::model($customeraccount, ['route' => ['admin.customeraccount.update', $customeraccount->id_customer_account], 'method' => 'put', 'class' => 'form-horizontal']) !!} ... <div class="@if ($errors->has('cacct_active'))has-error has-feedback @endif form-group"> {!! form::label('cacct_active', 'status: *',['class' => 'col-md-4 control-label']) !!} <div class="col-md-8"> {!! form::select('cacct_active',$customeraccount->getstatuslist(),null,['class'=> 'form-control', 'required' => 'required', 'autofocus' => 'none']) !!} </div> </div> i have options loaded $customeraccount->getstatuslist() , want default selected option value object. not happen, selected first 1 options. edit

How Sort data from database in php when using while in php -

i want sort date, time database new old ( high low ) , use code didn't work! can me? , want mysqli solution , uses while because don't know how many numbers of information receive database! $sql = "select * orders seller='$id' order dtime asc"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $ordernumber = $row['ordernumber']; echo "<ul> <li> $ordernumber</li></ul>"; } } if want more details ordering click here . in code, should write below, $sql = "select * orders seller='$id' order dtime desc"; and please search ordering doubt. thanks..!!

Delphi - connecting similar procedures -

i working on 1 little bit complex application , have found 1 problem. going try reduce complexity of application 1 simple application, example. point is, have 16 regions , there variables , procedures each 1 of them. each procedure have universal each region. resolve writing 1 "if" on beginning of procedure , them copy 15 times bellow , changing little bit, because each region makes difference in few words. have change word in each 1 of them. makes code sooo unclear , wasting of time. there way, how write 16 "ifs" one? using template or that? example application: key code: procedure tform1.writeitem; var item:integer; begin if currentfile='firstfile' begin seek(firstfile,filesize(firstfile)-1); read(firstfile,item); inc(item); write(firstfile,item); end; if currentfile='secondfile' begin seek(secondfile,filesize(secondfile)-1); read(secondfile,item); inc(item); write(secondfile,item); end; end; ful

ios - check the segue used to open viewController in the viewController itself -

having methods: //metodo che verifica se proveniamo dal profile controller o da un altro controller override func prepare(for segue: uistoryboardsegue, sender: any?) { if segue.identifier == "accountsegue" { self.disattivatutorialbtn.ishidden=true indietrobtn.ishidden=false }else{ self.indietrobtn.ishidden=true self.disattivatutorialbtn.ishidden=false } } i perform different actions basing on segue's identifier. of course, method isn't called anywhere (i understood is): how can call it? seems stupid calling "self" method in "viewdidload" doesn't work. to instead of performing segue on button click in storyboard, create segue viewcontroller other view controller. when want go next view controller call below button click or other action event. self.performsegue(withidentifier: "accountsegue", sender: self) this automatically call prepareforsegue method , if statement ex

javascript - How to extend moment js? -

i'd extend moment.js , override it's tojson function. const moment = require('moment'); class m2 extends moment { constructor(data) { super(data); this.tojson = function () { return 'str'; }; } } const json = { date: moment(), }; const json2 = { date: new m2(), }; console.log(json.stringify(json)); // {"date":"2017-07-25t13:36:47.023z"} console.log(json.stringify(json2)); // {"date":"str"} my problem that, in case can not call m2() without new : const json3 = { date: m2(), // typeerror: class constructor m2 cannot invoked without 'new' }; how can extend moment while keeping ability call without new keyword? override moment.prototype.tojson not option, because i'd use default moment object elsewhere in code. do need extend moment class @ all? set replace tojson function factory function. function m2(data) { const or

c# - The given key was not present in the dictionary. in Razorview -

Image
i have error the given key not present in dictionary. in razor view please check below code <select class="form-control" name="country" id="country"> <option value="">select country</option> @foreach (var country in viewbag.countrylist) { <option @((country.countrycode == "gb") ? "selected" : "") value="@country.countrycode">@country.countryname</option> } </select> my country model class public class country { public long countryid { get; set; } public string countrycode { get; set; } public string countryname { get; set; } } for viewbar.countrylist add this list<country> countrylist = common.getcountry(); viewbag.countrylist = jsonconvert.serializeobject(countrylist); please check in below image got data in variable error above. list<airport> airportcodelist = common.getairport(); viewbag.ai

javascript - Kendo-UI Changing the labels of x-axis in a scatter line chart -

i'm trying have custom x axis labels kendo chart ui can't replace labels. tried find solution failed. is possible ? this html code : <kendo-chart [resizeratelimit]="0.5"> <kendo-chart-title text="title"></kendo-chart-title> <kendo-chart-value-axis> <kendo-chart-value-axis-item [min]="minaxis" [max]="maxaxis"></kendo-chart-value-axis-item> </kendo-chart-value-axis> <kendo-chart-axis-defaults [line]="{ color: 'red' }" [majorgridlines]="{ visible : false}" > <kendo-chart-axis-defaults-labels font="12pt sans-serif"></kendo-chart-axis-defaults-labels> </kendo-chart-axis-defaults> <kendo-chart-x-axis> <kendo-chart-x-axis-item > <kendo-chart-x-axis-item-labels [visible]="true"></kendo-chart-x-axis-item-labels> </kendo-chart-

php - getting an Undefined index: id in submitting a form -

i got error yesterday , thought fixed it. submitting update form. @extends('layouts.master') @section('content') <form action="{{url('/student/update')}}" method="post" role="form"> {{ csrf_field() }} {{method_field('put')}} <legend>create student</legend> <input type="hidden" name="id" class="form-control" value="{{$student->id}}"> <div class="form-group"> <label for="">name</label> <input type="text" class="form-control" name="name" value="{{$student->name }}"required="required"> </div> <div class="form-group"> <label for="">address</label> <input type="text" class="form-control" name="address" value="{{$student->address }}" required="required&quo

swing - how to get variable value from a java thread -

i have thread computes , generates 2 d array. need access value of 2 d array, when thread finished. how can that swingworker<integer, void> worker = new swingworker<integer, void>() { object[][] valuematrix = null; @override public integer doinbackground() { try { valuematrix = dochemicalsynonyms(termsarray_1, termsarray_2, mview.getsavefilepath(), false, mview.getsheetname(), mview.getcategoryname(), mview.includepmids()); } catch (exception e) { e.printstacktrace(); return -1; } return 0; } @override public void done() { system.out.println(valuematrix[0][0]); } }; worker.execute(); dochemicalsynonyms functions generates valuematrix. how can

javascript - Covert form data to JSON string -

<form name = 'test' > <input type='text' name = 'login'> <input type='email' name = 'email'> </form> if use json.serialize($(form)).serializearray(); [{"name":"login","value":"a value"},{"name":"email","value":"a email"}] while need {"login":"a login","email":"a email"} . how that?? you can pass <form> formdata() , iterate key, value pairs of formdata instance, set each key , value object property , value let form = document.forms["test"]; let fd = new formdata(form); let data = {}; (let [key, prop] of fd) { data[key] = prop; } data = json.stringify(data, null, 2); console.log(data); <form name='test'> <input type='text' name='login' value="a login"> <input type='email' name

Maven fails if I state dependency explicitly but works without it -

i build set of projects (locally , jenkins) depend on each other. had added link ape emm. worked fine. had no dependencies stated in pom. repository: <repositories> <repository> <id>modelmigration</id> <layout>p2</layout> <url>${repobase}/modelmigration-maven/${repopath}org.muml.emm.repository/target/repository</url> </repository> </repositories> if remove repository build fails. missing requirement: org.muml.ape.migrator 1.0.0.qualifier requires 'bundle org.muml.emm 0.0.0' not found if add explicit dependency , enable snapshots repository, build fails. <dependencies> <dependency> <groupid>org.muml.emm.group</groupid> <artifactid>org.muml.emm</artifactid> <version>1.0.0-snapshot</version> </dependency> </dependencies> <repositories> <repository>

Oracle optimizer stale statistics -

if table's statistics stale, optimizer use them? i checking statistics using query: select owner,table_name,partition_name,subpartition_name, num_rows,last_analyzed dba_tab_statistics stale_stats='yes' stale stats still “used”, it’s oracle can detect stale stats , re-collect them necessary yes , used.

vba - Dynamic labelling of shapes -

i creating shapes within for-loop , want each shape having different name. therefore, shape in set shape = ... in each iteration should have shape replaced dynamic variable. if place shapes via set shape = w.shapes.addshape(msoshaperectangle, 10,10,10,10) how can have shape (the name of shape) dynamic e.g. set cells(1 + i, 1) = w.shapes.addshape(msoshaperectangle, 10,10,10,10) ... each shape has different name. tried shape.name = not seem have same effect setting name while creating shape. i assign name each shape create within loop: shape.name = cells(ganttstartrow + i, 1) & cells(ganttstartrow + i, 2) i set connector via set conn = w.shapes.addconnector(msoconnectorelbow, 1, 1, 1, 1) conn.connectorformat.beginconnect d, 1 conn.connectorformat.endconnect wp, 1 ... receive "type mismatch" error. assuming ws worksheet working with: dim s shape, integer = 1 5 set s = ws.shapes.addshape(msoshaperectangle, 50 + * 120, 200, 100, 100) s.name

maven - Google Vision Batch Annotate Images with Java Client Library -

i getting exception when trying annotate images via google vision using provided java client google vision. specifically code batch client.batchannotateimages occurs: public void processocr(byte[] file) { list<annotateimagerequest> requests = new arraylist<>(); bytestring imagebytestring = bytestring.copyfrom(file); image img = image.newbuilder().setcontent(imagebytestring).build(); feature feat = feature.newbuilder().settype(type.document_text_detection).build(); annotateimagerequest request = annotateimagerequest.newbuilder().addfeatures(feat).setimage(img).build(); requests.add(request); try (imageannotatorclient client = imageannotatorclient.create()) { batchannotateimagesresponse response = client.batchannotateimages(requests); list<annotateimageresponse> responses = response.getresponseslist(); client.close(); //visionresultsdto result = new visionresultsdto();

database - REST for soft delete and recovering soft deleted resources is limited -

this not technical question more reflexion subject. rest have democtratized way of serving resources using http protocols , let developper cleanest project splitting resources , user interface (back-end deals back-end use of rest apis). about api, of time use get, put/patch (hmm meh ?), post , delete, both mimic crud database. but time spent on our projects goes by, feel ux can improved adding tons of great features. example, why should user feel afraid of deleting resource ? why not put recovery system (like can see in google keep app let undo deletion think awesome in term of ux). one of practices preventing unintentionnal deletion use of column in table represents resource. example, delete book, clicking delete button flag row "deleted = true" in database, , prevent displaying rows deleted when browsing list of resource (get). this last comes in conflict our dear , loved rest pattern, there no distinction between delete , destroy "methods". what m

javascript - How to rerender or refresh or get js code to work properly for different resolutions? -

i had seen there similar questions, couldn't find proper answer problem. code: function test() { var scroll = parseint($('.sidebar').css('height')); if (window.matchmedia('(min-width: 769px)').matches) { $(window).scroll(function() { if ( $(window).scrolltop() > scroll ) { $('.element').addclass('fixed'); } else { $('.element').removeclass('fixed'); } }); } } window.onload = function() { test(); } as can see code (adding , removing simple class when scrolling) should work resolutions bigger 769px (width) , works - when test on mobile device resolution 1024x768 @ 1024px width - works fine, problem when rotate device - width 768px, "fixed" class again added , breaks layout. have refresh whole page code work properly. i can make whole page reload on resize slow , irritating users. tried set function , on resize doesn't work. $(win

matlab - Can `imfilter` work in the frequency domain? -

Image
according this quora answer , gabor filter frequency domain filter. and, here implementation of gabor filter uses imfilter() achieve filtering, means imfilter() works in frequency domain . now, let @ source code #1 . if replace i_ffted_shifted_filtered = i_ffted_shifted.*kernel; with i_filtered = imfilter(i, kernel); as following function [out1, out2] = butterworth_lpf_imfilter(i, dl, n) kernel = butter_lp_kernel(i, dl, n); i_filtered = imfilter(i, kernel); out1 = ifftshow(ifft2(i_filtered)); out2 = ifft2(ifftshift(i_filtered)); end we don't obtain expected output, why doesn't work? what problem in code? source code #1 main.m clear_all(); = gray_imread('cameraman.png'); dl = 10; n = 1; [j, k] = butterworth_lpf(i, dl, n); imshowpair(i, j, 'montage'); butterworth_lpf.m function [out1, out2] = butterworth_lpf(i, dl, n) kernel = butter_lp_kernel(i, dl, n); i_ffted_shifted = ffts

node.js - Heroku nodejs websocket server returning 503? -

this solved, can't mark own answer yet it's solved! so i'm trying host nodejs server on heroku, server works fine when host local, problem whenever try connect using: const ws = new websocket('ws://<myapp>.herokuapp.com'); i error in heroku logs: heroku[router]: at=error code=h10 desc="app crashed" method=get path="/" host=<myapp>.herokuapp.com request_id=<request-id> fwd="<my-ip>" dyno= connect= service= status=503 bytes= protocol=http i have no clue how fix this, , can't find on google. if understands better do, please tell me i'm doing wrong. here server code btw: const websocket = require('ws'); var port = process.env.port || 3000; const wss = new websocket.server({ port: port }); console.log("listening on %d", port); wss.on('connection', function connection(ws) { ws.on('message', function incoming(message) { console.log('received: %s',

Wordpress widget isn't working correctly -

on link ( https://truckingscout.com/test/ ), under widget "hundreds of job on globe" there list of jobs, every job opening same link (something wrong). here demo of theme ( https://jobify-demos.astoundify.com/classic/ ) can see how needs work. the problem in css add following code in active theme style.css , check it. ul.job_listings > li:hover { box-shadow: inset 5px 0 0 #7dc246; } ul.job_listings li { position: relative; border-bottom: 1px solid #ccc; margin: 0; padding: 1em; }

amazon web services - S3 bucket policy: allow full access to a bucket and all its objects -

i bucket policy allows access objects in bucket, , operations on bucket listing objects. (action s3:* .) i able solve using 2 distinct resource names: 1 arn:aws:s3:::examplebucket/* , 1 arn:aws:s3:::examplebucket . is there better way - there way specify resource identifier refers bucket , contained objects, in 1 shot? permissions against bucket separate permissions against objects within bucket. therefore, must grant permissions both. fortunately, can write shorter version combine bucket-level , object-level permissions: { "id": "bucketpolicy", "version": "2012-10-17", "statement": [ { "sid": "allaccess", "action": "s3:*", "effect": "allow", "resource": [ "arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*" ], "principal": "*" } ] }

How to order modules in intelij-idea? -

Image
say have project lot of modules in intellij-idea: a b ... z in specific time need work 2 or 3 modules: a, m, z. convenient hide other modules project browser. or reorder packages like: a m z b ... is there way that? update: don't want delete inactive modules, want group modules i'm working with. there no way change order of modules. there 2 ways want. module groups create module groups going file > project structure > [modules] . move modules module group selecting 1 of more modules, open context menu (i.e. right click) , select move module group . can create new group, select existing group, or move them outside group: then in project view, can collapse group(s) modules not want focus on. modules still present , available (i.e. no modules deleted). search grouping modules in guide more information. scope view define scope ( settings > appearance & behavior > scopes ) show modules interested in. see page in