Posts

Showing posts from 2010

Python Eve Conditional / Bulk Delete -

from nicola's answer here , own testing seems clear eve not support conditional deletes @ resource endpoints. i know use get: "where={...}" request _ids , _etags of documents delete, , send out series of requests @ each item endpoint delete them if-match header appropriately set each item's _etag : for each item: delete: http://localhost:5000/items/<item._id> ...but avoid sending out multiple http requests if possible. one solution may predefined database filters , these static filters i'd dynamically filter deletion depending on url parameters. pre-event hooks may solution i'm seeking. does eve support bulk deletion? , if not, recommended way extend eve's functionality provide conditional and/or bulk deletes? i added pre-event hook delete, , seems working tests i've run far: def add_delete_filters(resource, request, lookup): if 'where' in request.args: conditions = request.args.getlist('

R parLapply not parallel -

i'm developing r package using parallel computing solve tasks, through means of "parallel" package. i'm getting awkward behavior when utilizing clusters defined inside functions of package, parlapply function assigns job worker , waits finish assign job next worker. or @ least appears happening, through observation of log file "cluster.log" , list of running processes in unix shell. below mockup version of original function declared inside package: .parsolver <- function( varmatrix, var1 ) { no_cores <- detectcores() #rows in varmatrix rows <- 1:nrow(varmatrix[,]) # split rows in n parts n <- no_cores parts <- split(rows, cut(rows, n)) # initiate cluster cl <- makepsockcluster(no_cores, methods = false, outfile = "/home/cluster.log") clusterevalq(cl, library(raster)) clusterexport(cl, "varmatrix", envir=environment()) clusterexport(cl, "var1", envir=envi

php - Ajax and jQuery custom form submission in Wordpress -

i'm not tech completely, , i'm trying build custom theme wordpress. so, came point need implement custom js script send form data. far understand, it's going php file, i'm concentrated on front-end. ajax + jquery validation. don't want form refresh page after sends data, simple message telling went successful. can have @ code wrote , tell me what's wrong it? took me 2 days.. ps - file, stores code embedded wp theme properly, jquery dependancy. wonder, have implement ajax, or comes jquery? http://codepen.io/anon/pen/mpdrpe <form class="form"> <div class="form__item form__item_no-margin"> <input type="text" name="firstname" placeholder="what's name?*" class="firstname" required> <p class="error-message">sorry, field can't empty.</p> </div> <div class="form__item"> <input type="text" name="

recyclerview - RecyclerListView in Tab of Fragment of Navigation Drawer -

i have problem when used recyclerlistview in fragment inside tab in fragment user click on navigation drawer. when app run @ first time show recyclerlistview of these 2 fragment tab when click on other navigation item , again not show recyclerlistview. problem it?

multithreading - Java HttpsServer multi threaded -

i have set httpsserver in java. of communication works perfectly. set multiple contexts, load self-signed certificate, , start based on external configuration file. my problem getting multiple clients able hit secure server. so, somehow multi-thread requests come in httpsserver cannot figure out how so. below basic httpsconfiguration. httpsserver server = httpsserver.create(new inetsocketaddress(secureconnection.getport()), 0); sslcontext sslcontext = sslcontext.getinstance("tls"); sslcontext.init(secureconnection.getkeymanager().getkeymanagers(), secureconnection.gettrustmanager().gettrustmanagers(), null); server.sethttpsconfigurator(new secureserverconfiguration(sslcontext)); server.createcontext("/", new roothandler()); server.createcontext("/test", new testhandler()); server.setexecutor(executors.newcachedthreadpool()); server.start(); where secureconnection custom class containing server setup , certificate information.

android - Is there a way to launch my app's system settings in a PreferenceScreen -

i can launch device's app settings activity preferencescreen. when activity loads, activity displays listview of different apps installed on device. can app's system setting scrolling through list , clicking on title of app. i make happen in preferences.xml file. <preferencescreen android:title="@string/system_settings_preference_title" > <intent android:action="android.settings.application_settings" /> </preferencescreen> is there way launch my app's system settings rather having scroll through list? your app's system settings can launched using following intent com.myapp app's package name found in manifest file. <preferencescreen android:title="@string/system_settings_preference_title" > <intent android:action="android.settings.application_details_settings" android:data="package:com.myapp"/> </preferencescreen>

How to accumulate summary statistics in tensorflow -

i'm collecting set of summary statistics in tensorflow per batch. i want collect same summary statistics computed on test set, test set large process in 1 batch. is there convenient way me compute same summary statistics iterate through test set? looks added recently. found in contrib, streaming metric evaluation. https://www.tensorflow.org/versions/master/api_guides/python/contrib.metrics

python - How to save an Image locally using PIL -

i making program builds thumbnail based on user input, , running problems saving image. used c++ can save image, seems python not support this. this code right now: def combine(self): img = image.new("rgba", (top.width,top.height+mid.height+mid.height),(255,255,255)) img.paste(top, (0,0)) img.paste(mid, (0,top.height)) img.paste(bot, (0,top.height+mid.height)) img.show() img.save("thumbnail.png", "png") the error shows when run : traceback (most recent call last): file "texttothumbnail.py", line 4, in <module> class thumbnail(object): file "texttothumbnail.py", line 461, in thumbnail img.save("thumbnail.png", "png") nameerror: name 'img' not defined what going on? preferably want able save image locally, since program running on multiple setups different pathways program.

javascript - external events based on defined event data -

i think missing something, problem using fullcalendar drag , drop when drag 1 of external events, wanna fit defined start , end object have associated using html5 data-event . how make possible? need favor. below html code external events <div class='fc-event' data-event='{"start": "{{ $shift->shiftdetail->in_monday }}","end": "{{ $shift->shiftdetail->out_monday }}","id": "{{ $shift->id }}" }'>{{ $shift->name }}</div> and below fullcalendar javascript. var arrayofevents = []; $('#calendarsetting').fullcalendar({ now: moment(), editable: true, // enable draggable events droppable: true, // allows things dropped onto calendar aspectratio: 1.8, scrolltime: '00:00', // undo default 6am scrolltime lazyfetching: false, starteditable: t

algorithm - How to find all collection of numbers whose addition is same to the max number from list -

how find collection of numbers addition same max number list. example: input array={2,3,4,9} output = {2,3,4}{9} it subset sum problem. check if subset exists particular sum. here particular sum = max element so first find max element of list , put equal sum subset sum problem dynamic programming algorithm tells if there subset sum equals given number. below example code explained , detailed here #include <cstdio> #include <vector> using namespace std; bool** dp; void display(const vector<int>& v) { (int = 0; < v.size(); ++i) printf("%d ", v[i]); printf("\n"); } void output(const vector<int>& a, int i, int sum, vector<int>& p) { if (i == 0 && sum != 0 && dp[0][sum]) { p.push_back(a[i]); display(p); return; } if (i == 0 && sum == 0) { display(p); return; } if (dp[i - 1][sum]) { vector<int

css - How can i create text-backgrounds like this -

Image
i saw kind of text background styling on this site , i'd know if it's possible css. you can achieve effect in different ways. using pseudo elements svg . see snippet use :before , css-background , svg . can try out other methods. i recommend svg method svg{ position: absolute; top: 0; z-index: -1; } h2{ color: #333; font-size: 44px; padding: 5px 15px; position: relative; display: inline-block; } h2:before{ content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; } h2.shape-1:before{ background: #e7a9a8; border-radius: 10px; -webkit-transform: skewx(-15deg); transform: skewx(-15deg); opacity: 0.65; } h2.shape-2:before{ background-size: cover!important; bacground-repeat: no-repeat!important; background: url('data:image/png;base64,ivborw0kggoaaaansuheugaaaa4aaabkcamaaadplytoaaactvbmveuaaad///////+qqqq/v7/mzmzv1dxbttvfv7/gxsbmzmzr0dhvv

java - When i click on any link on android studio app then app is closed,how can i solve it? -

i have use webview , html5,but doesn't work link page. have many other page,but not open. mainactivity.java: package me.zahidul.zahidwebapp; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.webkit.webview; public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); string myurl = "file:///android_asset/index.html"; webview view = (webview) this.findviewbyid(r.id.webview); view.getsettings().setjavascriptenabled(true); view.loadurl(myurl); } } activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tool

javascript - Jquery function is not working on AJAX loaded elements -

don't throw rocks @ me. asked similar not long ago different. know have delegate event make them work on newly loaded element. if there no event delegate, function need use new elements? let's suppose one: function fixheight (x) { $(".test").height(x); }; now every time load content has elements class ".test", functions runs, won't affects new elements. $.get( url, function(data){ //some code inserts data retrieved in existing element fixheight (x); }).fail(function() { //fallback code }); any ideas? thanks! call function after append element dom

ios - Block variable use __weak why sometimes there are values, sometimes for nil -

Image
the variables in graph normal, nil when marking variable __weak , no retain message sent it. means if block outlives variable, when block tries read it, null because not retained. relevant clang doc

pandas - multi-label supervised classification of text data -

i solving machine learning problem using python. knowledge in machine learning not much. problem has given training dataset. training dataset includes text samples , labels text samples. possible values of labels given. supervised problem. text samples don't have empty set of labels. have make model find labels given text data. what have done is, have created pandas dataframe training data. dataframe has columns [text_data, label1, label2, label3, ..., labeln] . values of labels columns either 0 or 1. cleaned , tokenized text_data. removed stop words tokens. stemmed tokens using porterstemmer . split out dataframe training data , validation data 80:20. , trying make model predicting validation data's labels using training data. confused here how make model. tried few things naive bayes classifier didn't work or maybe did mistake. idea how should proceed now?

android - Stop animation after recyclerview inflates screen -

i have special animation populates cards recyclerview . animation works (at least inflating). don't want animation used after initial inflation. in other words, don't want animation scrolling (or action user after initial inflation of enough cards fill user's screen). can't figure out how grab position number -or- turn off animation after populating -or- way this. animation called in adapter. here's adapter code using set animation. public class tagadapter extends recyclerview.adapter<tagadapter.viewholder>{ private arraylist<tagdatamodel> dataset; private context context; public tagadapter (arraylist<tagdatamodel> ds, context ctx){ this.dataset =ds; this.context =ctx; } class viewholder extends recyclerview.viewholder { textview tv_tag; arraylist<tagdatamodel> dataset = new arraylist<>(); context context; cardview card; viewholder(view itemview, context ctx, arraylist<tagdatamodel> ds) {

apache - Hive jdbc driver not working with ignite -

i trying use ignite hive (hadoop secondry file system). have java api. need insert data in hive needed following dependency. <dependency> <groupid>org.apache.hive</groupid> <artifactid>hive-jdbc</artifactid> <version>2.1.1</version> <exclusions> <exclusion> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> </exclusion> <exclusion> <groupid>log4j</groupid> <artifactid>log4j</artifactid> </exclusion> </exclusions> </dependency> as insert dependency in pom file, ignite stopped working , gives following error. java.lang.incompatibleclasschangeerror: implementing class 1077 [main] info o.s.b.f.x.xmlbeandefinitionreader - loading xml bean definitions url [file:/c:

Regarding got to command in tcl -

i want print character next line: say : when variable dum=183 exists in file , print next charater next line. note : using tcl thanks, this should started. the typical idioms working file 1 line @ time are: 1) linewise reading: set f [open thefile.txt] while {[gets $f line] >= 0} { # work line of text in "line" } close $f 2) block reading line splitting: set f [open thefile.txt] set text [read $f] close $f set lines [split [string trim $text] \n] foreach line $lines { # work line of text in "line" } this can simplified using package: package require fileutil ::fileutil::foreachline line thefile.txt { # work line of text in "line" } another way search , extract using regular expression. worst method inflexible , buggy in use. set f [open thefile.txt] set text [read $f] close $f # regular expression example if {[regexp {\ydum\y[^\n]*.(.)} $text -> thecharacter]} { # character wanted should in &quo

wns - UWP PushNotificationTrigger won't trigger background task -

i trying develop windows 10 uwp app has background task triggered raw pushnotification trigger. test, have handler on app see if raw notification pushing , worked. here code snippets: pushnotificationchannel _channel = null; private async void appinit() { _channel = await common.wnshelper.getchannelasync(); if (_channel != null) { _channel.pushnotificationreceived += _channel_pushnotificationreceived; } await installpositionbackgroundtask(); } private async void _channel_pushnotificationreceived(pushnotificationchannel sender, pushnotificationreceivedeventargs args) { if (args.notificationtype == pushnotificationtype.raw) { common.generalhelper.sendtoast("at app positionbackgroundtask"); } } private async task installpositionbackgroundtask() { var taskname = "positionbackgroundtask"; foreach (var tsk in background

php - Composer SSL: An existing connection was forcibly closed by the remote host -

i'm trying install new package composer using composer require error showed existing connection forcibly closed remote host. send of 95 bytes failed errno=10054 existing connection forcibly closed remote host. failed open stream: cannot connect https server through proxy https://packagist.org not loaded, package information loaded local cache , may out of date [composer\downloader\transportexception] "http://packagist.org/p/jenssegers/date%24a796b298222b37954ea0f488a5b99d057114dda34ecead922188b0abf832faba.json " file not downloaded: failed open stream: http request failed! here's result of composer diagnose checking composer.json: ok checking platform settings: ok checking git settings: ok checking http connectivity packagist: warning [composer\downloader\transportexception] "http://packagist.org/packages.json" file not downloaded: failed open stream: http request failed! checking https connectivity packagist: warning [composer\downloade

ruby - Rails api error: Authorization has been denied for this request -

i trying call external web service api rails application, every time same error {"message":"authorization has been denied request."} . here snippet of controller code: # frozen_string_literal: true module store class paymentscontroller < applicationcontroller def initiate url = store::payment.new.initiate <---- error happens here render plain: 'failed' && return unless url redirect_to url end end end here snippet model code: # frozen_string_literal: true module store class payment end_point = 'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' def initiate <--- calling method controller fails, works in rails console navigate_url = nil restclient.post end_point, payload, header |response| response_hash = json.parse(response).symbolize_keys if response_hash[:success] navigate_url = response_hash[:navigateurl] else rollbar.error(response_ha

java - NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder -

there issue android appcompat v7 library on samsung devices running android 4.2. keep getting crashes following stack trace in developer console: java.lang.noclassdeffounderror: android.support.v7.internal.view.menu.menubuilder @ android.support.v7.widget.popupmenu.<init>(popupmenu.java:66) @ com.[my-package-name].customactivity$5.onclick(customactivity.java:215) @ android.view.view.performclick(view.java:4222) @ android.view.view$performclick.run(view.java:17620) @ android.os.handler.handlecallback(handler.java:800) @ android.os.handler.dispatchmessage(handler.java:100) @ android.os.looper.loop(looper.java:194) @ android.app.activitythread.main(activitythread.java:5391) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:525) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:833) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:600) @ dal

java - Unable to restart a DefaultMessageListenerContainer -

we're using spring 4.3.1, , getting messages queue using following bean: @bean(name="listenercontainer") public sprmessagelistenercontainer listenercontainer() throws jmsexception, sqlexception { sprmessagelistenercontainer listenercontainer = new sprmessagelistenercontainer(); listenercontainer.setconnectionfactory((connectionfactory) connectionfactory()); listenercontainer.setmessagelistener(messagelistener()); listenercontainer.setsessiontransacted(true); listenercontainer.setcachelevel(0); listenercontainer.setmaxconcurrentconsumers(3); listenercontainer.setdestinationname("ourqueue"); // (april 2017): provide possibility manually stop/start listner container > autostart needs set false, otherwise can stop container, not restart anymore // see: http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jms/listener/abstractjmslisteningcontainer.html#setautostartup-boolean-

html - Font-face trouble (sharp edges) in Firefox -

Image
i'm using font: https://material.io/guidelines/resources/roboto-noto-fonts.html ( roboto-regular.ttf , roboto-medium.ttf ) and in css (less) define @font-face way: @font-face { font-family: 'roboto'; src: url('roboto-regular.ttf') format('truetype'); } @font-face { font-family: 'roboto-medium'; src: url('roboto-medium.ttf') format('truetype'); } later use so: html { font-size: 62.5%; } body { font-family: 'roboto', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .some-element { font: 2.2rem 'roboto'; } and in every browser, except firefox , ie ok. in browsers got: in chrome fine: edges aren't smooth, don't know, why? wrong? btw: cannot use google-fonts for whatever reason, font doesn't seem optimized web, though material page says "the latest version of roboto designed both mobile , web usage."

ios - Where do I declare a variable on app launch, that accesses ViewController properties? -

so have class of want create instance app launches. initialize of properties switches/toggles in viewcontroller. here class, of trying create instance: import foundation class propertycollection { var property1: bool init (property1: bool) { self.property1 = property1 } func disableall() { self.property1 = false } func enableall() { self.property1 = true } func info() -> string { return "the properties are: \(property1)" } } so: putting declaration in appdelegate.swift gives me error ( "use of unresoved identifier 'property1switch'" ): func application(_ application: uiapplication, didfinishlaunchingwithoptions launchoptions: [uiapplicationlaunchoptionskey: any]?) -> bool { var thepropertycollection: propertycollection = propertycollection(property1: property1switch.ison) return true } adding "viewcontroller." in front of "

bitbucket - Clean git references recursively on a folder -

i new git maybe basic question have not found way need, , don't discard wrong understanding. have bitbucket server sending or code. working on windows 10 box , command line git client. i created repository different programs of them include code obtained github. obtained using git clone <url> keeps references of original repository (as can see running git remote -v on specific folder). i have tried incorporate content our local repository following commands parts incorporated. git init git add --all git commit -m "initial commit" git remote add origin <localurl> git push -u origin master i have seen there plenty of references folders in gitignore files, suppose preventing uploaded. is there way delete recursively references git in path can start clean folder? just remove .git folder in working directory

linux - How to write the docker script such that sudo works in Docker user? -

i've ran empty docker container ubuntu , created sudo user such: user@server$ docker run -it ubuntu bash root@6da1c5bc7f93:/# apt-get update root@6da1c5bc7f93:/# apt-get -y install sudo root@6da1c5bc7f93:/# useradd -m -p mosesdocker -s /bin/bash ubiwan root@6da1c5bc7f93:/# usermod -ag sudo ubiwan # add user sudo list root@6da1c5bc7f93:/# su - ubiwan # login ubiwan user and when logged in ubiwan , password doesn't seem mosesdocker specified useradd -m -p mosesdocker -s /bin/bash ubiwan . i've typed correct password get: to run command administrator (user "root"), use "sudo <command>". see "man sudo_root" details. ubiwan@6da1c5bc7f93:~$ sudo su [sudo] password ubiwan: sorry, try again. [sudo] password ubiwan: sorry, try again. [sudo] password ubiwan: sudo: 3 incorrect password attempts why so? is possible use sudo in docker? "suggested" perform sudo actions in docker? how write docker script such sudo w

Laravel 5.4: Password reset token not the same as email token -

i have slight problem after upgrading laravel 5.4 when password reset, email gets generated , sent perfectly, token saves user record in database follows: $2y$10$n0wfuqekeifto.cazxyldoumy1x9tbhfvdn8iwkudlq2w9uoc00ku but token sends user password reset is: bc1c82830bc8ad1356aa5e2a2a5a342ae6c6fabd385add503795cca1a1993e15 my question why 2 tokens different. , how perform check validate if token exists in database need email address post reset controller. thanx in advance. token store in database hashed same password column in users table. token recieve not hashed. thats why different due password ; $2y$10$n0wfuqekeifto.cazxyldoumy1x9tbhfvdn8iwkudlq2w9uoc00ku you have hash::make('bc1c82830bc8ad1356aa5e2a2a5a342ae6c6fabd385add503795cca1a1993e15'); and cannot revert process backwards.

How to count the number of rows in a given time interval in python pandas? -

i have pandas dataframe numer of columns contain timestamps events can happen objects, object ids index rows. obj_id | event1 | event2 | event3 | ... 1 | datetime| datetime | nat | ... ... | ... | ... | ... | ... i want count number of occurences of event on course of day (discarding date), in intervals specify. sor far, solve recunstructing number of minutes since midnight using datetime.hour , datetime.minute : i = 5 # number of minutes in interval i'm interested in ev1_counts = df.groupby( df.event1.apply(lambda x: * ((60*x.hour + x.minute)//i)) )['event1'].count() this job, seems unpythonic , i'm sure there better way. how? i have seen this question , trying time_series = pd.datetimeindex(df.event1) ts_df = pd.series([1]*len(time_series), index=time_series) ev1_counts = ts_df.groupby(pd.timegrouper(freq = '{:d}min'.format(i)).count() keeps date informa

join - Can I use one table column value as another table table name in mysql? -

i want build query -> select table1.colname,(select count(*) table1.colname) count table1; is possible in mysql? please me.. you try using stored procedure , one: create procedure test_procedure() reads sql data begin declare table_name varchar(50); declare cur_input cursor select table1.colname table1; open cur_input; loop1:loop fetch cur_input table_name; select table_name,(select count(*) table_name) count table1; end loop loop1; end;

ionic framework - replacing <img> to <ion-img> and images are very small -

i followed guidance @ virtual scroll , updated list virtuallist. all fine when converted card background images <img> <ion-img> images appearing background images cards very small . i'm missing? check image dimensions section in ion-img docs. by providing image dimensions front, ionic able accurately size image's location within viewport, helps lazy load images viewable. image dimensions can either set properties, inline styles, or external stylesheets. doesn't matter method of setting dimensions used, it's important somehow each ion-img has been given exact size. you need set height , width image want show if using ion-img either through attributes or css styles.

ios - My iTunes app description always appear in English -

i set primary language thai thai description on itunes connect submit app. now app status ready sale. i changed iphone language thai search app on appstore. application shows description in english. why description not show in thai? phone language not affect on appstore application descriptions. should change appstore country or region see it. or can set application's primary language thai while adjusting app details in itunes connect. you can find additional information changing appstore location in this link. you can find information setting app languages in this link.

c# - In the same project two libraries need two different version of a third library -

Image
in c# project need make backplane signalr realized azure service bus. in startup wrote: globalhost.dependencyresolver.useservicebus(asb_endpoint, topic); in same project there's rebus configuration azure service bus, like: return rebus.config.configure.with(new unitycontaineradapter(container)) .logging(l => l.log4net()) .transport(l => l.useazureservicebus(cs, qname)) .routing(r => r.typebasedroutingfromappconfig()) .options(o => o.simpleretrystrategy(errorqueueaddress: errorqname, maxdeliveryattempts: 3)); both uses extension method implementation of useazureservicebus , useservicebus . the problem is: both extension methods part of 2 libraries, , libraries conflicting on various dependencies. have rebus' useazureservicebus extension, need rebus.azureservicebus version 0.99.39, in turn needs @ least windowsazure.servicebus 3.0.4, use dll called microsoft.servicebus 3.0.0 conflicts internal work of

r - Error in kNN classification code -

i writing knn classification code scratch , data set used cancer data set (standard machine learning) attaching r code, have tried umpteen times unable find error in code classifying in "benign" new apologize if there error in posting such here r code: # creating function knn classification method knn <- function(train,test,k,train_labels,test_labels) { # initializing vector classification classified_vector <- c() # need take transpose of test first make work transpose_test <- t(test) # taking transpose of main transpose_train <- t(train) #here need intitalize test set for(i in 1:nrow(test)) { observation <- transpose_test[,i] # have done choosen 1st line # need find distance of first line other points in train set xy2_matrix <- (transpose_train-observation)^2 # given have (x-y)^2 need add them , square root #individual distances dist_xy <- sqrt(apply(xy2_matrix,2,sum)) # need sort them kth

php - Use ACF checkbox value array to find "More like this" -

i'm using acf checkbox designate categories (called "aims") psychology apps/sites. values be, say, "mindfulness", "well-being" , "depression". since it's possible select multiple values, i'd have more single post show other posts match 1 or more of categories of post. update: here's code i'm using now, i'm still not having luck with: the_field( 'aims'); /* since i'm on page single post, gives me aims current post , returning values checkbox multiple selections (as array, believe) */ $args = array( 'numberposts' => -1, 'post_type' => 'program', 'post_status' => 'publish', 'meta_query' => array( 'relation' => 'and', array( 'key' => 'aims', 'value' => 'well-being', /* i'd use aims current post, i've

directx - Why do we need dynamic branch to render multiple light sources -

i reading real-time rendering (third edition). in section 7.9 combining lights , materials, says "if dynamic branches not used, different shader needs generated each possible combination of lights , material type". i think static branch suited problem. right? presumably 'engine' code determining sorts of lights , materials in scene, , (usually) dynamic. communicate shader, need pass information in way - through uniforms, textures or buffers. data not static, , thus, conditional expressions based on information contained in them dynamic branching. some graphics apis/drivers optimization under-the-hood, , recompile shaders multiple branches predicted, , call 'static branching'. example, shader documentation d3d9 , states that: static branching allows blocks of shader code switched on or off based on boolean shader constant. in other apis such opengl, it's not advertised when these sort of optimizations occur, although presumably ha

REST API - Swagger - Don't understand why "Not a valid parameter definition" -

i face issue swagger file : swagger: '2.0' paths: /currencies: get: responses: '200': description: '' summary: 'list currencies summary' x-auth-type: none x-throttling-tier: unlimited produces: - application/json description: 'list currencies description' '/currencies/{currencieid}': get: responses: '200': description: '' description: 'single currency description' parameters: - name: currencieid in: path allowmultiple: false required: true type: string description: 'paramter description' summary: 'single currency' x-auth-type: none x-throttling-tier: unlimited produces: - application/json info: title: mdm version: v1 here issue : ✖ swagger error not valid parameter definition jump line 20

c# - Get Maximum Password Age maxPwdAge from LDAP Active Directory connection in asp.net mvc -

how retrieve maxpwdage properties ldap active directory connection in asp.net mvc? hoping use system.web.security as possible. i have added membership web.config. need know how instantiate ldap activedirectory object in controller can object properties contains maxpwdage. <membership defaultprovider="admembershipprovider"> <providers> <clear /> <add name="admembershipprovider" type="system.web.security.activedirectorymembershipprovider" connectionstringname="adconnectionstring" attributemapusername="xxxxxxxx" connectionusername="xxx\xxxxxxx" connectionpassword="xxxxxxxx"/> </providers> </membership>

html - Opaque image over Transparent Background -

i want make image opaque on 70% opaque background. working on tboxsolutionz.com/dev12345 when portfolio item clicked div loaded (code div given below) <div class="portfolio-modal modal fade transparent-background in" id="portfoliomodal2" tabindex="-1" role="dialog" aria-hidden="false" style="display: block;"><div class="modal-backdrop fade in" style="height: 846px;"></div> <div class="modal-content"> <!-- <div class="close-modal" data-dismiss="modal"> <div class="lr"> <div class="rl"> </div> </div> </div>--> <div class="container containerport"> <div class="row"> <div class="col-lg-8 col-lg-offset-2"> <div class="modal-body"> <!-- project details go h

javascript - Froala Editor Custom Input Field -

i've been looking around have found no explains how create custom input field on toolbar of froala editor. similar how url button works: froala url input it has input field , insert, how can add button similar functionality you use custom popup example starting point , extend there changing initpopup method this: // popup buttons. var popup_buttons = ''; // create list of buttons. if (editor.opts.popupbuttons.length > 1) { popup_buttons += '<div class="fr-buttons">'; popup_buttons += editor.button.buildlist(editor.opts.popupbuttons); popup_buttons += '</div>'; } // custom layer. var custom_layer = '<div class="fr-my-layer fr-layer fr-active" id="fr-my-layer-' + editor.id + '"><div class="fr-input-line"><input id="fr-my-layer-text-' + editor.id + '" type="text" placeholder="' + editor.language.translate('altern

c - Accelerator not displayed in GtkCheckMenuItem -

i fiddliny around menubar in gtk+3. until had checkmenuitems label , accelerator shortcut displayed: gtkwidget *create_menubar(void) { gtkwidget *menubar = gtk_menu_bar_new(); const static guint num_keys[] = {gdk_key_1, gdk_key_2, gdk_key_3, gdk_key_4, gdk_key_5, gdk_key_6, gdk_key_7, gdk_key_8, gdk_key_9, gdk_key_0}; // create gtkaccelgroup , add window. gtkaccelgroup *accel_group = gtk_accel_group_new(); gtk_window_add_accel_group(gtk_window(window_main), accel_group); // submenu show colors gtkwidget *colors_mi = gtk_menu_item_new_with_label("colors"); gtkwidget *colors_menu = gtk_menu_new(); gtk_menu_shell_append(gtk_menu_shell(menubar), colors_mi); gtk_menu_item_set_submenu(gtk_menu_item(colors_mi), colors_menu); (int = 0; < num_colors; i++) { char name[10]; sprintf(name, "col %d", i+1); // <<<<<<<<<<<<<<<<< cut mark... gtkwidget *show_color_mi = gtk_check_m