Posts

Showing posts from June, 2015

php - How to correct my gmdate method? -

my code working thing $todaystamp shows 3 hours before clock time. , wanna fix it. (gmt+3) still want use gmdate method because don't know how change rest of... how can without broke other codes? thanks... <?php function sendicalemail($firstname,$lastname,$email,$meeting_date,$meeting_name,$meeting_duration,$message1,$place1) { $from_name = "furkan Öksüz"; $from_address = "furk.oksuz4@gmail.com"; $subject = "olusturulan etkinlik"; //doubles email subject , meeting subject in calendar $meeting_description = $message1; $meeting_location = $place1; //where meeting take place //convert mysql datetime , construct ical start, end , issue dates $meetingstamp = strtotime($meeting_date . " utc"); $dtstart= gmdate("ymd\this\z",$meetingstamp); $dtend= gmdate("ymd\this\z",$meetingstamp+$meeting_duration); $todaystamp = gmdate("ym...

openldap - LDAP query limitation -

i trying write ldap query returns around 10000 users. far current api concerned 1500 returned search results. not sure how fix this. there way api can handle around 10000 users search response. appreciated there 2 primary factors limit search result count. the server side sizelimit , client side searchrequest sizelimit. you maybe able bypass server side sizelimit using simple paged results control for client side searchrequest sizelimit, adjusted on client making request value of "0" (zero) unlimited.

Running Tomcat inside IntelliJ Java Application SLF4j Logger error -

if deploy application directly on stand alone tomcat 8, server starts without errors. ony when try start tomcat within intellij, noclassdeffounderror: org/slf4j/logger , application doesn't start. works fine when deploy war directly in external tomcat. attached 2 pom files: i've looked @ solutions offered on situation unique intellij. noclassdeffounderror: org/slf4j/logger parent pom <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>org.akaza.openclinica</groupid> <artifactid>openclinica</artifactid> <packaging>pom</packaging> <version>mainline-snapshot</version> <name>openclinica</name> <description>openclinica</description> <modules> <...

javascript - I'm having trouble with formatting when using tooltips (or labels?) in D3.js -

