Posts

sql server - SQL pivot query error: Unclosed quotation mark -

i have 3 tables (1. emp, 2. onleave,3.daysweeks). im trying write pivot query displyas empname, , calenderdates columns) im getting following error, when try run pivot query. 1.unclosed quotation mark after character string '2016-12-31])) pvt'. 2.incorrect syntax near '2016-12-31])) pvt' declare @cols nvarchar(max), @query nvarchar(max) select @cols = stuff((select ',' + quotename([caldate]) daysweeks xml path(''), type).value('.', 'nvarchar(max)') ,1,1,'') select @query = 'with cte ( select empdays.employee,empdays.caldate, isnull(v.vacationtype,1) leavestatus dbo.onleave v right outer join (select e.empid employee, dw.caldate caldate, dw.dayofweekname downame daysweeks dw, dbo.emp e dw.calyear = 2016 , dw.monthnumber=1) empdays on v.empid = empdays.employee , v.startingdate <= empdays.caldate , v.endingdate >= empdays.caldate ) sele...

java - Trying to bind glide in Xamarin -

i want bind library glide in xamarin, getting stuck on com.bumptech.glide.bitmapoptions . as interface, binds ibitmapoptions , can't find name in namespace. have tried looking in output folder, interface seems have disappeared. i looked @ other errors getting , binding project can't find 2 other interfaces. looked in java code, , see uses <?, ?, ?, ?> generic syntax. is there problem syntax makes cannot bound? if so, how solve this? glide xamarin binding on github: https://github.com/thanhdatbkhn/glidexamarinbinding

asp.net web api - Web API app with OWIN 'SystemWeb' on Azure App Service -

i creating app uses identity 2.1.0 framework in .net. started project in visual studio 2015 empty web app (template). now, use microsoft.aspnet.webapi.owin , , microsoft.owin.host.systemweb nuget packages in project. understand owin specification made avoid monolithic frameworks , specify how smaller application components interact servers. however, have requirement deploy azure app services. i have found examples (blogs) people deploy owin web api app self-hosted azure cloud services worker role. don't want this, don't use cloud service. since using microsoft.owin.host.systemweb , going able deploy azure app service (which assume manages internal iis instance) ? .net ecosystem newbie here - please excuse me possible redundancies in question. microsoft.owin.host.systemweb designed hosting in iis , azure app service web apps hosted in iis, want (in fact, self-hosting won't work azure app service).

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

i'm working on app using core data , nsfetchedresultcontroller many reasons switch use realm. saw there "realm version" of nsfetchedresultcontroller on github wouldn't compatible current code using core data. the view controller displaying list of people same school, address book. list sublist of people studied in same city. so thinking make 1 unique request database retrieve list of people , filter locally list within 1 dictionary per school [string: anyobject] string section name within tableview , anyobject array of people. first solution, make nsfetchedresultcontroller each school predicate filtering location. delete actions etc.. handled delegates -> not compatible realm create dictionaries , update them each actions... -> works realm it's annoying code. any better solution? edit: i need clarify request: i'd write class inherit uitableviewcontroller. this class has list of people sorted in alphabetical order the tableview has ...

swift2 - converting AnyObject to Array list of Strings in swift -

i'm new swift , i'm extracting data parse database. data column stored array in database managed extract anyobject , want display each item. anyobject displaying 1 entry instead of array list class peopletable: uitableviewcontroller { //let textcellidentifier = "textcell" //var window: uiwindow? //let emptyarray: [anyobject] = [] var userfriends: [anyobject] = [] override func viewdidload() { super.viewdidload() queryfortable() print(userfriends) } func queryfortable() { let relationquery = pfquery(classname:"user_info") relationquery.wherekey("userid", equalto:"id123") var userfrnds = try? relationquery.findobjects() eachfriend in userfrnds! { self.userfriends.append(eachfriend["friends"]) } } print(userfriends) command out put : [( rudzani, terrence, thendelano, "big-t", smallboy )] i want out put : rudzani, terrence, thendelano, ...

Ruby Write in CSV file by columns from arrays? -

i generate csv file severals arrays. code: require 'csv' csv.open("csvfile.csv", "ab") |csv| csv << [array1] csv << [array2] csv << [array3] end i need output format: array1,array2,array3 array1,array2,array3 array1,array2,array3 array1,array2,array3 array1,array2,array3 thx help according post, did mean array1, array2, array3 stores values of 3 columns of table, , row index identified index of values in these arrays? can first group columns together, transpose on 2-d array , write csv file row row. require 'csv' table = [array1, array2, array3].transpose csv.open('csvfile.csv', 'ab') |csv| table.each |row| csv << row end end you'll csv file this: array1[0], array2[0], array3[0] array1[1], array2[1], array3[1] array1[2], array2[2], array3[2] ...

php - replace xml/svg element attribute for specific element only -

i have 'xml` this, <text> <tspan fill='rgba(0,0,0,0)'>abc</tspan> </text> <rect fill='rgba(0,0,0,0)'></rect> i trying replace rgba( rgb( , replacing instances occur in data. want replace instances tspan tag only. tried str_replace replacing instances data. output should this <text> <tspan fill='rgb(0,0,0,0)'>abc</tspan> </text> <rect fill='rgba(0,0,0,0)'></rect> try regexp: rgba(?=(.*)<\/tspan>) tested here - regex101 $re = "/rgba(?=(.*)<\\/tspan>)/"; $str = "<text><tspan stroke='' opacity='' fill='rgba(0,0,0,0)'>abc</tspan><tspan fill='rgba(0,0,0,0)'><h1>anything</h1></tspan></text><rect fill='rgba(0,0,0,0)'></rect>"; $subst = "rgb"; $result = preg_replace($re, $subst, $str);