Posts

Showing posts from May, 2015

How to disable/override Windows 10 Hotkeys with C# -

i'm trying register hotkeys, can't because windows defaults. ctrl+win+1 minimizes current window. i'd else. i'd disable win+left/right. i'm trying handle ctrl+win+arrow in own virtual desktop manager. zvirtualdesktop this has done using c# , win32 api if necessary. absolutely cannot use autohotkey. every page find descibes how can done autohotkey. i'd post code, don't know start. use win32 register hotkeys. assume there way override them, can't find info. does have idea? it possible using keyboard hook. hook class can found on codeproject article using below code prevent win + left or win + right occurring. can use override whichever keys you'd like. this override hotkeys added via registerhotkey win api. once have classes in project can add handlers static hookmanager class below. //it's worth noting here if subscribe key_press event break international accent keys. hookmanager.keypress += hookmanager_keypre

How to disable git for some project and other project not disable git in Visual Studio Code? -

some project don't want use git monitoring , in other project want keep use git monitoring , use setting "git.enabled": false, "git.path": null, "git.autofetch": false but disable git project , how setting visual studio code git project instead of editor? you add git settings workspace settings.json file. way, vscode ignore git changes project. create or add .vscode/settings.json file. "git.enabled": false this way of other project continue have git enabled.

asp.net core - AspNetCore Updating Packages from the Server -

is there way detect, , update packages aspnetcore application deployed on server without redeploying? as example of i'm hoping achieve, can think of application wordpress able detect version update , notify admin user of available update, , allow admin user initiate live update without developer redeploying site.

java - CXF REST client call with 2-way auth failing with "unable to find valid certification path to requested target" -

i've been iterating through implementing rest call cxf clientbuilder. had earlier problem reported @ have cert file , key file, need build truststore , keystore cxf clientbuilder , i've worked through, it's morphed different. based on response got that, used "openssl" convert key file pkcs#1 pkcs#8. gets me past clientbuilder setup, although next problem see makes me think still have fix something. after creating client, executed code this: webtarget target = client.target(getserverhostport()).path(getserverpath()); builder request = target.request(); response postresponse = request.post(entity.text("tokenid=" + token)); this results in following: caused by: javax.net.ssl.sslhandshakeexception: sslhandshakeexception invoking https://<hostport>/token/tokenval: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certif

java - I get an identifier expected error. Why? -