i’m totally noob-tastic (i.e. have little programming background , trying hack dashboard using borrowed code) eager learn more! i’m hung hope small issue. i’m using version of bostock’s calendar example... calendar ...and have managed close desired outcome i’m having trouble tooltip(?), second .attr under rect.filter below. d3.csv("bugeseradata.csv", function(error, csv) { csv.foreach(function(d) { d.daily_total = parseint(d.daily_total); }); var daily_total_max = d3.max(csv, function(d) { return d.daily_total; }); var data = d3.nest() .key(function(d) { return d.date1; }) .rollup(function(d) { return math.sqrt(d[0].daily_total / daily_total_max); }) .map(csv); rect.filter(function(d) { return d in data; }) .attr("fill", function(d) { return color(data[d]); }) .attr("data-title", function(d) { return 'rwf ' +d }); $("rect").tooltip({container: 'body', html: true, pla...

knitr - Object not found while knitting in R Studio -

i trying knit using r studio keep getting error error in summary(diamonds) : object 'diamonds' not found calls: ... withcallinghandlers -> withvisible -> eval -> eval -> summary execution halted this code, ```{r} summary(diamonds) ``` while run above code works fine when try knit says object not found. although when use cars datset, don't have such problems. understand diamonds dataset part of ggplot2 package , have installed package well. i have gone through suggestions use knit2html('filename.rmd') knit('filename.rmd') i have tried ```{r include = true} summary(diamonds) ``` you need load package inside code chunk before knitting it. ```{r} library(ggplot2) summary(diamonds) ```

java - Optional in orElse-Branch throws Exception -

this question has answer here: java 8's orelse not working expected 1 answer so i'm working optionals , came across strange behaviour. want know if intendet "feature" or something...odd... here given example: i've got method optional in orelse want evaluate other optional. if other optional not present, i'll raise illegalargumentexception: firstoptionalvar.orelse(secondoptionalvar.orelsethrow(illegalargumentexception::new)); now if secondoptionalvar empty optional, raise illegalargumentexception, if firstoptionalvar present. doesn't seem right me. expect raise illegalargumentexception if firstoptionalvar not present. it's not big deal arround behavior java7-methods like: firstoptionalvar.ispresent() ? firstoptionalvar.get() : secondoptionalvar.orelsethrow(illegalargumentexception::new); has else experienced behaviour b...

c - How to build a lattice using igraph? -

i'm trying build lattice using igraph c. in manual instructions says igraph.lattice() can creat kinds of lattices , here explains how use function seems lattice can create function square one, square grid... how create triangular lattice or kind of lattice?

angularjs - How can I populate a SELECT in a data grid? -

i have object: phraseformid = [ { id: 1, name: 'word' }, { id: 2, name: 'sentence' } ]; what change read row.formid select element display , can choose new values: <div> <div>{{ row.formid}}</div> </div> can give me ideas how can this? thanks certainly not sure, looking have on fiddle, simple enough start with. let me know, if problem statement different. using ng-repeat fiddle: http://jsfiddle.net/u3pvm/26336/

Applescript to parse terminal -

i trying create apple script alerts me every time key word returned in terminal (i have program runs in terminal , returns lot of data). in case use iterm instead of terminal, it's same idea. so if word "any" returned in iterm, result "found any". the code below returning result: {"found %s", {"any", "of", "these", "words"}} application "iterm" set found ["any", "of", "these", "words"] if found exists return {"found %s", found} end if

android - PublishSubject doOnSubscribe not called -

i have publishsubject registered doonsubscribe , doonunsubscribe actions. both actions not called, if subscription done. private publishsubject<long> publishsubject; private subscription subscription; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); publishsubject = publishsubject.create(); publishsubject.doonsubscribe(new action0() { @override public void call() { log.d("subject", "someone subscribed."); } }); publishsubject.doonunsubscribe(new action0() { @override public void call() { log.d("subject", "someone unsubscribed."); } }); observable.interval(1, timeunit.seconds).subscribe(new action1<long>() { @override public void call(final long tick) { publishsubject.onnext(tick); } }); } ...

android - ARToolKit marker detect java Method -

i using artoolkit nftsimple example , trying java method when marker detected code not working. you in easier way without touching ndk. the artoolkit class has methods querying visibility of markers, invoked on renderer, create thread keeps checking them. this code need check marker visibility in java: boolean markervisible = artoolkit.getinstance().querymarkervisible(mmarkerid);

Wordpress display custom post type with custom taxonomy and current term -

difficult one: i'm trying posts custom post type 'specialisaties' custom taxonomy 'specialismen' , need load current loaded ' term ' url. currently have code outputs term 'superpower' . <?php $loop = new wp_query(array('post_type'=>'specialisaties', 'taxonomy'=>'specialismen', 'term' => 'superpower', 'orderby' => 'menu_order', 'order' => 'asc')); ?> <?php while ($loop->have_posts()) : $loop->the_post(); ?> <h1><?php the_title() ?></h1> <?php the_content() ?> <?php endwhile; ?> this loads specific post term 'superpower'. how fetch 'term' dynamically url i'm loading? thanks in advance, fixed get_term_by . <?php $term = get_term_by( 'slug', get_query_var('term'), get_query_var('taxonomy') ); ?> <?php $loop = new wp_qu...

objective c - Fails to read/write a plist file in the Preferences folder of a group container -

my sandboxed application , helper using nsuserdefaults manage preferences. preferences file located in group container shared 2 applications. i’ve decided use plist file instead. groupcontainerurl = [fm containerurlforsecurityapplicationgroupidentifier:sc_appgroupname]; prefsurl = [groupcontainerurl urlbyappendingpathcomponent:sc_prefsrelativepath]; if(! [fm fileexistsatpath:prefsurl.path]) [self createdictionary]; else { prefsfile = [nsmutabledictionary dictionarywithcontentsofurl:prefsurl]; if(prefsfile == nil) [self filemanageralert]; // nsalert } when want read or write file in group container, access denied. prefsfile set nil when create url. following messages appear in console : 25/07/2016 17:18:02,650 sandboxd[126]: ([1445]) myapp(1445) deny file-read-data /users/lionel/library/group containers/x2rd457a99.com.mycompany.myapp/library/preferences/x2rd457a99.com.mycompany/myapp.plist 25/07/2016 17:02:02,235 sandboxd[126]: ([1413]) myapp(1413) deny f...

python 3.x - Contradicting Errors? -

so i'm trying edit csv file writing temporary file , replacing original temp file. i'm going have edit csv file multiple times need able reference it. i've never used namedtemporaryfile command before , i'm running lot of difficulties. persistent problem i'm having writing on edited lines. this part goes through , writes on rows unless specific values in specific column , passes over. i have this: office = 3 temp = tempfile.namedtemporaryfile(delete=false) open(infile, "rb") oi, temp: r = csv.reader(oi) w = csv.writer(temp) row in r: if row[office] == "r00" or row[office] == "alc" or row[office] == "rms": pass else: w.writerow(row) and error: traceback (most recent call last): file "h:\jcatoe\practice python\pract.py", line 86, in <module> cleanofficecol() file "h:\jcatoe\practice python\pract.py", line 63, in cleanofficecol row i...

javascript - jQuery function for several similar functions -

i use jquery-circle-progress plugin draw round progress bars website. now, in case 'some' eight, have 8 pretty huge definitions of each progress bar. now wondered if possible break down smaller code snippet. once write configuration code variables function , add values 8 different progress bars. but how work if several variables needed? here code of 1 of progress bars: var e = $('.element1'), inited_e = false; e.circleprogress({ value: 0, size: size }); e.appear( { force_process: true } ); e.on('appear', function() { if (!inited_e) { e.circleprogress({ value: 0.85, size: size, linecap: "round", fill: { gradient: ["#00c853", "#00e676"] } }); inited_e = true; } }); so, variable in configuration? first of element on script relies, e change each element. furthermore, every element have value , gradient. need each function iterates through object (?...

matlab - Converting a RGB image to grayscale based on the intensity of one color channel -

this question has answer here: access rgb channels in image in matlab 1 answer i'm working images similar this: a cell image , , want extract red-pink sections. of i'm using img(:,:,1) pull out red values produces binary image. wanted know if there way extract "red" values , produce grayscale image based on degree of "redness" or intensity. awesome. you visualizing result using imshow automatically set color limits of axes between 0 , 1 . image rgb , values of red channel going range 0 255 . because of this, if specify 1 input imshow , image values > 1 appear white , zero-values black. image isn't binary, appears way . you want either display image imagesc automatically scale color limits match data: imagesc(img(:,:,1)); colormap gray or can specify second input imshow cause scale fit data range: imshow(img(:...

excel - Find Largest Value in one cell and then display a different cell in the same row -

this difficult question put words example data , attempt help i have following apple 17 1 0 0 0 0 0 0 0 0 0 0 orange 14 1 15 1 6.67 1 6.67 1 6.67 2 13.33 10 banana 15 3 5 0 0 0 0 0 0 0 0 1 cherry 13 1 12 2 16.67 2 16.67 2 16.67 2 16.67 2 peach 16 4 12 1 8.33 1 8.33 2 16.67 2 16.67 8 strawberry 12 5 6 1 16.67 1 16.67 1 16.67 1 16.67 7 i trying find max value in m , display same row. in example max value 10 , "orange" should displayed. it should noted using 2 sheets, "data" has output , "raw data" has... raw data =vlookup(max('raw data'!m1:m6), a1:m6, 1, false) this produces #n/a , think might have data either not being formatted table (though doing seems fail different error) or running 1 sheet other. any input appreciated vlookup re...

html - Huge spaces instead of regular spaces are pasted -

given string out of copy excel row. i need user able copy/paste row excel form. given string passed explode() in php have access different cell values. problem : when paste given line input field, values separated "huge" spaces (so php cannot explode regular spaces). odd : when paste line actual stackoverflow textarea or url bar, regular spaces pasted. since stackoverflow textarea shows regular spaces when paste, please see below link screencast showing issue. video : http://recordit.co/ndrnspeo4i *.gif : http://g.recordit.co/ndrnspeo4i.gif accessing data $values[i] , pattern work: $stringprocessed = preg_replace('/\s+/', ' ',$string); $values = explode(" ", $stringprocessed);

api - How do I use `SFCertificateTrustPanel` in swift? -

i working on test application connects service using https. certificate of connection using custom root certificate. implemented delegate `nsurlsessiondelegate' , implemented this: func urlsession(session: nsurlsession, didreceivechallenge challenge: nsurlauthenticationchallenge, completionhandler: (nsurlsessionauthchallengedisposition, nsurlcredential?) -> void) { if challenge.protectionspace.authenticationmethod == nsurlauthenticationmethodservertrust { let trust: sectrustref = challenge.protectionspace.servertrust! var secresult: sectrustresulttype = sectrustresulttype(ksectrustresultinvalid) if sectrustevaluate(trust, &secresult) == errsecsuccess { switch (int(secresult)) { case ksectrustresultunspecified: break case ksectrustresultproceed: let credential = nsurlcredential(fortrust: trust) completionhandler(.usecredential, credential) retu...

php - org.json.JSONException: Value Connected of type java.lang.String cannot be converted to JSONObject -

i'm trying list challenges external sql database. having big problem. retrieving data mysql ok, hitting errors on jsonobject. have been trying fair few hours if can point me in right direction - have been using tutorial reference https://www.simplifiedcoding.net/android-spinner-example-to-load-json-using-volley/ php file - challengesall.php <?php $servername = "localhost"; $username = "user"; $password = "pass"; $dbname ="android_api"; // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } echo "connected successfully"; //$stmt = $dbconn->conn->prepare("select * challenges") or die(mysql(mysql_error())); $stmt = "select * challenges"; $result = $conn->query($stmt); $results = array(); if ($result->num_rows > 0) { // output da...

wpf - Usercontrol within Usercontrol with Data Binding -

i built simple wpf usercontrol want implement several of in usercontrol while maintaining data binding. have simple debug1 window implements (1) bound textblock (to verify data binding only) & button; (2) single instance of numericupdownbox usercontrol binding; , (3) instance of parent user control containing instance of child user control numericupdownbox. items (1) , (2) working. item (3) not. feel missing in implementation in parent user control code? couple of errors concern me (see below). debug1 window xaml: <window x:class="debug1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:cfit" mc:ignorable="d" title="debug1" height=...

erlang - pub/sub with gproc - what is module? -

reading gproc docs, looks key used routed messages different processes, can't figure out how pub/sub example works in docs, seems using different keys registering , sending messages. in gproc docs, provide following example of implementing pub/sub: subscribe(event) -> gproc:reg({p, l, {?module, event}}). publish(event, data) -> gproc:send({p, l, {?module, event}}, {?module, event, data}). the gproc:send 2nd argument: {?module, event, data} , wouldn't make message different based on module sending event? so example if subscribe event of type foo_bar module1: pub_sub:subscribe(foo_bar). and publish event module2: pub_sub:publish(foo_bar, {color, "blue"}). the calls gproc first call be: gproc:reg({p, l, {module1, foo_bar}}). while second: gproc:send({p, l, {module2, foo_bar}}, {module2, foo_bar, {color, "blue}}). so seems keys different: {p, l, {module1, foo_bar}} , {p, l, {module2, foo_bar}} , , module1 never receiv...

Webview autoheight to content is not working on iOS (Appcelerator Titanium) -

i want add webview height content. make running smoothly on android on ios longer text longer space below text is. here code: var window = ti.ui.createwindow(); var scrollview = ti.ui.createscrollview({ layout: 'vertical', height: ti.ui.size }); var view1 = ti.ui.createview({ height: 200, backgroundcolor: 'red' }); var webview = ti.ui.createwebview({ height: ti.ui.size, html: '<html><head><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta http-equiv="content-type" content="text/html; charset=iso-8859-2"></head><body style="margin:0; background-color: blue">some page text2</body></html>' }); var view2 = ti.ui.createview({ height: 200, backgroundcolor: 'green' }); scrollview.add(view1); scrollview.add(webview); s...

python - webbrowser not opening new windows -

i got new job working remotely , have start day opening bunch of pages , logging them. love automate process can kind of tedious. leave personal browsing window alone , open new window of pages need. here gist of i'm trying do: import webbrowser first = true chromepath = 'c:/program files (x86)/google/chrome/application/chrome.exe %s' urls = ("first page", "second page", "third page") url in urls: if first: webbrowser.get(chromeppath).open(url) first = false else: webbrowser.open(url, new=2) for reason code opening new tabs in current browser, opposite of want doing. going on? i don't have chrome installed, there seem multiple problems: according docs, webbrowser.get expects name of browser, not path. you should save return value of webbrowser.get() , use open remaining urls. import webbrowser urls = ("first page", "second page", "third page") brow...

java - OpenOrd layout for gephi 0.9.1 -

i trying install openord layout gephi version 0.9.1. plugin site find latest suitable version 0.8.2. when try install manually get some plugins require plugin org.gephi.utils.collection installed. plugin org.gephi.utils.collection requested in version 0.7.1. following plugin affected:       openordlayout i downloaded , manually placed org.gephi.utils.collection.jar in gephi/modules dir nothing changed. some help? solution i managed install org.gephi.utils.collection using manual plugin installer , layout installed correctly.

linux - how to work with 'while ..; do..; done' in bash -

this question has answer here: use shell iterate through file 2 answers i having trouble using command in bash operation. following have: cat namelist | while read line; awk '$1 == $line {print $0}' jan.txt; done the namelist unrepeated namelist each name on each line. , jan.txt file of information these: ermartin pts/10 tue jan 19 09:49 - 10:15 (00:26) 171.66.208.139 sdou pts/6 tue jan 19 01:52 - 22:20 (9+20:27) 131.243.186.99 sdou pts/2 tue jan 19 01:20 - 22:20 (9+20:59) 131.243.186.99 phu pts/2 sat jan 16 12:21 - 15:13 (02:52) lbl-ipsec-7667.dhcp.lbl.gov phu pts/2 sat jan 16 10:07 - 12:01 (01:54) lbl-ipsec-7622.dhcp.lbl.gov sjames pts/5 fri jan 15 12:06 - 13:06 (01:00) lakshmi.lbl.gov ermartin pts/2 fri jan 15 08:36 - 12:43 (04:07) 171.66.208.134 ermar...

python - Collapsing list to unique IDs with a range of dates -

i have large list of ids repeat different ranges of dates. need create unique list of ids 1 range of dates includes earliest start date , latest end date uncollapsed list. this example of have: id start_date end_date 1 9/25/2015 10/12/2015 1 9/16/2015 11/1/2015 1 8/25/2015 9/21/2015 2 9/2/2015 10/29/2015 3 9/18/2015 10/15/2015 3 9/19/2015 9/30/2015 4 8/27/2015 9/15/2015 and need. id start_date end_date 1 8/25/2015 11/1/2015 2 9/2/2015 10/29/2015 3 9/18/2015 10/15/2015 4 8/27/2015 9/15/2015 i'm trying in python, not having luck. thanks! use groupby/aggregate : in [12]: df.groupby('id').agg({'start_date':min, 'end_date':max}) out[12]: start_date end_date id 1 2015-08-25 2015-11-01 2 2015-09-02 2015-10-29 3 2015-09-18 2015-10-15 4 2015-08-27 2015-09-15 note important start_date , end_date parsed date...

Pass selected value from one form to another - ms access -

Image
i have access database has 1 form, asset_information in source of fields restricted values in table ([brand name] , [model name]). i trying write 'popup' or 'modal' form asset information form allow users open search form model or brand, search existing ones , either select model or brand or create new one. example: an user clicks here on first form , after that, this form pops - user searches , clicks in 1 of results clicks 'select model' that returns model_id selected user popup form original form. googling has not helped much, can point me in right direction? should using openargs on second form, or first , second form? or should using else entirely?

php - How to access wordpress custom post type Object -

please help: i getting custom post type object within wordpress. print_r($this) returns. how can content of 'key', example? post_types object ( [post_types_definition:post_types:private] => array ( [0] => array ( [key] => solutions [name] => solutions [taxonomies] => array ( ) [categories] => [show_in_nav_menus] => [settings] => array ( [0] => array ( [title] => solutions settings field [description] => solutions settings field [type] => text [properties] => array ( [text-id] => solutions_settings_field_2 ) ) ) ) ) ) any highly appreciated it! run get_object_vars() on $this variables available you. there, should able access variab...

jquery - Javascript URL Parameter Capture Not Working Properly -

i working on django website have search function in can choose version, server, , user , display relevant results. implementing share button can go search results. first tested page variables set myself see if table of results load , worked fine. trying use js function capture url parameters , display results based on (the whole point). this js function using: function getqueryvariable(variable){ var query = window.location.search.substring(1); var vars = query.split("&"); (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if(pair[0] == variable){return pair[1];} } return(false); } i have tested function online , returns correct information want. on page should load tables gets stuck on loading forever. when using preset variables works perfectly. need find difference between , function returns. this how tested functionality: var version = "01.002.157.01.00...

c - Configure weak host validation on server-side TLS connection with Apple Secure Transport -

i want write server (purely testing!!) allows client connect cert includes invalid hostname. i'm using apple's secure transport api in c on mac os x. set server connection like: sslcontextref ssl_ctx_ref = sslcreatecontext (kcfallocatordefault, ksslserverside, ksslstreamtype); sslsetclientsideauthenticate (ssl_ctx_ref, ktryauthenticate); with in place, if client presents certificate invalid hostname, sslhandshake fails errsslclosedabort (-9806). passing kneverauthenticate instead of ktryauthenticate allows invalid client cert. questions: is sslsetclientsideauthenticate right function using purpose -- enabling weak hostname validation client certificates? if so, why doesn't ktryauthenticate so, why must use kneverauthenticate ?

How can I make an appointment in outlook with php? -

i´m having issue , don´t know why, example date 20160729 , time 080000 means must make appointment 2016-07-09 @ 8:00 weird reason in outlook takes 5 hours away, appointment @ outlook made @ 3:00 am...i need fix timezone/something issue! <?php function sendicalevent($from_name, $from_address, $to_name, $to_address, $year, $month, $day, $hour, $minute, $seconds, $endhour, $endminute, $subject, $description, $location) { //create email headers $headers = "from: someone@someone\r\n"; $headers .= 'content-type:text/calendar; content-disposition: inline; charset=utf-8;\r\n'; $message = "begin:vcalendar\r\n version:2.0\r\n prodid:-//hpe-scheduler// v1.0//en\r\n method:request\r\n begin:vevent\r\n uid:".$to_address."\r\n dtsamp:".$year.$month.$day."t".$hour.$minute.$seconds."z\r\n dtstart:".$year.$month.$day."t".$hour.$minute.$seconds."z\r\n dtend:".$year.$month.$day."t".$endhour.$endminute.$seco...

jquery - Tabs inside a tab does not work -

https://codepen.io/simii/pen/grvxbe heres codepen. <div class="row"> <div class="col s12"> <ul class="tabs2"> <li class="tab col s3"><a href="#test1">test 1</a></li> <li class="tab col s3"><a class="active" href="#test2">test 2</a></li> <li class="tab col s3 disabled"><a href="#test3">disabled tab</a></li> <li class="tab col s3"><a href="#test4">test 4</a></li> </ul> </div> <div id="test1" class="col s12">test 1</div> <div id="test2" class="col s12"> <div class="row"> <div class="col s12"> <ul class="tabs"> <li class="tab col s3"><a hr...