Posts

Showing posts from August, 2013

ldap - Gitlab Active Directory configuration issue -

i've installed gitlab on centos. want configure ldap authentication. in gitlab.rb wrote configurations, made 'reconfigure' , 'ldap:check:gitlab'. finished successfully. however in gitlab while login says 'invalid credentials'. my credentials correct, checked authentication ldap via php. does have suggestions?

c# - How to generate WOPI Access Token from WAC Office Server -

Image
one of our customers want open word documents using office server. installed wac server on-premise open office documents in browser. this document opened in iframe in our system. generate access token wac server using wopi api. did investigation, , found sharepoint doing that. can use httpclient in c# extract value. looks dirty! , i'm sure there better way generate access token? i'm totally new sharepoint , wac server. please help. there wopi api documentation. i'm still confused how build request? check image taken documentation. thank in advance :) you don't need implement /wopibootstrapper endpoint nor getnewaccesstoken method. they're specific office online (365) integration program . your job generate access_token included in post request of wopi frame in application (similarly picture in question). this token used wopi client (wac/owa/oos server). wopi client doesn't need able decipher token or understand in other way. take...

python 2.7 - How to get a data from form in django? -

i have form in template django ok, saves ok in model. well, now, want create new form inside form. form, create inside template, now, want de data save in model. (i can't use formset, i'm ready using it). form create javascript when user click in option inside list. i'm using class-based view create view. my question is, how can data form created dynamically user? <div class="form-group"> <label class="col-sm-2 control-label">{{form.name.label}}</label> <div class="col-sm-10"> {{form.name}} {% if form.name.errors %} <span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="help-block">{{form.name.errors.as_text}}</span> {% endif %} </div> <label class="col-sm-2 control-label">{{form.date_max.label}}</label> <div cla...

replicate curl command python 3 urllib request API -

this problem kind of driving me crazy. i'm doing simple python 3 script manage api in public website. able curl, not in pyhton. can't use either requests library or curl in real environment, tests this working: curl -d "credential_0=xxxx&credential_1=xxxxxx" -c cookiefile.txt https://xxxxxxxxxxxxxxx/login curl -d 'json={"devices" : ["00:1a:1e:29:73:b2","00:1a:1e:29:73:b2"]}' -b cookiefile.txt -v https://xxxxxxxxx/api-path --trace-ascii /dev/stdout and can see in curl debug: send header, 298 bytes (0x12a) 0000: post /api-path http/1.1 0034: host: xxxxxxxxxxxxxxxx 0056: user-agent: curl/7.47.0 006f: accept: / 007c: cookie: csrf_token=751b6bd9-0290-496b-820e-xxxxxxxx; session 00bc: =xxxxxx-6d29-4cf9-8907-xxxxxxxxxxxx 00e3: content-length: 60 00f7: content-type: application/x-www-form-urlencoded 0128: => send data, 60 bytes (0x3c) 0000: json={"devices" : ["00:1a:1e:29:73:b2",...

xpath - How to fetch data by id from parent's sibling element in JasperReports report items list (xml datasource) -

i want create list of order items; each item, want display "item id" , "address line" field; data of former field comes child element on item, data latter must fetched sibling of item's parent using unique id referenced in item. i've created simplified xml data source , report in in order illustrate problem. xml data defined follows: <data> <productorder> <item> <id>10001</id> <installationaddressid>1</installationaddressid> </item> <item> <id>10002</id> <installationaddressid>3</installationaddressid> </item> </productorder> <address> <id>1</id> <addressline>street 1, 12345 berlin germany</addressline> </address> <address> <id>2</id> <addressline>street 2, 12345 berlin germany</addressline> </address> <address> <id...

javascript - How to add plugins to website from GitHub? -

i'm looking add plugins, circletype.js , lettering.js specifically, codepen project , i'm not sure how proceed. i've come across before situation before, find great plugin use, , installation documented "download github". repo on github missing actual steps install. i've tried googling this, search results not related, such installing wordpress plugins. there must standard way install plugins websites, can't seem find on adding plugin github website or codepen project. any appreciated. thank :) you can request files text raw.githubusercontent.com available @ raw option @ repositories https://raw.githubusercontent.com/peterhry/circletype/master/js/circletype.js https://raw.githubusercontent.com/davatron5000/lettering.js/master/jquery.lettering.js then create <script> elements, set .textcontent of <script> element text response, append script document . fetch("/path/to/raw/file") .then(response => r...

