Posts

python - Group m groups with regex -

i have regex replaces letter n (\w{1,}) -- meaning word can stand in letter n. want make group out of m instances of (\w{1,}) -- i.e add parens around m instances of (\w{1,}) , this: "(" + "(\w{1,}), (\w{1,}), (\w{1,}) .... (\w{1,})" + ")", (\w{1,}) occurs m times how can that? know like re.sub(\w{1,}){2,}, inputstring, "(" + many instances of (\w{1,}) pattern able match + ")) how express, in regex, pattern matched m times? (so can replace, surrounded parenthesis). if understand question correctly, you're writing 1 regex produce regex. is, you're using regex replacement build pattern regex search. input includes kind of wildcard value (e.g. "n" ) need replace create search pattern. in search pattern, adjacent wildcard values should combined single capturing group (so "n n bacon n" give 2 capturing groups, 1 first 2 words , 1 more last). think can if first capture adjacent wildcards, substitut...

asp.net - Unable to access Public properties of usercontrol from aspx in vb -

i have googled , saw post of other users same problem. of post have same solution. followed steps , codes still can't solve problem. still i'm not able access declared properties. i'm new vb.net, pardon if stupid question. here code usercontrol public class customusercontrols dim msg string dim innermsg string dim modal boolean public property setmessage() string return msg end set(value string) msg = value end set end property public property setinnermsg() string return innermsg end set(value string) innermsg = value end set end property public property popupmodal() boolean return modal end set(value boolean) modal = value end set end property end class this usercontrol design code: <%@ control language="vb" autoeventwireup="false" codefile="showmessagecontrol.ascx.vb" inherits="usercontrols_showmessagecontrol" %> ...

sql - How to use GROUP with DATEPART? -

i using following script count number of shopid 1 year. i need breakdown result month year. so end result should be month 1 shopid 5 100 shopid 4 90 month 2 shopid 1 150 shopid 4 80 select shopid, count(shopid) interest dbo.analytics datecreated >= '2014' , datecreated < '2015' group shopid order interest desc table structure create table analytics ( datecreated datetime2(2), shopid int ); what should change in script? shall use datepart near group by you can use datepart . try this select datepart(mm,datecreated) 'month',shopid, count(shopid) interest dbo.analytics year(datecreated) = '2015' group datepart(mm,datecreated),shopid order interest desc datepart return month number only. if need result have month name should use datename try this select select datename( month , dateadd( month , datepart(mm,datecreated) , -1 ) ) 'month...

Android Studio Androidmanifest.xml contains garbage characters -

i creating app on android studio 0.6.1. androidmanifest.xml file contains special characters , shows manifest file read only. when building app error "failure [install_parse_failed_manifest_malformed]". on windows 7 64 bit. can run app on emulator without manifest file? please help!

c++ - Extract one object from set of objects -

Image
i want extract 1 leaf bunch of leaves detect features using opencv (c++). first tried find edges of image , extract 1 object. see question here ., seems way not going work. want extract 1 leaf image taken in real environment of plant (see following example image example. image going process not known user has take image , upload system) as example consider want cut off leaf marked red line. can proceed identify features of leaf. can 1 please suggest step step method this. i'm using opencv , c++ language. thank in advance.

javascript - Multiple values of same JSON Tag -

i have 1 json object coming html transferring javascript function defined below. problem getting same foldername listed in repition on html page. json object: { "foldername": "arjunram-test", "objects": [ { "keyname": "shadowbalancemismatch_april.csv", "keyvalue": "shadowbalancemismatch_april.csv" }, { "keyname": "rawlogs.txt", "keyvalue": "rawlogs.txt" }, { "keyname": "expiredpoints.txt", "keyvalue": "expiredpoints.txt" } ], "childdirs": [ { "foldername": "20140601.csv", "objects": [ { "keyname": "expiredpoints.txt", "keyvalue": "201406...

jquery - How do I save article ids in Javascript or HTML? -

i have list of links in web-page , users can click , comment on them. load links via json , each link uniquely identified id. my question how know link has been clicked? though have id, store it(if javascript object, how?)? guess cannot have tag attribute because users may change it. it sounds want able create link page specific id, without displaying id? if case, think you'll face difficulties doing in simple way, javascript client-side , user able alter id anyway. i'd recommend keeping id in link ( <a href="url.com/post/42> , example) , rather, when page loaded, in way or another, check if provided url valid, existing id.