Posts

Featured post

xslt - Substring before throwing error -

i've below xml <?xml version="1.0" encoding="utf-8"?> <body> <p>industrial drawing: creative composition</p> <p>industrial drawing: creative<fn> <fnn>4</fnn> <fnt> <p>ftn1"</p> </fnt> </fn> composition </p> </body> and below xsl. <xsl:template match="p"> <xsl:choose> <xsl:when test="contains(substring-before(./text(),' '),'article')"> <xsl:text>sect3</xsl:text> <xsl:value-of select="./text()"/> </xsl:when> <xsl:when test="contains(substring-before(./b/text(),' '),'section')"> <xsl:text> sect 2</xsl:text> <xsl:value-of select="./text()"/> </xsl:when> <xsl:w

c# - Call C++ Native DLL in Managed Code -

this question has answer here: c++/cli mixed mode dll creation 6 answers i have native c++ dll, header file , lib file. want create managed wrapper of it. not have source code of dll. how can call/used in c# or c++ managed code. here header file thanks, adil if you've got dll's header, can use dllimport (you can use without have been more complicated) this allow specify method you'll able call in managed code match 1 of in dll. you'll have little work though, have tell c# compiler type use match c++ ones

Google Cloud Bigtable Durability/Availability Guarantees -

i google provide guidelines on durability , availability guarantees provided cloud bigtable service. here understanding far: the fact minimum cluster requires 3 nodes suggests that, @ least within zone, data highly durable , replicated 3 nodes. however, this answer googler states "cloud bigtable doesn’t replicate data" — directly contradicting quote on cloud bigtable homepage claims "is built replicated storage strategy". it? replicated or not? , if so, how many copies kept? the fact clusters can set within particular zone suggests availability of cluster tied directly availability of zone. if want have highly available bigtable-based data storage, best practice set independent clusters across multiple zones , handle synchronisation of writes across clusters myself? there no information on whether bigtable clusters across zones independent or not. if set clusters across multiple zones, , 1 zone goes down, expect clusters in other zones carry on work

ldap - PHP Warning: ldap_mod_replace(): Modify: Server is unwilling to perform in -

below code getting error as: php warning: ldap_mod_replace(): modify: server unwilling perform in here code: $ip = "10.60.0.12"; $ldaps_url = "ldaps://$ip"; $port = 636; $ad = ldap_connect($ldaps_url, $port) $ad->set_option(ldap_opt_protocol_version, 3); $ad->set_option(ldap_opt_referrals, 0); $b = $ad->bind($config['ad']['binddn'], $config['ad']['bindpassword']); $newpassword = "fssfgds^^&&"; $userdata["unicodepwd"] = $newpassword; $userdata["pwdlastset"] = - 1; $userdata["useraccountcontrol"] = 512; $result = $ad->mod_replace($dn, $userdata); not sure went wrong in above code, please , tell me how fix issue? server unwilling perform means you're not binding user sufficient rights perform action. it's credentials/access control issue ldap not code.

c# - Changing Rows to Columns in LINQ -

Image
i have list displays recorded shown view using linq want record display shown view b. also, using angularjs binding script using ng-repeat table display record. i have included sample of code below. view a: view b: code: public iqueryable<paygrossentitlement> getpayrollbyid(int payrollid, int schoolbranchid, int schoolid) { var query = x in _context.db.tbl_paygrossentitlement x.schoolid == schoolid && x.schoolbranchid == schoolbranchid && x.payrollid == payrollid && x.salarycomponentid !=6 select new paygrossentitlement() { schoolid = x.schoolid, schoolbranchid = x.schoolbranchid, salarycomponentid = x.salarycomponentid, salarycomponentname = x.tbl_salarycomponent.salarycomponentname, s

How to convert image from double to uint8 in matlab? -

i have image i of type double . want convert image double uint8 . have tried using both: i=uint8(i) i=im2uint8(i) . when use imshow(i) command, black image , nothing else. doing wrong? the im2uint8 function assumes double image scaled range [0,1] . if image has values larger 1 or smaller 0 , these values clipped. see following example: im2uint8([-1 0 0.5 1 2]) ans = 0 0 128 255 255 the solution scale input image [0,1] subtracting minimum value , dividing total range: i = (i - min(i(:))) / (max(i(:)) - min(i(:))); = im2uint8(i); imshow(i);

Android M doze mode and "native" posix socket freezing up -

do not know if considering android m floating around since not much. experiencing strange behaviour app. using native posix tcp client sockets make connections. these sockets working until "doze" or "app standby" modes not activate...cause once either phone reset can not allow app work once again. solution clear app data or reinstall app on phone. still have not investigated errno of subsequent connections, after doze mode, sure sound strange complete app reinstall necessary in order fix posix tcp connections work once again. tomorrow able post few more details regarding issue. has encountered similar problem on android m after doze had prevented network access? thank you!