python - What would be the most optimised way to access values in a nested array whilst respecting pep8? -

i have been using nested arrays parsed json. ends giving gigantic line each time try access values in data. let's have nested array in var data, when try reach deeper values, still have respect 80 characters limit. want read or modify value. self.data["name1"]["name2"][varwithnumber][varwithnumber2][varwithnumber3] now, thought 2 possible solutions use: 1- split using temporary vars , reasign data once done ex: tempdata=self.data["name1"]["name2"][varwithnumber] tempdata[varwithnumber2][varwithnumber3]+=1 self.data["name1"]["name2"][varwithnumber]=tempdata i guess solution use quite bit of ressources memory copied around. 2- use exec function implemented in python , split string on multiple lines: exec ('self.data'+ '["name1"]'+ '["name2"]'+ '[varwithnumber]'+ '[varwithnumber2]'+ '[varwithnumber3]+=1') i ha...

sql server - How to select Columns using parameters in report builder -

in report builder can select columns using parameters. example : select @field, column2, column3 table_name where @field parameter. also there way this: select @field, column2, sum(column3) on (partition @field) table_name this can done using dynamic sql: create procedure columnreturn @columnname nvarchar(100) declare @sql nvarchar(max) set @sql = 'select [' + @columnname + '] [mytable]' exec (@sql) exec columnreturn 'mycolumn'

javascript - PHP and JS - upload picture not showing -

(i 1 day old php please pardon if repeated) have code upload images uploads/ directory in website folder. done through index.html , upload.php given below , seen php - upload picture , display on page . however, not able display pictures on html page required. redirects upload.php no imageholder there. how that? index.html works fine guessing php settings should fine. followed this , this , this install , setup everything. index.html <!doctype html> <html> <head> <script language= "javascript" type="text/javascript"> function juploadstop(result){ console.log(typeof result); if(result==0){ $(".imageholder").html(""); } else if(result!=0){ $(".imageholder").html("<img src='"+result+"'>"); } } </script> </head> <body> <form action="upload.php" method="post" enctype="multipart/form-data...

php - laravel 5.4 how to get intelligent pagination - with Ajax -