why getting identifier expected errors here? separate class main class, used describe rooms have move throughout. but, not know why getting error. public class describeroom{ protected int roomnum; public describeroom(roomnum){ this.roomnum = roomnum; }//end constructor public string describe(roomnum){ string[] room = {"you find in nicely trimmed front yard. there front door north.", "you walk southern part of main hall. can't amazed decor.you see front door south, , rooms east , west. there more of hall north.", "you in northern part of main hall. south rest of hall, , there doors north, west , east.", "you walk bathroom. smells of lemon. there doors south , east.", "you walk tidy bedroom. there doors south , east.", "you walk living room. has couches , sized television. there doors west , south.", "you walk d

Why mp4 video captured+shared from my android device won't open in gmail? -

i have app capturing video standard mpeg4 video/audio mime types (video/mp4v-es + audio/mp4a-latm) , played on both android , windows machines right. can share whatsapp without issue. the thing is, when share using gmail, file can played on pc if download file, cannot open in gmail reason. the error seems it's youtube problem. video shared file captured directly camera. is there can make file shared properly, may open in gmail's video player?

swift - Do I need [weak self] or [unowned self] for a Singleton in the Closure? -

class test { private init() {} static let shared = test() func test() { } } let closure: ()->void = { test.shared.test() } closure() the code above simple. want know if have mark weak or unowned singleton. , why? no, because self not used (explicitly or implicitly) in closure.

python - I can not read MSSQL 2008 DB when I create an executable file with py2exe -

i using python 2.7 , mssql 2008. > python ecrosssnd.py ----> success running executable via py2exe not read db. why? error connect ms-sql lib error message 20009, severity 9: \ nunable connect: adaptive server (db2connect (84)] warning ().

node.js - NodeJs reload data from file to view -

my app fetching data external file , display on ejs view. user can change data post method. should saved , displayed on view. new data displayed after second click on form submit. not first. how can change it? var info; fetchtag(); function fetchtag() { fs.readfile('tag.js','utf8',function(err,data){ if(err){return console.log(err)}; info = data; }); } router.get('/',function(req,res){ res.render('index',{tag: info}); }); router.post('/tag',function(req,res){ fs.writefile('tag.js',req.body.tag); fetchtag(); res.redirect('/'); }); fs.writefile() asynchronous function. means isn't finished running before .post() route calls fetchtag. then, because fethctag() function asynchronous, won't finish until after redirect route. try making fetchtag() promise based. function fetchtag() { return new promise((resolve, reject)=>{ fs.readfile('tag.js',&#

How to do setting for FairCallQueue in cloudera manager? -

i have cluster cdh 5.7.1 version. avoid rpc latency issue, found qos can set. can me, how set it's property cloudera manager? below properties. hdfs-site.xml: ipc.8020.callqueue.impl org.apache.hadoop.ipc.faircallqueue ipc.8020.backoff.enable true

SSH connection refused on azure vm -

Image
i able render public ip of virtual machine on chrome not able connect ssh, raising error: connect host xxx.xxx.xxx.xx port 22: connection refused. when check virtual machine on portal, there no security group assigned it. this? how can fix it? according description, if want ssh docker image, should install ssh on image, , open port image, run centos image example: docker pull centos:centos6 docker run -i -t centos:centos6 yum install openssh-server openssh-client(install ssh) chkconfig sshd on passwd(reset root password) exit docker commit 332b19ca916c centos/centosssh (commit image) docker run -i -t -d -p 50001:22 centos/centosssh (nat container) docker attach containerid (connect container) vi /etc/ssh/sshd_config (modify sshd config) change usepam no service sshd start then open port 50001 in azure nsg. this time, can use ssh connect it: update: i use cli 2.0 create vm docker extension, , change public ip address static , , use command sudo docker run

javascript - How to make animated cursor in a website -

i've tried css cursor property how create cursor webpage https://my.pottermore.com/patronus you can create such effects using css , javascript: var standardbody=(document.compatmode=="css1compat")? document.documentelement : document.body //create reference common "body" across doctypes var nav = (!document.all || window.opera); var tmr = null; var spd = 50; var x = 0; var x_offset = 5; var y = 0; var y_offset = 15; document.onmousemove = get_mouse; function get_mouse(e) { x = (nav) ? e.pagex : event.clientx+standardbody.scrollleft; y = (nav) ? e.pagey : event.clienty+standardbody.scrolltop; x += x_offset; y += y_offset; beam(1); } function beam(n) { if(n<5) { document.getelementbyid('div'+n).style.top=y+'px' document.getelementbyid('div'+n).style.left=x+'px' document.getelementbyid('div'+n).style.visibility='visible'

xaml - Build and Release Menu Missing in TFS2015 -

Image
we have installed tfs2015 , trying use build , release functionality. we got session microsoft , , administration console of guy gave session got " build , release " menu. when tried install tfs2015 not able see menu. can see xaml build configuration under "additional tools , components". should install else view "build , release" menu? thanks! the build , release menu exists in tfs 2015 update 2 , upper version on tfs administration console. if install tfs 2015 rtm, can't see it. please update tfs tfs 2015 update 2/3 , check again. make sure didn't install tfs express version.

csv - parse a list looking string having dict type elements in python -

i want parse below list looking string, ( calling string because type str ) , info dict elements: "[{""isin"": ""us51817r1068"", ""name"": ""latam airlines group sa""}, {""isin"": ""cl0000000423"", ""name"": ""latam airlines group sa""}, {""isin"": null, ""name"": ""latam airlines group sa""}, {""isin"": ""brlatmbdr001"", ""name"": ""latam airlines group sa""}]" i used ast packege , literal_eval convert list , parse on it. counter valueerror: malformed string error. below code same: company_list = ast.literal_eval(line[18]) print company_list in company_list: #print type(i) print i["isin"] here line[18] string above. or how can ignore such list

yii2 - Yii 2 Custom Module Namespace for Models -

is there anyway change namespace of module , use namespace of models? i'm building project using basic app template of yii2. what want have centralized namespace when use module different project , reuse models inside it, (either basic or advanced template), won't have change namespace based on root directory. this possible yii2 aliases. first put models in custom folder , set alias name yii config file. below // alias of file path yii::setalias('@myfolder', '/path/to/foo'); finally, update models namespace based on alias 1 time. below. namespace myfolder\models\xxx; now can copy folder yii2 app , set alias name, above mention. note:- directory independent below , namespace based on directory. foldername ->models ->xxxxx ->xxxxx ..... // , namespace should add models below namespace foldername\models; // while using these models, can import below import myfolder\xxxxxx;

cordova - How do I resolve this phonegap iOS build error? -

provisioning profile "ios team provisioning profile: *" doesn't include aps-environment entitlement. been digging around hours , can't find explanation of how resolve can build command line. know of no provisioning file that's named way. seems kind of default. if wants run app development, without push notifications,turn off push notifications capabilities in targets in xcode else have on push notification in certificate.

React native: horizontal swipe-scene pagination with dynamic loading -

i want implement horizontal swipe-scene-pagination in react-native app. need have 3 pages rendered @ moment (current, previous , next) , want add new pages dynamically on page change. bet there implementation done someone, haven't found any. also, far remember, kind of questions not allowed in stackoverflow. you, please, point stack-exchange site can ask question?

c - Convert from char * to int -

i have string char * = '343'. want convert integer value. example. char *a = "44221" want store value into int a; this should #include <stdlib.h> inline int to_int(const char *s) { return atoi(s); } just in case example usage int main( int ac, char *av[] ) { printf(" to_int(%s) = %d " ,av[1] , to_int(av[1]) ); return 0; }

scope - C++.Passing to functions.Syntax issue -

i pursuing interest in c++ programming way of self instruction. working on basic stuff , having issue getting classes talking/instantiated?. i trying main cpp file compile alongside header , call class functions through main using more efficient command method. i stuck , appreciate help. include both files. trying return value header calling function. error: main.cpp:6.21 error: cannot call member function 'void myclass::setnumber(int) without object the code works when compiled main, 'scope resolution operator' think. first main.cpp #include <iostream> #include "myclass.h" using namespace std; int main(){ myclass::setnumber(6); { return number; } } then header file myclass.h // myclass.h #ifndef myclass_h #define myclass_h class myclass { private: int number;//declares int 'number' float numberfloat;//declares float 'numberfloat public: void setnumber(int x) { number = x;//

ios - Integrate Paytm with swift 3.0 -

i want integrate paytm payment gateway swift 3.0 .i follow github link . have probelm in ["checksumhash"] = "" . can put in key. orderdict["mid"] = strmid orderdict["order_id"] = strorderid orderdict["cust_id"] = strcustomerid orderdict["industry_type_id"] = strindustrytype orderdict["channel_id"] = strchanalid orderdict["txn_amount"] = stramt orderdict["website"] = strwebsite orderdict["callback_url"] = "http://xxxxx.co.in/verifychecksum.php" orderdict["checksumhash"] = "" this gives me invalid checksum please tell me how can generate checksum. first of can call server api generate checksum. if using almofire call var param

angular - Dividing a form into multiple components with validation -

i want create single big form angular 2. want create form multiple components following example shows. app component <form novalidate #form1="ngform" [formgroup]="myform"> <div> <address></address> </div> <div> <input type="text" ngmodel required/> </div> <input type="submit" [disabled]="!form1.form.valid" > </form> address component <div> <input type="text" ngmodel required/> </div> when use code above visible in browser needed submit button not disabled when delete text in address component. button disabled correctly when delete text in input box in app component. as mentioned, hard template-driven form, model-driven form can achieved quite easily. comment: is there other simple example one? maybe same example without loops i can give example. need do, nest formgroup , pass on child. let's form looks th

r - Read lines that do not begin with ]dos -

Image
i have import csv file thousands of lines. in file, header appears several times. header begins following 4 characters: ]dos . readlines excluding lines beginning ]dos . the file looks like n[ dos date dos heure dos nom du patient ex pat n[ dos date dos heure dos nom du patient ex pat 7061283778 02-03-17 12h54 mr montaldo jimena 02-03-17 7061283777 02-03-17 12h54 mme montaldo jimena 03-03-17 7061283790 02-03-17 12h54 mme montaldo jimena 02-03-17 7061283779 02-03-17 12h55 mr montaldo jimena 02-03-17 7061300309 02-03-17 12h55 mme montaldo jimena 02-03-17 7061294068 02-03-17 12h56 mme montaldo jimena 03-03-17 7061283782 02-03-17 12h56 mr montaldo jimena 02-03-17 n[ dos date dos heure dos nom du patient ex pat 7061283781 02-03-17 12h56 mlle montaldo jimena 02-03-17 7061300311 02-03-17 12h57 mme montaldo jimena

javascript - other ways to write regular expression -

are there other ways can write regular expression? for var pattern = /^(1[-\.\s])?([{]?\d{3})?[)]?\)?[-. ]?(\d{3})[-. ]?(\d{3})[-. ]?(\d{4})$/; "use strict"; var $ = function(id) { return document.getelementbyid(id); }; var validatephone = function() { var phone = $("phone").value; //var pattern = /^\d{3}-\d{3}-\d{4}$/; var pattern = /^(1[-\.\s])?([{]?\d{3})?[)]?\)?[-. ]?(\d{3})[-. ]?(\d{3})[-. ]?(\d{4})$/; // 1-999-999-9999 var isvalid = pattern.test(phone); $("message").firstchild.nodevalue = (isvalid) ? "valid phone number" : "invalid phone number"; }; window.onload = function() { $("validate").onclick = validatephone; $("phone").value = ""; // set default phone number }; i know validates phone number lets 1-111-111-1111 , but there other ways recreate code make have same features?

libcrypto - Can not start aerospike on centos 6.3, no version information available (required by bin/asd) -

has body encounter problem? os version: centos release 6.3 (final) aerospike version: community edition 3.12.1 error message: # bin/aerospike start error: start failed due error. /home/work/aerospike-server/bin/asd: /lib64/libz.so.1: no version information available (required /home/work/aerospike-server/bin/asd) /home/work/aerospike-server/bin/asd: /usr/lib64/libcrypto.so.1.0.0: no version information available (required /home/work/aerospike-server/bin/asd) apr 07 2017 04:03:02 gmt: warning (cf:misc): (hardware.c:626) no numa information found in /sys looks may missing zlib library. i able install zlib on centos 6.3 minimal, along rpm version of aerospike 3.12.1 ce server centos/el6 issue seems .tgz version. rpm version works fine: sudo yum install zlib-devel -y wget http://www.aerospike.com/download/server/3.12.1/artifact/el6 tar xvf el6 cd aerospike-server-community-3.12.1-el6/ sudo ./asinstall i didn't /usr/lib64/libcrypto.so.1.0.0 warning centos

how to query JSON in mongodb -

i have following json. want store in mongodb json , query it. how can it? json { "id": 4, "user": { "firstname":"finn", "lastname":"balor", "email":["fb@wwe.com","fb1@wwe.com"], "password":"whateverhistaglineis", "address":{ "street":"64 victoria street", "country":"uk" } } } i storing following document > db.users.insert({id: 4,user: {firstname:"finn",lastname:"balor",email:["fb@wwe.com","fb1@wwe.com"],password:"whateverhistaglineis",address:{street:"64 victoria street", country:"uk"}}}) how can query record using country selector? you need query below, go through mongodb documentation , learn mongodb mongodb university . db.users.find({"user.address.country": &quo

python - Django: Restrict static folder access to non logged-in users -

i trying restrict users, directly hit on absolute static image url path(www.xyz.com/static/img/sam.png) in browser , access it. i tried following django docs: https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/apache-auth/ but block images there in login page also(before valid user authenticated). is there other efficient way restrict non logged-in users? edit: had referred django: serving media behind custom url related nginx , not apache. , there difference b/w static , media content. question related static content you can try answer here routing static url request own view (it tries use sendfile extension available in web servers) or use django whitenoise , whitenoise uses sendfile api server independent ( whether using nginx or apache) , production ready, extend whitenoise middleware , add checking there file restriction, sample code be django.http import httpresponseforbidden whitenoise.middleware import whitenoisemiddleware # samp

html - how to stop when user not to redirect to anotherpage if he click on a div -

here have 2 div <div class="div1"> <div class="div2"> <a href="#/hello">click on me</a> </div> </div> here aim when user click on div2 should redirect page not when click on div1 working fine in googlchore not in ie11 there 2 ways this. 1 this <div class="div1"></div> <div class="div2"> <a href="#/hello">click on me</a> </div> or <div class="div1"> <div class="div2"> <a href="#/hello">click on me</a> </div> </div> css: .div1{ padding:10px; } .div2{ background-color:black; } so have area 10px user clicks on div1 , won't redirect. can use achieve want.

c# - How to call stored procedure using Entity Framework code-first? -

i want create delete user userid using stored procedure in entity framework code-first. new entity framework don't know how can task. can please let me know how can that? this code far: stored procedure in sql server: create procedure [dbo].[deleteuserbyid] @userid bigint begin delete [dbo].[users] id = @userid end now can stored procedure used in code? don't know 1 please tell me. this class model builder : public class applicationdbcontext : identitydbcontext<applicationuser> { public applicationdbcontext() : base("defaultconnection") { } public virtual dbset<userinfo> userinfo { get; set; } public static applicationdbcontext create() { return new applicationdbcontext(); } public virtual objectresult<list<users>> getusers() { return ((iobjectcontextadapter)this).objectcontext.executefunction<list<userinfo>>("getusers"); } pr

Android Get contacts in Custom View only -

samsung galaxy s6 edge, android 6.0.1, microsoft exchange active sync. i have custom view contacts restricted exchange (outlook) main contacts only. there achived contacts list not included in custom view. on phone contacts see main list want in app query contact database person , works ok. however, people achived contacts. string partial = "henry" contentresolver contentresolver = getcontentresolver(); uri contacturi = uri.withappendedpath(contactscontract.commondatakinds.phone.content_filter_uri, uri.encode(partial)); cursor namecursor = contentresolver.query(contacturi, null, null, null, null); if (namecursor != null) { ... i henrys both archived list , main list. how restrict search main list only? found workaround although there must more elegant approach: int visible = namecursor.getint(namecursor.getcolumnindex(contactscontract.phonelookup.in_visible_group)); if (visible > 0) { ...

mysql - Why PHP return STRING instead of INT -

this question has answer here: mysql integer field returned string in php 11 answers mysqli_fetch_assoc (& pdo fetch assoc) storing numbers strings 1 answer a simple question, why php fetch() transform int string ? example : database structure : is_active int(11) php fetch : 'is_active' => string '1' (length=1) in opinion, it's trading off of performance , accessibility. in short, if mysql uses one-type(string) data, containers may have one-type tuple , not need complex data structure. there various datatypes various database. for example, int easy data-type. there int32, int64, unsigned int , every-databases has own data-type, php simplify type it. ie. cannot simple varchar2 converted string since there text,

cassandra - -bash: nodetool: command not found -

actually want cassandra incremental backup. found "nodetool" command that. when execute nodetool command gives following error. -bash: nodetool: command not found please me find out solution. , please suggest me, other way take cassandra incremental backup. thank

Skip the content while HTML to Excel conversion using aspose.cell in Java -

i want convert html excel using aspose cell in java, generated excel skipping content. html content : hi fanny, urgent !!  spr'17 - s/545175 -- adso# 16843754; spr'17 - s/545175 -- adso# 16843754; fdzjchxk;shdgasz;asdo;fhsjdzx dyzhbsxz;sdhbdugvfd;36457q;sfdnzcx; best regards tel: 0123-1234 8765 generated excel file content : spr'17 - s/545175 -- adso# 16843754; i using aspose cells-16.12.0.jar , there not error occurring. content doesn't has image or table etc have special symbol. code executing fine without error. feel special symbol creating problem. aspose.cells supports read/write ms excel-oriented html file, means, got use html tags ms-excel uses in formation of file. guess template html not good. think may try open html file ms-excel first check if opened fine or not. if ms excel opens file fine aspose.cells apis should able read fine.

vbscript - Non-Blocking Sleep in Vbs, while waiting for WScript.Shell -

i'm working vbs1, starting wscript.shell , starting vbs2. vbs1 running in bigger context , need keep proccess running , working, while waiting result of vbs2 (about 20-60sec) using sleep non-blocking in script, blocking proccess, need option. here's code got far: strfinalcommand = "wscript.exe " & cstr(scriptpath) & " " & cstr(strparams) set objshell = createobject("wscript.shell") set shellexec = objshell.exec(strfinalcommand) hittimeout = false sleepcounter = 0 while shellexec.status = 0 'wshrunning activesession.sleep 100 '--> on changing sleep-duration, please change multiplier in if below, sleepcounter = sleepcounter + 1 if sleepcounter >= timeoutduration * 10 'timeoutduration * 2 hittimeout = true shellexec.terminate exit end if loop set shellexec = nothing set objshell = nothing if hittimeout = false reportsuccess = true end if everything running fin

C# Linq predicate generation remove all null values from list -

i trying generate filter code using linq predicates. when use predicate object != null: public static expression<func<contactpermitssearch, bool>> permitnumbernotnull() { expression<func<contactpermitssearch, bool>> predicate = contactpermit => contactpermit.permitnumber != null; return predicate; } which called by: public static iqueryable<contactpermitssearch> filterbynamemailingpermit(this iqueryable<contactpermitssearch> queryable, string search, bool filteron) { var predicate = predicatebuilder.true<contactpermitssearch>(); predicate = predicate.and(permitnumbernotnull()); var filtered = queryable.asexpandable().where(predicate); return filtered; } the sql statement generated not include permitnumbernotnull predicate statement. thoughts on fixing this? there's nothing wrong code. i'm sure if inspect predicate in debugger after merging per

c# - How to run WebApi project on IIS using only command line? -

i have webapi project has used .net 4.5 . trying run using cmd . have followed many links, blogs etc. explains using iisexpress commands, still couldn't find helpful answer. can 1 please post complete steps preferably starting from point 'how add iisexpress to path (so cmd knows it)' .??

Specify Docker date on image build or container start without affecting host -

is there way define date/time used in docker container (or default image) without affecting host? don't need able change date dynamically once i've started container (as asked in this questions), need set once.

networking - Order of magnitude of Kafka network overhead -

i want have idea of network use kafka. used tcpdump , tried @ tcp packets. noticed there lot of packets between producers / brokers / consumers / zookeeper. found biggest packets corresponding messages have difficulties know small ones corresponding (between different acks instance). do have idea of overhead of kafka ? or maybe the pattern request of kafka used estimate ? thank you

Spring MVC project migrated from Eclipse to Intelli J -

i have 1 spring mvc project in eclipse neon , working fine. because of reason want import project intelli j idea 2017. created new project in intelli j using file -> new -> project existing sources , got files can't understand how run in intelli j. i can't find option add tomcat server or add run configuration. can me this? i attaching screenshot of project structure reference ![project structure ] 1 edit have ultimate edition of intelli j under "run" menu should (if have ultimate rather community edition of intellij) able create run configurations want tomcat or pretty other application server known duke. in free version, options there pretty limited.

angular - Property 'download' does not exist on type 'Transfer'. in ionic 2 FileTransfer -

i using ionic 2 file transfer native plugin in app download sample.csv file server. facing below error message: property 'download' not exist on type 'transfer'. const filetransfer = new transfer(); let url = 'url server file'; console.log(url); filetransfer.download(url, cordova.file.datadirectory + 'sample.csv').then((entry) => { console.log('download complete: ' + entry.tourl()); }, (error) => { console.log("no file download"); }); and in console getting cordova not defined. can me ? you have import this. import { transfer, fileuploadoptions, transferobject } '@ionic-native/transfer'; import { file } '@ionic-native/file'; after inject this. constructor(private transfer: transfer, private file: file) { } declare below. const filetransfer: transferobject = this.transfer.create(); use this. // download file: filetransfer.download(..).

sh - Failed to create symbolic link on WSL -

i want create symbolic link using script shared team. script works fine on mac, line: ln -s `pwd`/git-hooks/post-checkout .git/hooks failed on windows machine, wsl complains that: ln: failed create symbolic link ‘.git/hooks/post-checkout’: input/output error how can fix this? the windows-version symbolic link exists. wsl regards normal file fails create link there. when understand deleted links , call command again, problem solved.

php - SwiftMailer attach image in email body -

Image
basically use yii2 mailer, in principe, use swifmailer. so, want display image in body email. our user use mozilla thunderbird no problem. , in user use email client based microsoft such oe, ms. oe 2007, 2010, 2013 , windows live mail, image displayed attached file. in body email displayed big cross icon. code : $mail = yii::$app->mailer->compose(); $mail->embed($img,[ 'filename' => 'request.png', 'contenttype' => 'image/png' ]); $arrayto = array("dzil@tresnamuda.co.id"); $mail->setfrom(array("itjkt@tresnamuda.co.id" => "tms it-jkt system")) ->setto($arrayto) ->setcc(array('dziljalal1@gmail.com'/* , \yii::$app->user->identity->email */)) ->setsubject("david - $status request sudah terkonfirmasi ke dept. dari user : " . yii::$app->user->identity->us

soap php json request information array -

i having issues trying information need soap request. can guys me out? i need send <x:envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://ips.iplabs.de/types"> <x:header/> <x:body> <typ:soimportitem> <timportitem_1> <sessionid>10101010</sessionid> <wipeversion>?</wipeversion> <serviceitemid>bbba051</serviceitemid> <itemid>a4647</itemid> </timportitem_1> </typ:soimportitem> </x:body> to url. cant find information how this. tried this $timportitem = array( 'sessionid' => '10101010', 'wipeversion' => '1.2', 'serviceitemid' => '101010', 'itemid' => 'a4458' ); $client = new soapclient('url/wipe/service?wsdl'); try{ $response = $client->soimportitem($timportitem); print_r(

c++ - how to count not deleted instances in array of instances? -

i have array of instances in code, : class squad : public isquad { public: squad(void); squad(squad const & src); virtual ~squad(void); int getcount(void) const; int push(ispacemarine*); ispacemarine* getunit(int) const; ispacemarine** getunits(void) const; int getcapacity(void) const; squad & operator=(squad const & rhs); private: ispacemarine **_units; // here array of instances int const _squadcapacity; }; initialized in constructor squad::squad(void) : _units(new ispacemarine*[64]), _squadcapacity(64) { return; } first, the way ? if yes, try count number of valid instances in array (not null , not deleted ) don't know how check if _units[20] deleted example. how can ? he current way do: int squad::getcount(void) const { int count =

python - Select2 widget for ManyToMany relationship -

i using django-select2 widgets nicer manytomany widget. view looks nicer , can search , select many different users. however, when save model, list of allowed users blank. tried direct view , unit tests. cannot fathom doing wrong. any idea? i suspect there 2 problems: 1 in saving of form created model , 1 how set data dictionary values. my model: class projectcode(models.model): allowed_users = models.manytomanyfield(user, blank=true) my form: class projectcodeform(forms.modelform): class meta: model = projectcode fields = '__all__' widgets = {'allowed_users': select2multiplewidget(), } my view: def create_code(request): context = {} if request.method == 'post': form = projectcodeform(request.post) if form.is_valid(): new = form.save(commit=false) new.save() form = projectcodeform() context['form'] = form return render(request, 'or

c# - Get all sheet names in an Excel file in order -

this question has answer here: get worksheet names in plaintext excel c# interop? 1 answer i trying sheet names in same order in excel file array. reach sheet individually below: var pathtoexcel = @"c:\users\desktop\everything.xlsx"; var sheetname = "sheet 1"; var destinationpath = @"c:\users\desktop\sheet1.json"; var connectionstring = string.format(@" provider=microsoft.ace.oledb.12.0; data source={0}; extended properties=""excel 12.0 xml;hdr=yes"" ", pathtoexcel); i wondering how sheet names in array. try this, oledbconnection conn = new oledbconnection(connectionstring); conn.open(); datatable dt = conn.getoledbschematable(oledbschemaguid.tables, null); string[] sheetnames = new string[dt.rows.count]; int = 0; foreach (datarow row in dt.rows) {

java - How to verify if an argument passed is with correct parameters if that argument's state is changed? -

i'm trying verify object using @captor argumentcaptor<user> userargumentcaptor ...//define user name , jailname - var = user1 ...//call method under test. verify(userdao).getname(userargumentcaptor.capture()); verify(userdai).getjailname(userargumentcaptor.capture()); assertthat(userargumentcaptor.getallvalues()).isequalto(arrays.aslist(user1user1)); /** * notice here had use same object verify when captured in 2 different situations. */ for scenario, user user = new user(); //object under inspection. user.setid(); //changing state here. userdao.getname(user); //capture user here. ... if(somebooleancondition) { user.setjailstatus(true); //changing state here. userdao.getjailname(user); //capture user here. } while asserting userargumentcaptor.getvalue() , checking updated value. makes sense since i'm capturing object not object's state. but, how verify object's state when passed? i think not possible. when checking out latest version

jquery validation on fosuserbundle form -

i validate form made fosuserbundle jquery validation plugin. i can't change property name of input, in code can't use square brackets assign property. here code: html made fosuserbundle: <input type="text" id="profile_factord" name="profile[factord]" class="form-control" placeholder="d" value="20"> jquery code validate input: $("#profile_form").validate({ errorplacement: function (error, element) { element.before(error); }, rules: { profile[factord]: { required: false, digits: true, maxlength: 3 } } }); error display: uncaught syntaxerror: unexpected token [ any ideas? sorry bad english

android - App fails after launch since trying to implement a checkbox -

at place work have samsung tablets run in kiosk mode . sadly there bug hardware means if battery gets low loose data , time , can't connect wifi , created simple app in android studio utilizing " logon activity " template settings , correct time issue. that works well, though able use app settings mdm system. so tried adding checkbox , if statement " if checked x else y " since doing app won't run. i've tried looking @ various tutorials , adapting them achieve though far have had no luck. my code below if amazing. ps : i'm not android developer , i'am picking bits google . have lot learn sorry if missed simple. loginactivity.java package mypackagename; import android.animation.animator; import android.animation.animatorlisteneradapter; import android.annotation.targetapi; import android.content.intent; import android.content.pm.packagemanager; import android.support.annotation.nonnull; import android.support.design.widget.

jqgrid no rows in Edge browser -

i have page use free jqgrid 4.14.0 , use serializegriddata soap request. in ie 11 fine in edge grid has no rows header shown. debugged page , can see soap request , response alright. can give hint how can find out problem or should workaround this. thanx. the xml data, need parse contains namespace. used escaped strings "rs\\:data" , "z\\:row" parse data. xmlreader: { root: "rs\\:data", row: "z\\:row", repeatitems: false, id: "[ows_id]" } in demo https://jsfiddle.net/psturm/rugr8tc0/ . such way isn't safe depends on version oh jquery, use , web browser, use. recommend use own callback function, required xml nodes. example, can use xmlreader: { root: function (node) { //return node.firstchild.firstchild.firstchild.firstchild.firstchild.firstchild; return getchildnodesbyname( node.firstchild.firstchild.firstchild.firstchild.firstchild, "rs:data"

javascript - how to convert canvas as png when multiple images drawn using drawimage -

how render canvas image multiple image drawn on , image used draw cross origin. while doing todataurl() image draw isn't coming. in advance this code var canvas = document.getelementbyid("mycanvas"); var ctx = canvas.getcontext("2d"); baseimage = new image(); baseimage.src = '' + data.picture.data.url + ''; baseimage.onload = function() { ctx.drawimage(baseimage, 1, 1); } var dataurl = canvas.todataurl("image/png");

xamarin.android - Xamarin.Forms ListView with uneven row hight not updating layout if items change size after an item has been deleted -

Image
i developing app uses list view show list of appointments. selected appointment , meet conditions should expanded , show information , others should show summarised version. have implemented using listview it's itemtemplate set datatemplate containing stacklayout contains various elements. of these elements have isvisible property bound bool property on view model updated depending on whether item should expanded. listview has it's hashunevenrows set true , rowheight set -1. when item deleted items collection correctly removed after point other item below on screen (except last item seem work) not change in size though "expand" property being changed , items appear overlayed on other elements there. if items scrolled off screen start working again. i have developed small test app shows same behaviour simpler , performs actions in response gui interaction remove possibility of being multi threading issues. simple app has button remove top item , list vi