Posts

php - compare two multidimensional arrays of object and set new property true/false pending match on larger set -

i have array of objects example: larger set: array( [0] stdclass object( [id] => 1, [name] => monkey, [sub] => ), [1] stdclass object( [id] => 1, [name] => tooth, [sub] => tip ), [2] stdclass object( [id] => 1, [name] => who, [sub] => knows ), ) smaller set array( [0] stdclass object( [id] => 1, [name] => monkey, [sub] => ) desired out come: array( [0] stdclass object( [id] => 1, [name] => monkey, [sub] => help, [selected] => yes ...

c# - How do I cast object to inherited class? -

say have: class tiger: xelement { public tiger(xelement t) :base(t) { } } and have xdoucment named tigers, how do things like: xelement t = tigers.descendants("tiger").elementat(0); (tiger)t; t tiger; the first 1 throws me exception: cannot cast 't' (which has actual type of 'system.xml.linq.xelement') 'zoo.tiger' second 1 return null. trying achieve reference in xelement , cast tiger . can things xelement.add can directly affect reference in xdocument. you cannot use inheritance this. object returned elementat xelement, not tiger, , there's nothing can change that. if give furry animal makes meow, there's no way can make dog, though dog subclass of animal. you can, however, use composition: class tiger { public xelement xelement { get; private set; } public tiger(xelement xelement) { this.xelement = xelement; } } usage: xelement x = tigers.descendants("tiger").e...

SSIS - ETL - Transfer tables/databases from many servers? -

i have 6-7 identical databases (almost). want copy data of tables of each of these servers corresponding table of 1 server. is, multiple sources , 1 destination server. servers have different ips. how do task ? loop appropriate this. if yes, way ? i might perform bit of transform. not sure of now. safe, want use ssis. here overview of how can set each loop loop through databases, provided tables indentical. it overkill though. ssis loop list of connection strings in master package, executing 2 other packages each connection string

css3 - CSS 3 hover issue -

i have div in sidebar. whole div link takes part of website. now, there small flower image in left side of div, background image. when hover div flower should rotate fade in , out. if apply animation on entire div, div rotate, not background image. solved this: flower in absolutely positioned div , rotates , fades in , out continuously (if apply animation :hover rotates when hover directly on image.) is want? http://jsfiddle.net/kgfdj/2/ #foo { width: 300px; height: 500px; background-color: #eee; position: relative; } #foo:after { content: ""; width: 20px; height: 20px; background-color: #f00; position: absolute; top: 10px; left: 10px; -moz-transition: 1s; -o-transition: 1s; -webkit-transition: 1s; transition: 1s } #foo:hover:after { -ms-filter: "progid:dximagetransform.microsoft.alpha(opacity=0)"; filter: alpha(opacity=0); opacity: 0; -moz-transform: rotate(45deg...

c# - Can't access directory services from server - DirectoryServicesCOMException -

i'm trying query ad in asp.net (4.0) application running on windows server 2008 r2 (iis7 installed). in runs fine on local computer (windows 7), not on server. i'm trying userid of current user. i've looked @ q&a of similar question, no success. here's code snip... public partial class default : system.web.ui.page { principalcontext principalctx = new principalcontext(contexttype.domain); userprincipal currentuser = userprincipal.current; the web.config has <authentication mode="windows"/> <identity impersonate="true" /> and here's error & stack trace... [directoryservicescomexception (0x80072020): operations error occurred. ] system.directoryservices.directoryentry.bind(boolean throwiffail) +781 system.directoryservices.directoryentry.bind() +44 system.directoryservices.directoryentry.get_adsobject() +42 system.directoryservices.propertyvaluecollection.populatelist() +29 sy...

compression - SSH command gets terminated while compressing a directory -

i compressing big directory 50gb containing files , folder using putty ssh command line.i using command: tar czspf file.tar.gz directory/ it starts work fine, after time gets terminated single word message "terminated" , compression stopped near 16gb of tar archive. is there way escape terminated error or how deal problem, or other method make tar of directory avoiding terminate error.thanks probably conflict kind of file size limit. not file system supports big files. in case pipe output of tar split command this: tar czsp directory/|split -b4g fileprefix-

php - Codeigniter: unable to display the uploaded image with spaces and capitalizing subsequent words -

from below code able upload images spaces , capitalizing subsequent words, if try view such images view page not visible. getting error the uri submitted has disallowed characters. i displaying images <img src="<?php echo base_url().'uploads/avatar/'.$avatar?>"/> how can fix error, allow img tag read image name spaces , capitalizing subsequent words. or alternative solution, how how can remove spaces or capitalizing subsequent words image name while uploading? i uploading file below code. function do_upload() { $this->load->library('form_validation'); if((isset($_files['userfile']['size'])) && ($_files['userfile']['size'] > 0)) { $this->form_validation->set_error_delimiters('<li class="errorlist">', '</li>')->set_rules('userfile', 'new image', 'trim|callback...