Posts

Showing posts from February, 2015

c# - Deploy Website in IIS -

Image
i trying deploy website on iis. when deploy without giving host name, works fine. however, if try specify host name, website never loads in browser. instance, gave hostname of www.webservice.com. when try load home page, web browser tries access www.webservice.com:2000/homepage.aspx connection times out. how can solve problem? you have either set dns point host iis running or make entry in "hosts" file. dns production purposes if want test hosts entry enough. find hosts file under %windowsroot%\system32\drivers\etc (eg.: c:\windows\system32\drivers\etc). add name of site (www.webservice.com) there ip of iis host. iis doesn't set dns automatically.

regex - How can i extract ul tag content and p tag content inside <dd> tag using regular expresstion in php -

i want extract content <dd> tag want take p tag content , ul tag content tried preg_match_all in php take contents inside <dd> in html page nothing html code <dd style="display: block;"> <p>lightweight, comfy , cool - dressy shirt won\'t mind wearing!</p> <ul> <li>made of 100% cotton</li> <li>specially treated soft feel</li> <li>classically styled pointed collar , button front</li> <li>chest pocket; curved shirttail hem</li> <li>canvas taping @ inner neck</li>

neo4j - CypherQuery returns empty result in JavaEmbedded, but correct result in Neoclipse -

i have strange problem cypher query. query works fine in neoclipse , returns correct result. in java embedded mode result empty. can't figure out problem. there query character limit in java embedded or similar? here cypher query: start typenode6=node(6) , containernode=node(9) , typenode35=node(35) , typenode15=node(15) , typenode18=node(18) , typenode33=node(33) match (node6)-[:type]->(typenode6) , (containernode)-[:contains*]->(node6) , (node35)-[:type]->(typenode35) , (node6)-[:`http://www.test.test/types/s3/media#actors`]->(node35) , (node15)-[:type]->(typenode15) , (node35)-[:`http://www.test.test/types/s3/media#impersonatedby`]->(node15) , (node18)-[:type]->(typenode18) , (node15)-[:`http://www.test.test/types/common#namedby`]->(node18) , (node33)-[:type]->(typenode33) , (node6)-[:`http://www.test.test/types/s3/media#runtime`]->(node33) node6.`http://www.

back stack - Maximum BackStack size in android -

i'm new 1 android development. need know maximum memory size of backstack in android , want know how many activities of android application can stored in backstack thanks the maximum memory size of stack same amount of free memory on device. can keep throwing things on activity stack until outofmemoryexception. check this

xml - XSL - How to do one thing if node has child, otherwise do another -

i'm farely new xslt , have tried various method check whether node has child. have following: <xsl:if test="child::list"> the above part works, problem have tried using when in method otherwise , not work. looked so: <xsl:when test="child::list"> which i'm guessing wrong doesn't work. the code below: <xsl:for-each select="td"> <td> <xsl:when test="child::list"> <table cellpadding='0' cellspacing='0'> <thead> <tr> <xsl:for-each select="list/item/table/thead/tr/th"> <th><xsl:value-of select="self::node()[text()]"/></th> </xsl:for-each> </tr> <xsl:for-each select="list/item/table/tbody/tr"> <tr> <xsl:f

javascript - Undefined Object method -

