Posts

c# 4.0 - Does the C# compiler hoist variable declarations out of methods called within loops? -

i have method calls helper method within for loop. helper method contains relatively expensive variable declaration , definition involves reflection (see below.) i'm wondering if compiler can counted on inline method call , hoist declaration , definition out of loop, or if need refactor method in order guarantee definition statement isn't executed each iteration. private class1[] buildclass1arrayfromtestdata() { var class1count = int.parse(testcontextinstance.datarow["class1[]"].tostring()); var class1s = new list<class1>(class1count); (var c = 0; c < class1count; c++) { class1s.add(buildclass1fromtestdata(string.format("class1[{0}]", c))); } return class1s.toarray(); } private class1 buildclass1fromtestdata(string testcontextname) { datacolumncollection columns = testcontextinstance.datarow.table.columns; var class1fields = typeof(class1).getfields(); var class1object = new class1(); forea...

javascript - Parenthesis and Quotes - is it really this simple? -

if (url) { var parsedurl = new url(url); s.evar17 = parsedurl.href; s.evar19 = parsedurl.host; s.linktrackvars = 'prop6,evar6,prop4,evar5,evar17,evar19'; var ppvarray = s.getpercentpageviewed(s.pagename); s.evar6 = s.prop6 = ppvarray[1] + "|" + ppvarray[2] + "|" + ppvarray[3]; } as feel enough javascript, encounter stumps me. can't figure out why piece of code not firing. supposed track visitors website exit site , visit first page of new website. websites specific , linked on site. code pulls url can keep track of how many visits new site gets. i believe should have parenthesis around defined of s.linktrackvars. , double quotes. can give me clues lead me in right direction? here's think should be: s.linktrackvars=("prop6, evar6, prop4, evar5, evar17, evar19"); thanks! misty sounds dealing serilization , deserilization of array of objects; , code should read like; var linktrackvars = { ev...

asp.net - Remove .aspx extension visual studio 2012 -

i'm trying edit web.config roadsunknown's code (from post remove html or aspx extension ): <rewrite> <rules> <rule name="rewriteaspx"> <match url="(.*)" /> <conditions logicalgrouping="matchall"> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_filename}" matchtype="isdirectory" negate="true" /> </conditions> <action type="rewrite" url="{r:1}.aspx" /> </rule> </rules> </rewrite> when add code following error: warning 1 element 'system.web' has invalid child element 'rewrite'. i have iis url rewrite 2.0 installed , have executed script on blog ( http://blog.vanmeeuwen-online.nl/2013/04/visual-studio-2012-xml-intellisense-for.html )...

jboss - Is Redhat moving away from HornetQ to ActiveMQ? -

hornetq, open source message implementation created redhat promoted part of redhat's jboss application server. hornetq strong contender apachemq when launched. i going through jboss fuse documentation , realized "active mq" used messaging technology. (i know jboss fuse developed on apache camel) my question is, "is redhat moving away hornetq? or use both implementations in products?". have not seen official announcement replacing "hornetq" "activemq", wanted find out steps. i have been using "horntq" native jboss, because of arrival of many new components project, looking adopt jboss fuse esb. , observed major difference in messaging systems. as used jms, hope there not major changes required queue/factory/messaging related config. new applications developed using jboss, recommended use activemq hornetq?

enable 'sudo' to rm wild repo (gitolite) -

i need delete wild repo, don't have enough privileges so, though gitolite admin user, , have no public key of creator of repo (as it's on physical machine, have no access to). read 'sudo' command, don't know supposed enable it, , how. suppose should in .gitolite.rc file?! does know how this? thanks. regarding sudo command (introduced in gitolite v3.04, 2012-06-27 ): sudo -- allows admin (i.e., has push rights ' gitolite-admin ' repo) run remote command other user. this useful, example, when user claims unable access repo, , need check 'info' output him, etc. however, not work other way, sorry! the source includes way command activated, using gitolite query-rc command : # figure out if command allowed remote user gitolite query-rc -q commands $cmd || die "command '$cmd' not allowed" gitolite $cmd "$@" you need add ' sudo ' list of enabled command in .gitolite.rc on gitolite se...

c# - Html Agility Pack get contents from table -

i need location, address, , phone number " http://anytimefitness.com/find-gym/list/al " far have this... htmldocument htmldoc = new htmldocument(); htmldoc.optionfixnestedtags = true; htmldoc.loadhtml(stateurls[0].tostring()); var blanknode = htmldoc.documentnode.selectnodes("/div[@class='segmentwhite']/table[@style='width: 100%;']//tr[@class='']"); var graynode = htmldoc.documentnode.selectnodes("/div[@class='segmentwhite']/table[@style='width: 100%;']//tr[@class='gray_bk']"); i have looked around stackoverflow while none of present post regarding htmlagilitypack has helped. have have been using http://www.w3schools.com/xpath/xpath_syntax.asp since <div> you're after not direct child of root node, need use // instead of / . can combine xpath blanknode , graynode using or operator, example : var htmlweb = new htmlweb(); htmldocument ht...

mongodb - Bug on line 52 of my javascript code and i can't figure it out -

i'm using below javascript code in appery.io app. keep getting error states following: 6/25/2014 9:37:35 pm: script all_users_data: typeerror: cannot read property '_id' of undefined ( @ 52 : 33 ) -> if (all_photo[i].the_user._id == id) { please me identify bug. i'm attempting pull data 3 collections, sync them _id 'users' collection , output user profile type information. var all_users = eval(databaseuser.query('52895ecce4b056c5e94f34f9')); var all_profiles = eval(collection.query('52895ecce4b056c5e94f34f9', 'profile')); var all_status = eval(collection.query('52895ecce4b056c5e94f34f9', 'status')); var all_photo = eval(collection.query('52895ecce4b056c5e94f34f9', 'photo')); // loop on users (var i=0;i<all_users.length;i++) { // call function search user profile , add first name current user item getprofile(all_users[i]._id, all_users[i]); // call function se...