Posts

c# - Loading Xml File Into Section, Key and Value Collection -

we have settings file xml extending pluggable modules writing. want use our existing xml settings allow extension methods written on them. long story short if had xml file so: <settings> <settingsone key1_1="value1" key1_2="value2" /> <settingstwo key2_1="value1" key2_2="value2" /> </settings> how load collection of settingsentry settingsentry looked so: public class settingsentry { public string section { get; set; } public string key { get; set; } public string value { get; set; } } where section "settingsone", key "key1_1" , value "value1". is possible or going down dark path? edit: ok suggestion of linq xml life save, trying xmlserializer! below have far, there way turn single select rather 2 have below: var root = xelement.load(pathtoxml); var sections = el in root.elements() select el.name; l...

ios - Detect when a webview video becomes fullscreen on ios8 -

i have app users can open videos uiwebview, including youtube ones. in ios7, able notification when started playing, or when became full screen, vital me show options user , modify interface. i used use this: [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videoexitfullscreen:) name:@"uimovieplayercontrollerdidexitfullscreennotification" object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videoenterfullscreen:) name:@"uimovieplayercontrollerdidenterfullscreennotification" object:nil]; however, since ios8, can't achieve this. notification no longer triggered uiwebview videos. however, still triggered normal videos, non-webview, i've tested. any idea of have changed? this work around found this.. [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videoexitfullscreen:) ...

Sqlite database connection with c# -

hi developing windows phone app , using sqlite db , first step created login page. once close application database not persist , end creating db evertime app opens followed adding values. how make persistent , retain values instead of adding them again , again? thanks av save database file in isolated storage . place should save application data need persist next executions

python - How to return the total count of a database entity when one of its rows matches a condition -

i have list of numbers i’m looping through identify if entity in database table matches @ least 1 of these numbers, if so, want count how many times these entities appear in table , return entities along number of time in table. entities may match 1 or more numbers, can duplicate data using pythons set(), unless there’s better way it. so example list = [a, b, c, d] # unknown number of entries column 1 column 2 column3 etc blue blue - blue green - red red b red c red c red - red - so im trying return: blue, 3 red, 6 the closest i've been able below, not yielding desired resutls. for letter in list: c.execute('select colour, count(*) table group colour having letter=?', [(letter)]) i'm not sure how proceed this, advice appreciated. in responce @cl. this kind of data returning. later nest in list contains correct values, ...

javascript - AngularJS - Sorting ng-repeat on string with numbers in them -

i have list of objects in table-view sort properly. amongst other things, objects contain name-field. name field can contain numbers, example: chairman seat 1 seat 2 seat 3 seat 11 seat 12 seat 23 secretary this sorted this: chairman seat 1 seat 11 seat 12 seat 2 seat 23 seat 3 secretary this doesn't seem natural way of sorting list when sorting name. now i'm using ng-repeat this: seat in seats | orderby:orderfield:orderreverse track seat.id orderfield variable set when clicking table header , orderreverse reversing. i've tried making custom filter makes sure behaves failed. seems javascript won't order unless break string. i'd rather not because data updated polling. way force leading zero's since users entering stuff manually i'm not sure if should. also, not names numbers in them, can't cut them off so, suggestions on how make list show normally? edit: cleared info problem. you can use custom sort function orderby (...

ios - UITableView inside UIViewControllerView unexpected margins -

Image
i have normal uiviewcontroller on storyboard standard uiview contains 1 child - uitableview when adding constraints between uiview , uitableview ( equal widths, equla heights, vertical space 0 top layout guide, horizontal space 0 leading margin ) result table view should fill it's parent. instead table view appears have left , top margins (16 , 64). size inspector shows table views alignment rectangle follows x=16,y=64,width=600,height=600 although constraints have constants set 0's. when try edit manually alignment rectangle keep getting misplaced views warnig try restore previous values. any idea might cause of strange behaviour? click view want remove margins. open contraint editor uncheck prefer margin relative :

ruby on rails - Sending arrays of arrays as parameter and then again looping though each array -

i have scenario sending notification mail users.hence need info such useremail,videocount,imagecount,videoids,imageids etc , send usermailer send mail.i want simplify process sending required parameters method , again looping through each array of arrays. example:- ###########the below code in loop of users################ user.signed_in_users.find_in_batches(:batch_size => 100 ) { |users| users.each { |user| vcount=video.where(:users_notified=>f).count icount=image.where(:users_notified=>f).count acount=audio.where(:users_notified=>f).count @count << vcount + icount + acount vcat=###all video categories icat=###all image categories acat=###all audio categories @cats << vcat + icat + acat...and many more ###########now sending these parameter mailer(array of arrays) ####how can simplify call usermailer.notify_user(user.email,@video_cat,@video_count,@image_cat,@image_count,@audio_cat,@audio_count,@...