i have code , use display method keeps giving me: url undefined name undefined description undefined i don't know why i'm getting errors though providing proprieties. can please identify problem me? function website(name,url,description) { //proparties this.name=name; this.url=url; this.description=description; // methods this.getname=getname; this.geturl=geturl; this.getdescription=getdescription; this.display=display; // getname method function getname(name) { this.getname=name; } // geturl method function geturl(url){ this.geturl=url; } // getdescription function getdescription(description){ this.getdescription=description; } function display(name,url,description){ alert("url :" +url +" name :"+name+" description is: "+description); } } // set object proparites web=new website("mywebsite","http:/

html - Jquery checkbox .prop click preventDefault behaviour -

i have been working many checkboxes lately. came across 'problem' .prevendefault() click event , tried find solution this. in case wanted able decide if checkbox checked/unchecked according other fields. had open dialog before event fired. sounded easier turned out be... in this jsfiddle can see problem , how tried solve (see code below well). answers implied use change instead of click. can't use .preventdefault() . $('div').off('change','.wtf').on('change', '.wtf', function(e) { //e.preventdefault(); //return false; if($(this).prop('checked') == true) { alert('i true now, must stay false'); $(this).prop('checked', false); } else { alert('i false now, must stay true'); $(this).prop('checked', true); } }); is best solution? or there other way make checkbox wait untill allowed change it's state? as example: checkbox unchec

vba - Excel Graph Automatic Resizing of Axis Origin -

i have following code plots scatter plot. there elegant way resize plot area such x , y axis not automatically start zero, rather below lowest value? @ moment data points end bunched in 1 corner. many thanks! set cht = activechart 'graph 1 set rng1 = activesheet.range(range("ac13").offset(jump * 50, 0), range("ag23").offset(jump * 50, 0)) activesheet.chartobjects.add(left:=rng1.left, width:=rng1.width, top:=rng1.top, height:=rng1.height) '(left:=100, width:=375, top:=75, height:=225) .chart.charttype = xlxyscatterlines .chart.haslegend = false .chart.axes(xlcategory).ticklabels.font.size = 18 .chart.axes(xlvalue).ticklabels.font.size = 18 '.chart.setsourcedata source:=range("u13:o40,t13:n40") set srs = .chart.seriescollection.newseries srs.xvalues = range(range("u13").offset(jump * 50, 0), range("u13").offset(jump * 50, 0).end(xldown)) srs.values = range(range("t13&quo

java - Webdriver:Element is not currently visible and so may not be interacted with. -

Image
on web-page have username dropdown list when take mouse on logout option , user able logout. while automating, logout link hidden, webdriver not able interact it. please suggest solutions. use actions class mousehover , then, when logout link visible click on it. can use below code reference. actions actions = new actions(driver); //for hovering on username field webelement menuhoverlink = driver.findelement(by.linktext("username")); actions.movetoelement(menuhoverlink).perform(); //for clicking logout link webelement logoutlink = driver.findelement(by.linktext("logout")); logoutlink.click();

c# - How to select specific images and save from a particular url? (Description Inside) -

i need select , save specific images site entering url in textbox in site. i've loaded images site url, using html agility. don't know how select , save. for example, enter http://flipkart.com/ in text box, should load images page, assume contains 9 images, if 9 images loaded site , displayed gallery, gallery select 1 image click save. should save somewhere in site(may particular folder). i don't know how save images site. would give reference or ideas achieve task of saving image loaded when url given. thanks! i googled , got below code, public system.drawing.image downloadimagefromurl(string imageurl) { system.drawing.image image = null; try { system.net.httpwebrequest webrequest = (system.net.httpwebrequest)system.net.httpwebrequest.create(imageurl); webrequest.allowwritestreambuffering = true; webrequest.timeout = 30000; system.net.webresponse webresponse = webrequest.getresponse(); system.io

comexception - Error Code 2147500037 on Attempt for Bluetooth Connection in Windows Phone 8 -

i attempting establish app-to-app bluetooth connection programmatically. please see following code snippet said purpose: streamsocket streamsocket = await peerfinder.connectasync(peerinformation); i error whenever try so: an exception of type `system.runtime.interopservices.comexception` occurred in mscorlib.ni.dll , wasn't handled before managed/native boundary hresult e_fail has been returned call com component. error code: 2147500037 please advise on how go around error.

Is there a way to get access to the master mixer or other devices/channels via the web audio api? -

is there way record audio being mixed down (possibly tab/process) on hardware? there way input/connect browsers mixer? studio hardware has several input/output channels, mono and/or stereo; there way these connected onto graph? there/will there device enumeration api? the closest thing might able data microphone, , set system microphone system's output (in windows... manage audio devices > recording > stereo mix). use getusermedia audio. navigator.webkitgetusermedia({audio: true}, function(stream) { var microphone = context.createmediastreamsource(stream); });

Zend Framework query does not work? -

i have problem "select" statement in zend select. public function listanswers($sort_field = 'answer_id', $field = null, $value = null, $strict_filter = false, $client_id = null) { //here $value // $value = "abcd : <?\\?>"; $value = $this->getdefaultadapter()->quote("%".$value."%"); if( !empty($field) && !empty($value) && $strict_filter == false){ $select = $this->select()->where(" client_id != -99 ")->where($field . " $value ")->order($sort_field); } } and error comes , query printed select `answer`.* `answer` ( client_id != -99 ) , (client_id = '1') , (answer_text '%abcd : <?\\\\?>%' ) order `add_date` desc record not come appropriate $value has. there no need quote values when using select(), select() provide quotes default. when using select() idea use placeholders instead of concatenation beca

c++ - Using Namespace and Headers -

i'm working on project i've written test code in header files. i've done because i'm doing test driven development , results in large amount of complementary classes each class add: interface, test, mock etc. think i'd go crazy if had deal cpp versions of these files... i don't add "using namespace std" start of headers because i've learned no, no. anyway, lets initialise blob object @ start of test, follows: blob v = boost::assign::list_of(std::pair<std::string, container >("scotland",container(boost::assign::list_of(1)(2)(3).convert_to_container<std::vector<int> >()))) (std::pair<std::string, container >("sweden",container())); where blob typedef ed somewhere std::vector<std::pair<std::string, container > > . how can make prettier? reason i'm using list_of make things more readable in case think makes lot more difficult read. lot better: blob v = list_of(pair<

javascript - Differentiate between a dangerous redirect and an irrelevant ajax response -

on web page possible send ajax requests , jump page meaning ajax requests irrelevant , aborted browser. return 1 of these jquery ajax requests error handling might be: readystate = 0 responsetext: "" status=0 but, note error handler may not invoked. depends when browser aborts request , when user selects go onto page. if invoked invoked above parameters. here gets juicy. similar response happens when 302 redirect returned ajax request when location set domain. browser (both ie , ff) mangle 302 , invoke error handler same info: readystate = 0 responsetext: "" status=0 i know 302 location set domain using fiddler. take fiddler away , see above. i need able differentiate between ajax requests aborted because user goes page ajax requests aborted because redirects domain but can't if exact same info both. any tips? check window object or else in dom? note: can't predict when request return 302. can't see location header server sid

javascript - Get the offset position of the caret in a textarea in pixels -

this question has answer here: how (x, y) pixel coordinates of caret in text boxes? 3 answers in project i'm trying offset position of caret in textarea in pixels. can done? before asking here, have gone through many links , tim down's, couldn't find solution works in ie8+, chrome , firefox. seems tim down working on this . some other links have found have many issues not finding top offset of caret position. i trying offset position of caret because want show auto-complete suggestion box inside textarea positioning based on offset position of caret. ps: can't use contenteditable div because have written lots of code related textarea . here's approach using rangyinputs , rangy , jquery . it copies whole text inside textarea div of same size. have set css ensure in every browser, textarea , div wrap content in same way

SPRING MVC 3.2.2 + SPRING SECURITY 3.1.3 INCOMPATIBILITY java.lang.IncompatibleClassChangeError -

have changed version of spring security in application 3.2.0.m1 3.1.3 have error when tomcat launches application. first row of exception stack following: 2013-04-25 11:33:12,893 [localhost-startstop-1] error org.springframework.web.context.contextloader - org.springframework.web.context.contextloader - context initialization failed org.springframework.beans.factory.beandefinitionstoreexception: failed read candidate component class: file [c:\users\daniele\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ice-cream-webapp\web-inf\classes\com\myprj\app\web\controller\frontpagescontroller.class]; nested exception java.lang.incompatibleclasschangeerror: class org.springframework.core.type.classreading.classmetadatareadingvisitor has interface org.springframework.asm.classvisitor super class and pom.xml is: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation=&qu

uiview - Interpolation issue after renderInContext:UIGraphicsGetCurrentContext(), iOS -

Image
i have few uivies butted edge edge. views cover superview. looks great in display, when rendered adjoining edges visible, sat line appears between them. since views perfect in display, imagine must interpolation of pixels of views causes this. anyone know how fix this? the image below render. on device or simulator lines not visible. render code -(void)renderimage { cgsize rendersize = cgsizemake(masterview.frame.size.width, masterview.frame.size.height); uigraphicsbeginimagecontext(rendersize); cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsavegstate(context); cgcontextconcatctm(context, [[masterview layer] affinetransform]); [[masterview layer] renderincontext:uigraphicsgetcurrentcontext()]; renderedimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); cgcontextrestoregstate(context); uiimagewritetosavedphotosalbum(renderedimage, self, @selector(image:didfinishsavingwitherror:contextinfo

web applications - ASP.NET EF5 code-first not creating SQL Server CE database -

i searched far , wide, went through tutorials , tips, wont work! ef 5 code-first not generating sql server ce 4 database file. i have asp.net web application , want generate database using code-first approach. here model classes: public class class { [key] public int id { get; set; } public bool islecture { get; set; } public int courseid { get; set; } public virtual course course { get; set; } public int teacherid { get; set; } public virtual teacher teacher { get; set; } } public class course { [key] public int id { get; set; } public string name { get; set; } public int semester { get; set; } } public class teacher { public int id { get; set; } public string name { get; set; } public string lastname { get; set; } } here context: public class mycontext : dbcontext { public dbset<class> classes { ge

Matlab: read and calculate percentage of occurrence values from text files -

i have set of .txt files name: table.iterations.txt iterations = 1:10000 (so table.01.txt , table.02.txt , table.1001.txt etc, each file size lower 2kb). each txt file contains values, integers without decimals in different lines p.e.: table.01.txt table.02.txt ... table.1001.txt 2 5 32 5 19 37 19 45 58 52 88 62 62 89 75 95 80 99 88 100 each txt file can contain different number of values, 0<value<101 . i need on how read files find percentage of occurrence of value inside txt files. on above rough example, value 2 present 1 time, value 5 2 times, value 100 1 time etc. thank in advance. from comments, according this post : dirname = 'c:\yourpath'; %# folder path files = dir( fullfile(dirname,'t

java - Onclick listner to expandable listview -

i have created expandable listview, onclick listener child list items not attached. the activity code: public class myactivity extends activity { private expandablelistview mexpandablelist; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); mexpandablelist = (expandablelistview)findviewbyid(r.id.expandable_list); arraylist<parent> arrayparents = new arraylist<parent>(); arraylist<string> arraychildren = new arraylist<string>(); //here set parents , children (int = 0; < 2; i++){ //for each "i" create new parent object set title , children parent parent = new parent(); parent.settitle("parent " + i); arraychildren = new arraylist<string>(); (int j = 0; j <

c# - Catel (MVVM framework) ObservableCollection -

i'm using catel implement wpf application. i have class extends observablecollection , every time item inserted ui must updated. code ( simplified version ) : public abstract class logcollections : observablecollection<log4netlog> { private readonly object _locker; protected logcollections() { _logchart = new logginglevelchart(); _locker = new object(); } public object locker { { return _locker; } protected override void insertitem(int index, log4netlog item) { lock (_locker) { base.insertitem(index, item); if (item == null) { return; } log4netlog temp = item log4netlog; // updating if (temp != null) { // updating } } //unlock } } } until have used bindingoperations.enablecollectionsynchronization available in .net 4.5. unfortunately have compile code using .net 4.

Proguard error in android when exporting the application? -

i developed android application functionalities working fine. when try export application getting following error proguard returned error code 1 . see console my console here proguard.parseexception: expecting class member name before '@' in line 162 of file 'd:\android\workspace.gopal\loginactivity\bin\proguard.txt', loginactivity] included argument number 6 loginactivity] @ proguard.configurationparser.readnextword(configurationparser.java:1133) loginactivity] @ proguard.configurationparser.readnextword(configurationparser.java:1117) loginactivity] @ proguard.configurationparser.parsememberspecificationarguments(configurationparser.java:845) loginactivity] @ proguard.configurationparser.parseclassspecificationarguments(configurationparser.java:697) loginactivity] @ proguard.configurationparser.parsekeepclassspecificationarguments(configurationparser.java:490) loginactivity] @ proguard.configurationparser.parse(configu

ubuntu - Installing MariaDB - Unmet dependencies, mariadb-server-5.5 -

i'm attempting install mariadb on ubuntu 12.04 lts. i've followed instructions provided @ https://askubuntu.com/questions/64772/how-to-install-mariadb , mariadb.org appear when choose download. the last step sudo apt-get install mariadb-server returns: reading package lists... done building dependency tree reading state information... done packages not installed. may mean have requested impossible situation or if using unstable distribution required packages have not yet been created or been moved out of incoming. following information may resolve situation: following packages have unmet dependencies: mariadb-server : depends: mariadb-server-5.5 not going installed e: unable correct problems, have held broken packages. the dependency issue acknowledge issue ( https://mariadb.atlassian.net/browse/mdev-3882 ) believe broken package prevents me working around this. if try install libmariadbclient18 following: reading package lists... done building dependency tr

iphone - logout from facebook completely -

i have integrated facebook sdk , able login facebook. if user enabled facebook account on ios settings ask permission acces in app otherwise goes safari facebook login , come app. logout used following code: nshttpcookie *cookie; nshttpcookiestorage *storage = [nshttpcookiestorage sharedhttpcookiestorage]; (cookie in [storage cookies]) { nsstring* domainname = [cookie domain]; nsrange domainrange = [domainname rangeofstring:@"facebook"]; if(domainrange.length > 0) { [storage deletecookie:cookie]; } } [fbsession.activesession closeandcleartokeninformation]; but unable logout completely. if again click login button still showing access token not moving safari facebook login again means has not logged out facebook. unable recognized issue. if know please me out. i thankful you. are using version 3.x of facebook sdk ios? if so, fbsession class should have method called -[fbsession closeandcleartokeninformation] hopefully

three.js - Eliminating off-of-ball roll in Trackball controls (with code/fix) -

is intent of trackballcontrol have "border" outside trackball induces roll? dislike it. bit discontinuous, , does't have lot of purpose (imho). if not, function getmouseprojectiononball can changed similar following. 2 things (not "correctly"): normalize radius fill both axis map z values outside of ball (ie z 0) i find lot more natural, personally. thoughts? this.getmouseprojectiononball = function(clientx, clienty) { var xnormalized = (clientx - _this.screen.width * 0.5 - _this.screen.offsetleft) / (_this.screen.width / 2.0); var ynormalized = (_this.screen.height * 0.5 + _this.screen.offsettop - clienty) / (_this.screen.height / 2.0); var mouseonball = new three.vector3( xnormalized, ynormalized, 0.0 ); var length = mouseonball.length(); var ballradius = 1.0; // fraction of screen if (length > ballradius * 0.70710678118654752440) { var temp = ballradius / 1.414213562373

iphone - Using NSTimer in NSObject class -

i displaying custom uiview (which uialertview) on clicking button in many view controllers.so, have included code in nsobject class. have display uitableview subview custom view, , 1 of uitableview cell contains countdown timer. able display customview , uitableview. but, not able implement nstimer in customview. code display custom view: +(nsmutabledictionary *) printpopup:(uiview *)inputview { int i=20; uiview *mycustomview = [[uiview alloc] initwithframe:cgrectmake(20, 100, 280, 250)]; [mycustomview setbackgroundcolor:[uicolor colorwithred:(247/255.0) green:(239/255.0) blue:(218/255.0) alpha:1]]; uitableview *dynamictable=[[uitableview alloc]initwithframe:cgrectmake(0, 0, 280, 250) style:uitableviewstyleplain]; dynamictable.tag=55; [mycustomview addsubview:dynamictable]; uibutton *cancelbutton = [uibutton buttonwithtype:uibuttontyperoundedrect]; // [cancelbutton settitle:@"cancel" forstate:uicontrolstatenormal]; [cancelbu

c# - Entity framework creating separate database corresponding to each class in model -

i have start using of entity framework in asp.net mvc4. i have created 3 classes in model folder , created controllers every model. now when run application, has created separate databases corresponding every class of model. is there way can use 1 database? are creating separate context each of classes? public class employee { [key] public int empid { get; set; } // < can make suggestion here // , suggest use id rather // empid? looks better referring // employee.id rather employee.empid [required] public string fullname { get; set; } ... } public class anotherclass { ... } and listing models in context: public mydbcontext : dbcontext { public dbset<employee> employees { get; set; } public dbset<anotherclass> anotherclasses { get; set; } } you may want specify connection string name using constr

jQuery Isotope Combination Filters with BBQ Hash History - Highlight filter options when stepping through history -

i have page using excellent isotope , bbq jquery plugins. have followed combo filters , has history demo/test amongst other things, cannot figure out how filters select when stepping through page history (as seen on regular hash history demo). here's complete js code: // modified isotope methods gutters in masonry $.isotope.prototype._getmasonryguttercolumns = function() { var gutter = this.options.masonry && this.options.masonry.gutterwidth || 0; containerwidth = this.element.width(); this.masonry.columnwidth = this.options.masonry && this.options.masonry.columnwidth || // or use size of first item this.$filteredatoms.outerwidth(true) || // if there's no items, use size of container containerwidth; this.masonry.columnwidth += gutter; this.masonry.cols = math.floor( ( containerwidth + gutter ) / this.masonry.columnwidth ); this.masonry.cols = mat

eclipse - How to generate package structure from standalone *.java source files? -

i've been searching answer problem can't find relevant information, i'm asking. i've directory contains thousands of java classes source code (*.java files). each of files contains information package file belongs, classnames + code of course. need find function of eclipse ide (or maybe of ide) able reconstruct packages under 'src' directory based on information in class files , bring me java project structure restored packages , classes can imported new java project then. creating structure of packages manually take me (maybe) lot of days... for clarification: i have: directory contains: 1.java, 2.java, 3. java, n.java... i need: directory contain: [src] -> [package_1] -> [1.java, 2.java, etc...] ... [src] -> [package_m] -> [3.java, n.java] i think must possible somehow each class file contains information package belongs actually. just if find no better solution: @ least can import sources project in eclipse , have eclipse m

What is the use of the following colon in javascript -

following code block executed successfully. wondering use of labeling other using loops? <script> js: { alert("x"); } </script> this how mark labels, bad practice give ability implement old 'goto', simple jump code in sequential executing

php - Netbeans: Creating a Project Concept versus Opening Files -

i'm having little trouble understanding couple of concepts. i new netbeans , using php development. using jedit. in jedit, open file browser , start editing files. in netbeans, wants me create projects , import files. my questions are: when import project, sets data files netbeans needs , leaves original directory in tact, correct? noticed open , edit project , affected original. sometimes switch between projects , want view /www/ directory of wamp server grab files, @ past projects, etc. why can't this? (must import projects see /www/ folder) what point between creating project versus opening files? thanks all! the point of creating project vs opening files in editor netbeans knows these files go together. part of same project. allows you, instance, refactor function names or class names , have netbeans automatically apply changes everywhere used within project. if create project existing sources, existing files ones you're editing. if have fil

javascript - How to append a chunk of html to a loaded html page using window.open() method -

i'm trying append chunk of html loaded html page via window.open() method. example chunk of html string. var w = window.open('mypage.html, 'windowname', 'scrollbars=yes,location=no,toolbar=no,status=no,width=500,height=550,left=300,top=50'); var htmlchunk = '<span>bla bla</span>' $(w.document.body).append( htmlchunk ); $(w.document.body) doesn't seem able body tag on mypage.html inside popup. i tried using ready method. $(w.document.body).ready(function(){ $(this).find('body').append(htmlchunk); }); this didn't work either appending window below popup. just clear here i'm not looking add js mypage.html directly. need able access popup mypage.html body tag , append chunk of html that. setup, have js file inside main.html page. in main.html page have link has click event on setup inside js file. call popup , capture block of html main.html page append mypage.html inside popup. you can

javascript - My code is not loading images -

i'm having issue code acknowledges correct objects pull in. however, when test file images not being pulled in @ all. i've double checked , i'm getting 404 response, files exist in correct directory. //json object sample below, separate file.... var reviews = [{ id: "ajjhwejkssl", title: "the little camera could!", rating: 5, body: "text here", createdate: new date(2012, 5, 23, 14, 12, 10, 0), owner: { id: "kwergiueerwq", name: "bugs bunny", url: "./users.html?id=kwergiueerwq", avatarimage: "./avatars/bugsbunny.jpg", isfeaturedreviewer: false, createdate: new date(2012, 2, 12, 9, 44, 0, 0) } } ] //code var data = reviews; $(document).ready(function () { //console.log("browser: " + browser); (var = 0; < data.length; i++) { try {

php - Is it possible to use Doctrine with persistent PDO connections? -

i'm trying improve performance on volkszaehler.org implementation enabling persistent db connections. having hacked included doctrine's connection class have pdo::attr_persistent => true , i'm getting pdo error general error: pdo::attr_statement_class cannot used persistent pdo instances" is there way fix this? you pass own pdo instance doctrine, setting persistent connection yourself: $dbh = new pdo('mysql:host=localhost;dbname=test', $user, $pass, array( pdo::attr_persistent => true )); $config = new \doctrine\dbal\configuration(); $connectionparams = array( 'dbname' => 'mydb', 'user' => 'user', 'password' => 'secret', 'host' => 'localhost', 'pdo' => $dbh, ); $conn = \doctrine\dbal\drivermanager::getconnection($connectionparams, $config); be sure know implications of using persistent connections pdo: what disadvantages of u

c - 3d array as function argument -

i have function takes 2d-array argument. have 3d-array e.g. temp[5][100][100] . want pass 2d portion of array function. how can this? int inteference_sets(int array[][],int array_size,int max_channel){ //function codes } int main(){ int k; int temp[5][100][100]; for(k=1;k<=4;k++){ interference_sets(temp[k], , ) //this how program intends work } } is possible? if yes, how? #define dim1 100 #define dim2 100 int inteference_sets(int (*array)[dim2], int array_size, int max_channel) { int row, col; for( row = 0; row < array_size; row++ ) { for( col = 0; col < dim2; col++ ) { int value = array[row][col]; //function codes } } } int main() { int k; int temp[5][dim1][dim2]; for(k=1;k<=4;k++) { interference_sets(temp[k], dim1, ) //this how program intends work } }

javascript - How to disable all links inside a nested ul, except for the ones at the lowest level? -

let's have list, this: <ul> <li><a href="sitepages/introduction.aspx">introduction</a> <ul> <li><a href="sitepages/aboutme.aspx">about me</a></li> <li><a href="sitepages/aboutthecompany.aspx">about company</a> <ul> <li><a href="sitepages/history.aspx">history</a></li> <li><a href="sitepages/locations.aspx">locations</a> <ul> <li><a href="sitepages/belgium.aspx">belgium</a></li> <li><a href="sitepages/france.aspx">france</a></li> <li><a href="sitepages/germany.aspx">germany</a></li> <li><a href="sitepages/norway.a

wpf - Using Google Analytics from a .NET desktop application -

is possible send "pageviews" , record activity using official google api c#? instance, if want track page views wpf/winforms desktop app. ? where can find oficial examples? i've downloaded "garlic" , tried sample app , works treat! https://github.com/dustyburwell/garlic

ClearCase checkout version not selected by config spec -

from snapshot view using base clearcase, want checkout latest version of file branch not selected in snapshot view. expect possible, because can version tree browser tool. however, the documentation checkout command claims can't in snapshot (emphasis mine): [ edit: yes can! see below.] nonstandard checkouts by default, checkout command checks out these versions: the recent version on branch, if using dynamic view the version loaded in view, if using snapshot view to modify different version, can either use –version option or create subbranch @ version. (see mkbranch reference page). furthermore, single view, can have 1 checkout per element @ time. note: when work in snapshot view, version of directory element can checked out version loaded in view. therefore, –version , –branch options not work. how can check out unselected version command line? [ edit: here misread "note:" section. means directories can