Image
i have following blade temlpate showing records i want pagination first show 10 , show ... when click on next start showing 2 11 intelligent pagination, can me out here my blade template: <!-- pagination start--> <div id="pagination"> <div class="container"> <div class="bt-pagination-main"> <div class="bt-pagination-show"> <span class="page-show">show</span> <span class="page-show-number"> {{form::select('show_per_page', array('10' => '10' ,'25' => '25' ,'50' => '50','100' => '100','200' => '200') , session::get('user_config.show_record'), array( 'class' =>'selectpicker', 'tabindex' =>'7', 'style'=>'width:58px;', 'data-placeho...

github - LoadError: no such file to load -- jruby_pageant -

when begin run below code in gitbash prompt. throwing error there dependency has add or install in windows. tried install ruby doesn't better run snowplow project. ./snowplow-storage-loader loaderror: no such file load -- jruby_pageant require @ org/jruby/rubykernel.java:959 require @ uri:classloader:/meta-inf/jruby.home/lib/ruby/stdlib/rubygems/core_ ext/kernel_require.rb:55 <main> @ uri:classloader:/gems/net-ssh-2.9.4/lib/net/ssh/authentication/agen t/java_pageant.rb:1 require @ org/jruby/rubykernel.java:959 require @ uri:classloader:/meta-inf/jruby.home/lib/ruby/stdlib/rubygems/core_ ext/kernel_require.rb:55 <main>...

On Angular 4, are controllers executed on the browser or server? -

i building angular 4 app. local development running app using ng serve . it seems angular running in browser. ng serve development tool? possible run angular controllers on server , not browser? angular indeed front end framework, , such runs in browser. ng serve runs webpack development server can see application looks without having spin separate webserver , bundle code. when deploy, you'll have existing webserver host angular code, controllers responsible client side (browser) markup. server side routing (controllers on server), wouldn't use angular sort of server side web framework. example, can use nodejs on server side server side controllers (often times these return json data angular app work with).

jquery - How to add/remove options in a single select element with javascript -

i working on jquery project. have form 2 single select elements ie. programtype , programofinterest. programofinterest child of programtype. have placed ajax call inside programtype's change function sends id of selected programtype server, use id query database related programofinterest objects , send javascript. problem have populated programofinterest field data backend. want know whether there way remove/add options single select element using jquery? hint: while working multiple select used uncheck options this var tag_options = document.getelementbyid("category_categoryname").options; for(var = 0; < tag_options.length; i++){ tag_options[i].selected = false; } i hoping can similar add/remove options in single select. ideas? $("#category_categoryname").empty(); clear existing options $("#category_categoryname").find('option[value="1"]').remove(); clear option "value" attribute of 1. $("#...

mongodb - Mongo replace causing duplicates in sub documents c# -

interface nameable { string name { get; set; } } class parent : nameable { public string name { get; set; } public list<child> children { get; set; } = new list<child>(); } class child { public string name { get; set; } public int value { get; set; } public string dataone { get; set; } public string datatwo { get; set; } public double datathree { get; set; } } static async void mainasync(string[] args) { (int = 0; < random.next(10000, 50000); i++) { parents.add(createparent()); } parents = parents.groupby(g => g.name).select(grp => grp.first()).tolist(); foreach (var parent in parents) { await insert<parent>(parent); } // update objects randomly; foreach (var parent in parents) { (int = 0; < random.next(10, 30); i++) { int decision = random.next(0, 2); ...

java - How i update android app sql lite database on app update -

i have created android app have used local sql lite database. works fine. when updating version on play store , changing sql lite table app getting crashed. how update sql lite data base? local data important. how fix this? if have modified database structure e.g. have added columns , new version of code utilises new columns have apply updates database. the conventional way utilise onupgrade method if using subclass of sqliteopenhelper class. beware many examples drop table(s) , create new tables. e.g. @override public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { db.execsql("drop table if exists " + daily_stats_table); oncreate(db); } note! not save data. the onupgrade method invoked if database's version number increased (there ondowngrade method invoked if version number reduced. e.g. may have code like; private static final int database_version = 1; private static final string database_name = ...

amazon web services - Dynamic load balancing with reverse SSH tunnels on different ports using AWS -

i working on project more 50 thousand devices need communicate server using reverse ssh tunneling. these devices generating, , moving heavy traffic across these ports, hence consuming heavy network , cpu on server. i using aws ec2 stack, , have chosen moderate server start (4 cpu cores , 16 gb ram). since single server not capable of 50 thousand + connections, must find way load balance traffic somehow. assuming each ec2 instance can support 500 reverse ssh connections, without choking, require 50000/500 = 100 servers (for 50k devices: let’s assume hard target now). while going require 100 servers, increase of devices gradual, don't require 100 servers day one. this count should increase gradually, number of devices increase, communicate server. the obvious way handle elastic load balancing, or maybe elastic ip (both concepts bit different elb way go). but elb work on normal communication protocols, such http/https/tcp. my scenario bit different: each device a...

javascript - Stack navigator giving me undefined error -

Image
i'm using https://facebook.github.io/react-native/docs/navigation.html way. i'm trying use stacknavigator go login.js aboutdendro.js . what's wrong in <button/> component that's throwing error in ios simulator? here's login.js : import react, { component } 'react'; import { connect } 'react-redux'; import { scrollview, text, textinput, view, button, stylesheet } 'react-native'; import { login } '../redux/actions/auth'; import {authenticationdetails, cognitouser, cognitouserattribute, cognitouserpool} '../lib/aws-cognito-identity'; import stacknavigator 'react-navigation'; import aboutdendro './aboutdendro'; const awscognitosettings = { userpoolid: 'something', clientid: 'something' }; class login extends component { constructor (props) { super(props); this.state = { page: 'login', username: '', ...

wpf - How to connect MouseDoubleClick to ViewModel in an Attached Behavior? -

i trying implement attached behaviors functionality in mvvm pattern. have calendar control , handle mousedoubleclick event. doing using system.windows.interactivity , interaction.triggers . however, using blackoutdates in calendar , double-clicking on blackout date results in last valid selected date being passed mousedoubleclick method, not date clicked on. so targeting calendardaybutton , me date clicked on, cdb doesn't have commands , need use attached behavior. i'm still not understanding how mousedoubleclick handler info viewmodel. current code: view <calendar horizontalalignment="left" verticalalignment="top" margin="20,48,0,0" selecteddate="{binding reportdate, mode=twoway, updatesourcetrigger=propertychanged}" displaydatestart="{binding reportdatestart, mode=onetime}" displaydateend="{binding reportdateend, mode=onetime}" local:attachedproperties....

css - Correction to ng2-opd-popup -

Image
when add form window arranged this: but need: in file: popup.component.html: <div id="ng2-opd-popup-main" *ngif="visible" [ngclass]="mainclass" [ngstyle]="mainstyle"> <div class="row"> <div style="display: inline-block;width:100%"> <div id="ng2-opd-popup-well" [ngstyle]="wellstyle" class="ng2-opd-popup-well ng2-opd-popup-well-sm"> {{popupservice.options.header}} </div> </div> <div style="margin:20px;"> <ng-content></ng-content> <div *ngif="popupservice.options.showbuttons" style="margin-bottom:20px;margin-top:20px;float: right"> <button id="cancelbtn" [ngclass]="cancelbtnstyle" type="reset" (click)="confirmno()"...

Python 3 - for x in <list> : Not iterating over entire <list> -

this question has answer here: strange result when removing item list [duplicate] 4 answers remove items list while iterating 18 answers code: a=[1,2,3,4,5,6,7,8,9] x in a: print(x) output: 1 2 3 4 5 6 7 8 9 here behaviour expected , each element of list iterated over code: a=[1,2,3,4,5,6,7,8,9] x in a: print('x=' + str(x) if x<= 5: print('less 5') a.remove(x) print('a=' + str(a) output: x=1 less 5 a=[2, 3, 4, 5, 6, 7, 8, 9] x=3 less 5 a=[2, 4, 5, 6, 7, 8, 9] x=5 less 5 a=[2, 4, 6, 7, 8, 9] x=7 x=8 x=9 here behaviour unexpected , not elements of list iterated over. causing unexpected behaviour? i'm using pre-installed python 3.5.2 on linuxmint-18.2-xfce-64bit

algorithm - python combinations of multiple list -

is there pythonic method generate combinations between multiple list? (similar cartesian product more complicated) example: a = [1, 2, 3] b = [4, 5, 6] c = [7, 8, 9] # ... # there more 3 lists expected output: 1. [(1, 4, 7), (2, 5, 8), (3, 6, 9)] 2. [(1, 4, 8), (2, 5, 7), (3, 6, 9)] 3. [(1, 4, 9), (2, 5, 7), (3, 6, 8)] 4. [(1, 5, 7), (2, 4, 8), (3, 6, 9)] 5. ... update: thanks quick reply~!! to clarify question: the result non-repeated combinations of cartesian product of list a, b, c. it can done ugly method: 1) generate whole list of cartesian product from itertools import product, combinations, chain t = list(product(a, b, c)) 2) using combinations generate possible results p = list(combinations(t, 3)) 3) filter repeated conditions cnt = len(list(chain(a, b, c))) f = [x x in p if len(set(chain(*x))) == cnt] update2: expected result generated ugly method: ((1, 4, 7), (2, 5, 8), (3, 6, 9)) ((1, 4, 7), (2, 5, 9), (3, 6, 8)) ((1, 4, 7), (2, 6, 8),...

php - sonataadmin bundle FILTERING FIELDS AND CASE SENSITIVITY Not working . No attached service to type named `doctrine_phpcr_string` -

i try create case insensitive filtering using sonataadmin bundle , symfony 2 error. "symfony/symfony": "2.6.*" "sonata-project/admin-bundle": "^2.3", here adminclass protected function configuredatagridfilters(datagridmapper $datagridmapper) { $datagridmapper ->add('name', 'doctrine_phpcr_string', array( 'compare_case_insensitiv' => false )) ; } here documentation https://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/reference/filter_field_definition.html#filtering-fields-and-case-sensitivity here error no attached service type named `doctrine_phpcr_string` here solution :) protected function configuredatagridfilters(datagridmapper $datagridmapper) { $datagridmapper ->add('name', 'doctrine_orm_callback', array('callback' => array($this, 'yourfunction'), ...

javascript - Youtube Iframe API - Videos not loading -

edit: here jsfiddle : http://jsfiddle.net/sr4u1b0a i trying figure out how use youtube api. newbie @ this, i'm sorry if there simple solution. i believe added necessary code make work, won't load video. https://codepen.io/brianpensinger/pen/zdxzjj head: <script src="https://youtube.com/iframe_api" type="text/javascript"></script> <script type="text/javascript"> var player2; function onyoutubeiframeapiready() { player2 = new yt.player("video-placeholder2", { width: 1920, height: 1080, videoid: "im_kmyuli_s", playervars: { modestbranding: 1, rel: 0 }, events: { onready: initialize } }); } function initialize() { setplaybackquality(highres); loadvideobyid(im_kmyuli_s, parseint(0), highres); setplaybackrate(2); } </script> <script type="text/javas...

laravel - Error on POST Request -

Image
i developing in laravel 5.3. when reviewing routes, have following: here indicates routes post. if in postman enter url (post), throw following error the strangest thing on local server works fine, error occurred me on production server. my code is: api.php route::group(['middleware' => ['api', 'auth:api']], function() { require_once 'routes/api/productroute.php'; }); routes/routes/api/userroute.php <?php route::post('user/authenticate', [ 'as' => 'api.user.authenticate', 'uses' => 'api\usercontroller@authenticate' ]); route::post('user/register', [ 'as' => 'api.user.register', 'uses' => 'api\usercontroller@register' ]); /app/http/controllers/api/usercontroller.php public function authenticate(request $request) { $credentials = $request->only('email', 'password'); if (aut...

bash - how to run STRUCTURE command n times for each k value? -

i running structure analysis , set k = {1..10} using command (only 1 run each k): k in seq 10 python /home/ubuntu/bin/faststructure/structure.py -k $k --input=../file.snps --output=snpl525d --format=str done instead of 1 run each k, want 15 runs each k. please me modify code above job? thanks you can use seq call: for k in $(seq 10); run in $(seq 15); python /home/ubuntu/bin/faststructure/structure.py -k $k --input=../file.snps --output=snpl525d --format=str done done

bash - Crontab an alias which runs a specific virtualenv's Python interpreter, why doesn't work? -

hello. i'm trying execute asynchronous django custom command using macos cron jobs nothing seems work. first, tried write bash file sources virtualenv , executes manage.py custom command: #!/bin/bash source "/users/airiefenix//workspaces/ytsm_container/venv/bin/activate" && python /.../manage.py my_command but got file "manage.py", line 17, in <module> "couldn't import django. sure it's installed , (...) so source not working on bash script. tried many methods, including replacing source . (dot operator), splitting script in 2 or more lines, etc. apparently there's no way activate virtualenv bash script gave , made alias $ alias python_ytsm="/users/airiefenix/workspace/ytsm_container/venv/bin/python3.6" running "python_ytsm /.../manage.py my_command" works when add cron list: $ crontab -e cron file: 01 * * * * python_ytsm "/users/airiefenix/workspace/ytsm_container/project/manage....

linux - fbset not working in the console -

i have used fbset set framebuffer device. know when should fbdev. problem following: i have set custom video timing. works okay if use xwindow service, , doesn't work in console mode! can see fbset settings comply target device because can see screen indicates hdmi working, however, can't see console although can see session running. fbset mode "2560x1600-30" # d: 131.996 mhz, h: 48.528 khz, v: 29.900 hz geometry 2560 1600 2560 1600 24 timings 7576 80 48 14 3 32 6 accel true rgba 8/16,8/8,8/0,0/0 endmode the output of xrandr if run xwindow: xrandr --verbose xrandr: failed size of gamma output default screen 0: minimum 2560 x 1600, current 2560 x 1600, maximum 2560 x 1600 default connected 2560x1600+0+0 (0xec) normal (normal) 0mm x 0mm identifier: 0xeb timestamp: 1800388 subpixel: unknown clones: crtc: 0 crtcs: 0 transform: 1.000000 0.000000 0.000000 0.000000 1.000000 0.0000...

java - Java3D: I can't see my triangle -

i'm new java3d , try show triangle, not show up, frame black. if add bg.addchild(new colorcube(0.3)); it shows red square in middle (so showing shapes should work, shouldn't it?) i don't know if problem construction of triangle or other part of view, e.g. triangle not in focus, small, not lit, etc. polygons trianglearray have lit source, or appear matt objects? here code: import com.sun.j3d.utils.geometry.colorcube; import com.sun.j3d.utils.geometry.geometryinfo; import com.sun.j3d.utils.geometry.normalgenerator; import com.sun.j3d.utils.geometry.sphere; import com.sun.j3d.utils.universe.simpleuniverse; import java.awt.borderlayout; import java.awt.color; import java.awt.frame; import java.awt.graphicsconfiguration; import javax.swing.jframe; import javax.media.j3d.*; import javax.vecmath.color3f; import javax.vecmath.color4f; import javax.vecmath.point3d; import javax.vecmath.point3f; import javax.vecmath.vector3f; public class simulator extends frame { poi...

azure - Is there anyway to use cognitive services to detect if a string contains words vs just junk shift chars/gibberish? -

i'm trying find way use cognitive services detect if string contains piece of coherent text or junk. example: sdf#%# asfsds b vs hi name sam. this seems impossible do. had idea of running text through keywords text analysis (which give me keyword of asdsds (how useful!)) , run keyword though bing spell check. i'm not sure going on in the usa seems asfsds english. quite... erm.. dumb. i've tried running similar text through bunch of services (like language detection) , seem convinced gibberish samples 100% coherent english. i'm going quiz ms rep on friday wondering if has achieved using cognitive services? rather binary is-word-or-not question, might consider instead probability of word being gibberish. can choose threshold like. for computing word probalities, might try web language model api . @ joint probability, example. set of words, response looks follows (values body corpus): { "results": [ { "wo...

r - How to display only corresponding computed result and not all results for each row when using [tapply] -

i'm having issues on displaying results. stored 3 vectors dataframe , perform computation , store new vector before combining new vector dataframe. h=c(155,150,165,190,177) w=c(85,90,72,99,55) g=c("f","f","m","f","m") df=data.frame(h,w,g) row.names(df)=c("alpha","bravo","charlie","foxtrot","echo") bmi=tapply(df$w,df$h,function(calc){(df$w/(df$h)^2)*10000}) cbind(df,bmi) and printed result h w g bmi alpha 155 85 f 35.37981, 40.00000, 26.44628, 27.42382, 17.55562 bravo 150 90 f 35.37981, 40.00000, 26.44628, 27.42382, 17.55562 charlie 165 72 m 35.37981, 40.00000, 26.44628, 27.42382, 17.55562 foxtrot 190 99 f 35.37981, 40.00000, 26.44628, 27.42382, 17.55562 echo 177 55 m 35.37981, 40.00000, 26.44628, 27.42382, 17.55562 however, want display h w g bmi alpha 155 85 f 35.37981 bravo 150 90 f 40.00000 ...

html5 - HTML Checkbox not displaying in browser -

i trying place checkbox left of text. code works in codepen.io. this trying create. https://codepen.io/lergent/pen/evawzk i using same code in application not running. code using: <h3>what colors like</h3> <ul> <li><input type="checkbox">red</li> <li><input type="checkbox">green</li> <li><input type="checkbox">blue</li> </ul>

r - ggplot: Order bars in faceted bar chart per facet -

Image
i have dataframe in r want plot in faceted ggplot bar chart. i use code in ggplot: ggplot(data_long, aes(x = partei, y = wert, fill = kat, width=0.75)) + labs(y = "wähleranteil [ % ]", x = null, fill = null) + geom_bar(stat = "identity") + facet_wrap(~kat) + coord_flip() + guides(fill=false) + theme_bw() + theme( strip.background = element_blank(), panel.grid.major = element_line(colour = "grey80"), panel.border = element_blank(), axis.ticks = element_line(size = 0), panel.grid.minor.y = element_blank(), panel.grid.major.y = element_blank() ) + theme(legend.position="bottom") + scale_fill_brewer(palette="set2") this produces chart: you can see last facet in desired descending order. facets ordered in descending order, meaning label order changes. therefore need facets have ...

grails - Requestmap option is not showing in navigation bar -

i unable show 'requestmap' option in navigation bar. did few google searches couldn't fix problem. , using grails 2.5.1 & dependency plugins are: enter image description here compile ":spring-security-core:2.0-rc5" compile ":spring-security-ui:1.0-rc2" i have created domain classes running command s2-quickstart com.domain.pack user role requestmap . i tried few options placing these 2 lines in confi.groovy file per documentation. import grails.plugin.springsecurity.securityconfigtype grails.plugin.springsecurity.securityconfigtype = securityconfigtype.requestmap but when run app redirects me err_too_many_redirects in browser. tried option: springsecurityservice.clearcachedrequestmaps() in bootstrap.groovy file in vain. stuck, appriciated. thanks. def init = { servletcontext -> user testuser = new user(username:'admin', password:'secret', enabled:true).save() role admin = new role(authority: 'role_...

java - Adding blank nodes to a Jena model -

i'm trying populate jena ontology model existing set of triples, of contain blank nodes. want maintain these blank nodes inside new model faithfully can't work out way of adding them jena model. i have been using: statement s = resourcefactory.createstatement(subject, predicate, object); to add new statements model: private ontmodel model = modelfactory.createontologymodel(); model.add(s); but allows types subject, predicate, , object; resource subject, property predicate, rdfnode object. none of these types allow adding of blanknode subject or object such through: node subject = nodefactory.createblanknode(subjectvalue); any suggestions? i've tried using blanknodes resources , creating resource object breaks become classes , not blank nodes. any appreciated, been pulling hair out this. well, if have existing set of triples can read them file using: ontmodel model = modelfactory.createontologymodel(); model.read(new fileinputstream("data...

javascript - Angular filter with OR operator -

i'm trying build filter range slider. is possible set when range slider on 1 of positions show more 1 category? with code below can filter using range, puts on filter first word , nothing more after or operator. can me? $scope.filterrange = filterrange; function filterrange() { if (this.rangemodel == 1) { $scope.categoryfilter = 'web' || 'ecommerce '; // that! } else if(this.rangemodel == 2) { $scope.categoryfilter = 'branding' || 'video'; // that! } ; }; <div ng-repeat="project in projects | filter: {category: categoryfilter}"> i've see other post here, still not getting how can make happen. =( thanks daniel, here's working solution: $scope.projetos = []; $scope.filtrorange = filtrorange; function filtrorange() { if (this.rangemodel == 1) { $scope.categoryfilter = function(projeto) { if (projeto.categoria === 'site institucional' || projeto.categoria...

javascript - onclick variable is not passing to a form -

i'm newbie javascript , i've read assume there better way approach, here goes. i have form onclick such when clear image clicked on in table cell, background pic of cell changes (showing has been selected, or unselected if clicked again). works, want define variable when form's submit button pressed, form variable passed showing whether or not user selected option. the functional javascript found on internet: var curpic1 = 0; window.onload=function() { document.getelementbyid('clear-kayangan').onclick=function() { curpic1 = (curpic1 == 0)? 1 : 0; document.getelementbyid('td_kayangan').style.backgroundimage = (curpic1 == 1)? 'url("pics/map-kayangan-lake-selected.png")' : 'url("pics/map-kayangan-lake.png")'; } } my plan write if statement stating if curpic1 == 1 (the background image chosen shows user has selected), create global variable pass on php in form: $spot1 = "<script...

c# - Set datagrid row background color WPF - Loop -

i have 1 task go throw datagridrow , task. when finish set background color row. added cancel button stop task, , continue button continue finished last time. work perfect except changing background color row. this xaml code, i'm new wpf it's not big datagrid <datagrid name="datagridviewmygroups" grid.row="0" columnwidth="*" verticalscrollbarvisibility="auto" isreadonly="true" selectionunit="fullrow" selectionmode="single" mousedoubleclick="datagridviewmygroups_mousedoubleclick"> </datagrid> here c# code changing background color. datagridrow rowcolor = (datagridrow)datagridviewmygroups.itemcontainergenerator .containerfromindex(number); rowcolor.background = new solidcolorbrush(system.windows.media.color.fromrgb(223, 227, 238)); this code work when click on start button...