Posts

c# - replace static AutoMapper API; replace a Map method inside a Profile -

i'm replacing static automapper api: so, before had profile like: public class digitalresourceprofile : automapper.profile { protected override void configure() { automapper.mapper.createmap<dto, domain>(); automapper.mapper.createmap<domain, dto>() .formember(dst => dst.attachs, opts => opts.mapfrom(src => automapper.mapper.map<list<attachdomain>, list<attachdto>>(src.attachs))) .formember(dst => dst.timestamp, opts => opts.mapfrom(s => s.timestamp.touniversaltime())); automapper.mapper.createmap<attachdto, attachdomain>(); automapper.mapper.createmap<attachdomain, attachdto>() .formember(dst => dst.timestamp, opts => opts.mapfrom(s => s.timestamp.touniversaltime())); } } from on, profile class like: public class digitalresourceprofile : automapper.profile { protected override void configure() { this.cr...

python - creating a new list by copying from an old list -

this first post here, please excuse me if not make myself clear. searched problem beforehand, didn't know terms phrase in. code part of larger program, tried cutting out other variables , problem still remains: what want create function categorizes list of numbers in 7-number sublists. there must 1 sublist each item in 'player' list, why copied player list , ran loop replace each element (previously names of players) corresponding 7 numbers. number of sets there should drawn 'player' list, , numbers drawn 'playermodifier' list, both of defined elsewhere in program. players=['paul', 'darren'] playermodifiers=[4,5,7,2,8,4,7,3,9,4,6,2,6,4] def modifiersort(): n=1 global playermodifierssort global playermodifiers playermodifierssort=players x in playermodifierssort: playermodifierssort[n-1]=playermodifiers[7*(n-1):7*n] n=n+1 playermodifiers=playermodifierssort this sorts list want to, however, som...

colors - Apply grayscale effect to a javafx application -

is possible apply effect whole application change color? apply grayscale example. i have seen [coloradjust][1] effect i'm not sure can use grayscale effect. in fact, it's pretty simple. apply effect whole application, use seteffect method on root node. grayscale effect, set saturation of coloradjust value -1 coloradjust grayscale = new coloradjust(); grayscale.setsaturation(-1); stage.getscene().getroot().seteffect(grayscale);

java - How to restrict queries fired by quartz-scheduler -

i have quartz scheduler spring part of application, deployed in clustered environment. problem quartz keeps firing lot of queries (hundreds per minute) though jobs scheduled run once per hour (the jobs triggered correctly). there way avoid/delay these quartz queries? edit: adding queries fired quartz update qrtz_triggers set trigger_state = 'acquired' sched_name = 'sw_quartz_scheduler' , trigger_name = 'createcrontriggerfactorybeanforpsdjob' , trigger_group = 'spring3-quartz' , trigger_state = 'waiting' insert qrtz_fired_triggers (sched_name, entry_id, trigger_name, trigger_group, instance_name, fired_time, state, job_name, job_group, is_nonconcurrent, requests_recovery, priority) values('sw_quartz_scheduler', 'sw-jayz-5413692078375651369207837517', 'createcrontriggerfactorybeanforpsdjob', 'spring3-quartz', 'sw-jayz-541369207837565', 1369207800000, 'acquired', null, null, 0, 0, 0) select *...

php - elm and database transactions -

i have static website content rendered elm. right data hard-coded elm source code. in future add small amount of database interaction project. the web server use support mysql databases , php. i thinking nice able use get function in elm http package point php script on server, query database, , return json data elm program interpret , render. i know if: this approach possible there better (more convenient or correct) way what describe way it. see chapter in elm-tutorial covers http://www.elm-tutorial.org/080_fetching_resources/cover.html as alternative seed data in html , pass via ports.

.net - C# SilverLight. The tab key does not change focus for the text boxes -

i have got little problem. i use listbox control textboxes. i set focus on first textbox , try jump on following textbox key tab. not work. what wrong? thanks in advance! <listbox name="box" scrollviewer.horizontalscrollbarvisibility="disabled" background="transparent" borderthickness="0"> <listbox.itemcontainerstyle> <style targettype="listboxitem"> <setter property="template"> <setter.value> <controltemplate> <stackpanel orientation="horizontal" margin="40,2,0,2"> <textblock text="{binding label}" minwidth="20" /> <textbox tabindex="{binding index, mode=oneway}" text="{binding information, mode=twoway}...

r - extracting unique rows of data using dplyr -

this question has answer here: remove duplicated rows 6 answers i'm trying extract rows when b unique value per a . here sample data a <- c(1,1,2,2,3,3,4,4,5,5,5,6,6,7,7,8,8,9,9,9,9,9,10,10,10) b <- c(1,2,1,1,5,5,6,1,1,1,3,2,2,1,1,2,3,1,2,3,4,4,1,2,2) df1 <- data.frame(a, b) and using dplyr package library(dplyr) unique <- df1 %>% group_by(a) %>% filter(n_distinct(b)) the desired output should data frame length 18 we can try library(dplyr) df1 %>% distinct() or in base r unique(df1)