Posts

apache spark - Parse complex XML file to get object and its fields -

is there way parse complex xml file child element object fields/members accessible in 1 read? i'm working on code passed me uses dom4j , developer did read each node. object fields , members, read file 4 or 5 times each one. build object have make these calls? takes 15 secs run. maybe dom4j can more 1 element in 1 read of file? is jaxb more that, giving reference object , fields in 1 read? is spark or hadoop better/faster performance wise? you see i'm looking read xml file , extract element child elements, etc build objects in 1 read. let me know work best! since dom4j reads entire file , builds object graph in memory, there shouldn't need "read" file more once. on other hand, if have schema type of document processing, jaxb better alternative.

asp.net mvc - using the same partial view with different buttons -

i have following partial view, lists users in table. each row has enroll button, enrolls user selected course. i need same view task. however, need add users discussions (instead of enrolling them course). know can create view , change enroll buttons add buttons. however, wonder if there more effective way of doing this. approach not seem easy maintain. @model ienumerable<applicationuser> <h4>search results:</h4> <table class="table-condensed" style="font-size:smaller"> @foreach (var item in model) { <tr> <td> @html.displayfor(modelitem => item.firstname) </td> <td> @html.displayfor(modelitem => item.lastname) </td> <td> @html.displayfor(modelitem => item.email) </td> <td> <input class="btn_enroll" data...

python - Write a function substr(stringA,StringB) that returns true if StringA is a subset of StringB,and false otherwise -

actually, can use build in function it, questions requires me use loops, helps? dont have idea using loop solve it. the questions requires me use loops def isin(stringa, stringb): while 7: return stringa in stringb

iphone - Posting message on my wall facebook ios sdk? -

hello trying post message on wall while targeting friend. post on our wall @friendsname .i using code below nsmutabledictionary* params1 = [nsmutabledictionary dictionarywithobjectsandkeys: @"post", @"type", urlqrcode, @"picture", [globals linktoapp], @"link", @"xsxsx", @"name", @"sxsxsxsxsx", @"caption", @"sxsxssx", @"description", messsdsage, @"message", @"friendfbuid", @"to", nil]; [appdelegate.facebook requestwithgraphpath:@"me/feed" andparams:params1 ...

Swift Text Label Nil Even With Default Value -

this driving me crazy. function updatetextview() being called, verified print statements, not setting label in view controller, , print statements label returning nil though has default value set visible when app loaded. whats more perplexing set test button call function separately, , when call test() , label updates properly. class goaldetailviewcontroller: uiviewcontroller, textdelegate { @ibaction func test(sender: anyobject) { updatetextview() } func updatetextview() { print(goalsummarytextbox?.text) print("delegate called") self.goalsummarytextbox?.text = goalsdata.summarytext print(goalsummarytextbox?.text) } @iboutlet weak var goaltitle: uilabel? @iboutlet weak var goalcreationdate: uilabel? @iboutlet weak var goalsummarytextbox: uitextview? override func viewdidload() { super.viewdidload() goalsummarytextbox?.text = goalsdata.summarytext } } updatetextview() bei...

python - glob.iglob to find all .txt files in all sub-directories yields error -

simple code gives below error. it's directly docs ( https://docs.python.org/3/library/glob.html ) typeerror: iglob() got unexpected keyword argument 'recursive' import glob filename in glob.iglob('c:\\**\\*txt', recursive=true): print filename it seems you're using python 2.7 , reading python 3.5 documentation.

rsyslog inside docker containers => "rsyslogd is not running ... failed" -

i running rsyslog within docker containers send udp messages logstash. when log docker container, , type: service rsyslog status shows: rsyslogd not running ... failed! however, while in container, if type: service rsyslog start it starts no errors , no real sign of why failed @ start i can not figure out why failing!!!! *the rsyslog conf file has not been modified except modules allow imfile. rsyslog.conf follows: # /etc/rsyslog.conf configuration file rsyslog. # # more information see # /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html ################# #### modules #### ################# module(load="imfile" pollinginterval="10") module(load="imuxsock" ) # provides support local system logging module(load="immark") #provides --mark-- message capability ########################### #### global directives #### ########################### # # use traditional timestamp ...