Posts

Showing posts from March, 2015

android - xamarin navigate from one fragment to another -

i trying navigate on fragment click button in original fragment. how ever got exception image of exception image of code original fragment the problem passing layout in call of transaction.replace(), instead should pass id of viewgroup fragment inserted in layout. so layout of activity containing fragments should this: <?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="fill_parent" /> </framelayout> and in fragmentstocksearch fragment, override oncreateview this: public override view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { return inflater.inflate(resource.layout.your_layout, null, false); } and fragment transaction

PHP: mail() function is not sending emails to GMAIL -

i have subscription form. simple! email input, that's it. <input type="text" id="email" name="email" value=""> <button id="subscribe" type="button">subscribe</button> what want php send email me (ej, myemail@gmail.com ), account gmail account, subscriber's email address message. simple!...or thought. <?php $subscriber = filter_input(input_post, 'email'); /* send email */ $to = "myemail@gmail.com"; $subject = 'new subscriber'; $message = 'the following person wants subscribe: ' . "\r\n" . $subscriber; $headers = 'from: ' . $subscriber . "\r\n" . 'mime-version: 1.0' . "\r\n" . 'content-type: text/plain; charset=utf-8'; mail($to, $subject, $message, $headers); ?> the php code works, when use email not gmail ! can please me make work gmail?

Laravel search logic issue -

i developing search module in laravel 5.1 searches businesses along phone numbers (records). -- tables businesses: id, name, status records: id, business_id, number, note the search must return results when both business name , records note found given keywords. returns businesses if associated records(note) not match. here code:- $keywords = explode(" ", request::get('keywords')); $businesses = app\business; $businesses = $businesses->where(function ($query) use ($keywords) { foreach ($keywords $name) { $query->orwhere('name', 'like', "$name%"); } }); $businesses = $businesses->with(['records' => function ($query) use ($keywords) { $query->where('note', 'like', '%'.$keywords[0].'%'); foreach ($keywords $note) { $query->orwhere('note', 'like', "%$note%"); } }]); $businesses = $businesses->where('status

regex - java regular expression for String surrounded by "" -

i have: string s=" \"son of god\"\"cried out\" day , ok "; this shown on screen as: "son of god""cried out" day , ok pattern phrasepattern=pattern.compile("(\".*?\")"); matcher m=phrasepattern.matcher(s); i want phrases surrounded "" , add them arraylist<string> . might have more 2 such phrases. how can each phrase , put arraylist ? with matcher you're 90% of way there. need #find method. arraylist<string> list = new arraylist<>(); while(m.find()) { list.add(m.group()); }

java - Recursively count the number of leaves in a binary tree without given parameters -

i struggling figure out how code recursive algorithm count number of leaves in binary tree (not complete tree). far traversing far left leaf , don't know return there. trying count loading leaves list , getting size of list. bad way go count. public int countleaves ( ) { list< node<e> > leaflist = new arraylist< node<e> >(); //binarytree<node<e>> treelist = new binarytree(root); if(root.left != null) { root = root.left; countleaves(); } if(root.right != null) { root = root.right; countleaves(); } if(root.left == null && root.right == null) { leaflist.add(root); } return(); } elaborating on @dasblinkenlight idea. want recursively call countleaves on root node & pass # caller. on following lines. public int countleaves() { return countleaves(root); } /** * recursively count nodes */ private static int countleaves

swift string advancedBy is slow? -

so writing in swift practice online judge. here's issue: longest palindromic substring given string s, find longest palindromic substring in s. may assume maximum length of s 1000, , there exists 1 unique longest palindromic substring. so using dp solve in swift: class solution { func longestpalindrome(s: string) -> string { var hash = array(count: s.characters.count, repeatedvalue: array(count: s.characters.count, repeatedvalue: false)) in 0 ..< s.characters.count { hash[i][i] = true } var maxstart = 0 var maxend = 0 var maxcount = 1 in 1.stride(through: s.characters.count - 1, by: 1) { j in 0 ..< s.characters.count - 1 { if j + < s.characters.count { if isvalidpalindrome(j, j + i, s, hash) { hash[j][j + i] = true if maxcount < + 1 { maxcount =

How can I use dependency injection in a Gluon Desktop app? -

does know if there easy way use dependency injection within fxml controllers of gluon desktop (particleapplication) app? there @inject used things public class homecontroller { @inject particleapplication app; @inject private viewmanager viewmanager; @inject private statemanager statemanager; (as part of framework) able @inject own objects. edit: answer suggested use gluon ignite, i'm still having trouble figuring out. here of attempted code: my particleapplication class: package com.gluonapplication; import com.gluonhq.ignite.guice.guicecontext; import com.gluonhq.particle.application.particleapplication; import com.google.inject.abstractmodule; import javafx.scene.scene; import java.util.arrays; public class gluonapplication extends particleapplication { private guicecontext context = new guicecontext(this, () -> arrays.aslist(new guicemodule())); public gluonapplication() { super("gluon desktop application");

unity3d - Unity Resources.Load<Sprite> vs as Sprite -

i've tried change image of object code (used as sprite cast): getcomponent<spriterenderer>().sprite = resources.load("gameobjects/tiles/hole") sprite; it did not work, worked (used <sprite> ): getcomponent<spriterenderer>().sprite = resources.load<sprite>("gameobjects/tiles/hole"); what's difference? resources.load("gameobjects/tiles/hole") sprite; you have "hole" in resources folder. other-hole not sprite . therefore when use as sprite can't casted 1 , won't throw exception (on line) because: the operator cast operation. however, if conversion isn't possible, returns null instead of raising exception. resources.load<sprite>("gameobjects/tiles/hole"); in working code specify file want, sprite , finds correct one.

javascript - Convert Base64 to PNG/JPEG file in R -

i have seen process convert png file base64 work in post below convert r image base 64 i exact opposite of did. have base64 of image stored in variable "capimg" , want convert png or jpeg file. can me reverse engineer process. is doable? i have seen done using php below need r script same <?php $data = urldecode($_post['imagedata']); list($type, $data) = explode(';', $data); list(, $data) = explode(',', $data); $data = base64_decode($data); file_put_contents('image.png', $data); ?> in fact able decode base64 vector using base64enc package below y <- base64decode(capimg) but not know how proceed further this works me: library(base64enc) enc <- base64encode("images.jpg") conn <- file("w.bin","wb") writebin(enc, conn) close(conn) inconn <- file("w.bin","rb") outconn <- file("img2.jpg","wb") base64decode(what=inconn, output=o

polymer - paper-drawer-panel's closeDrawer() not closing with custom header element -

update able close drawer document.queryselector('paper-drawer-panel').forcenarrow = true; . going delete question maybe leave see if there way proper closedrawer() i wrote own custom header, doesn't use of paper header behaviors. it's it's own custom element html styled header no behavior or features. i implemented paper-drawer-panel worked great custom header. however, can not closedrawer() close drawer. see function function () { this.selected = 'main' } , not sure how applies inner code of paper-drawer-panel . how can make paper-drawer-panel 's closedrawer() close drawer? index.html: <template is="dom-bind" id="app"> <paper-drawer-panel> <div drawer> <drawer-custom></drawer-custom> </div> <div main> <header-custom></header-custom> <video-selection data-route="home" tabindex="-1"></vid

java - How to get session time out message using Spring security -

i want session time out message when session expires.below spring-security.xml <http auto-config="true" use-expressions="true"> <logout logout-success-url="/" invalidate-session="true" logout-url="/logout"/> <form-login login-page="/login" username-parameter="name" password-parameter="pwd"/> <session-management invalid-session-url="/?timeout=true"> <concurrency-control max-sessions="1" expired-url="/timeout?timeout=true" /> </session-management> </http> according knowledge using above code when session expired should redirect /?timeout=true or /timeout?timeout=true . , on logout should go / . in case on logout redirecting invalid-session-url getting timeout true both normal logout , session timeout. please me differentiate this. update /logout request contains session = request.getsession(); ses

Android Buttom sheet is not working -

android bottom sheet not working. below code , want create bottom sheet demo not working , bottom sheet not showing. public class mainactivity extends appcompatactivity implements view.onclicklistener{ private bottomsheetbehavior mbottomsheetbehavior; private button button1; private view bottomsheet; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); getid(); setlistner(); mbottomsheetbehavior = bottomsheetbehavior.from(bottomsheet); } private void getid() { try { button1 = (button)findviewbyid(r.id.button1); bottomsheet = findviewbyid(r.id.bottom_sheet); } catch (exception e) { e.printstacktrace(); } } private void setlistner() { try { button1.setonclicklistener(this); } catch (exception e) { e.printstacktrace()

ruby on rails - Whenever gem for Cron job uses incorrect outdated version of bundler -

i set cron job in schedule.rb executes custom rake file. here schedule.rb: set :environment , :development every 2.minutes rake "runpy" , :output => {:error => "/home/aditya9509/desktop/rubystack-2.0.0-33/projects/myapp/log/error.log" , :standard => "/home/aditya9509/desktop/rubystack-2.0.0-33/projects/myapp/log/cron.log"} end note runpy custom rake file , works fine when ran terminal using command: rake runpy i have set standard output cron.log , error output error.log when running cron job, there no error printed in error.log following in cron .log: in gemfile: rails (= 4.2.4) depends on bundler (< 2.0, >= 1.3.0) current bundler version: bundler (1.0.15) so checked current bundler version using command bundler --version which outputs bundler version 1.11.2 further, thought check list of available bundlers can uninstall 1.0.15 version used cron automatically uses 1.11.2 version. ran following

automate csv import in mysql db in linux environment -

is there way have .csv imported sql table automatically in mysql db? know how manually, there situation .csv exported nightly peoplesoft , want imported automatically sql table in linux environment. plese give me sample script that.. if there's way, can point me in direction (i'm not sql expert)!! you can try creating stored procedure, write load csv query sp. create event call sp. hope helps. create event if not exists `load_csv_event` on schedule every 23 day_hour call my_sp_load_csv(); alos, can directly create event , write load query it.

c - Why _mm256_load_pd compiled to MOVUPD instead of MOVAPD? -

why following code results unaligned avx instructions ( movupd instead of movapd)? compiled on visual studio 2015. how can tell compiler data indeed aligned? const size_t align_size = 64; const size_t array_size = 1024; double __declspec(align(align_size)) a[array_size]; double __declspec(align(align_size)) b[array_size]; //calculate dotproduct __m256d ymm0 = _mm256_set1_pd(0.0); (int = 0; < array_size; += 8) { __m256d ymm1 = _mm256_load_pd(a + i); __m256d ymm2 = _mm256_load_pd(b + i); __m256d ymm3 = _mm256_mul_pd(ymm1, ymm2); ymm0 = _mm256_add_pd(ymm3, ymm0); __m256d ymm4 = _mm256_load_pd(a + + 4); __m256d ymm5 = _mm256_load_pd(b + + 4); __m256d ymm6 = _mm256_mul_pd(ymm4, ymm5); ymm0 = _mm256_add_pd(ymm6, ymm0); } assembly of loop: 00007ff7ac7a1400 vmovupd ymm1,ymmword ptr [rbp+rax*8+2020h] 00007ff7ac7a1409 vmulpd ymm3,ymm1,ymmword ptr [rbp+rax*8+20h] 000

iphone - Uploading an iOS app to the Apple AppStore -

Image
what i'm trying upload app version 2.0.1 end users. error message: error itms-90478: "invalid version. build version “2.7” can’t imported because later version has been closed new build submissions. choose different version number." error itms-90062: "this bundle invalid. value key cfbundleshortversionstring [2.0.1] in info.plist file must contain higher version of approved version [2.7]." the in appstore under version 1.4.3 , i'm trying upload 2.0.1: the ios builds 1.4.3 went 2.7 though, going problem if want named 2.0.1 in store? this i've filled in version , buildnumber right now: i had same experience. made build version higher previous loaded version. you don't need worry build number. make version 2.7.1. eliminate both errors. worked me.

html - How to add to a <ul> using Angularjs - upon click of button/user input entry? -

pls refer jsfiddle https://jsfiddle.net/sash2507/9g5c3f49/1/ i need way take user input (filename) input box - , add list item <ul> . thought .push directive work , ng-bind on <ul> of empty array variable? isn't working. appreciated, thanks. ///////////html///////////// <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/style.css"> <script `enter code here`src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script> <script src="js/main.js"></script> </head> <body ng-app="mymodule"> <div ng-controller="mycontroller ctrl"> <h2>folders</h2> <input type="checkbox" ng-model="ctrl.isboxchecked">expand <div ng-show=&q

javascript - Two way Binding Not working Instantly in AngularJS While Using Custom Directives -

plunkr i have simple auto-complete dropdown . works fine when use controller. i want make reusable,so made custom directive isolated scope . but problem when type on search text box, not call controller function assigned ng-change instantly. when start typing once again, calls function. again takes value typed before not current model value. i new custom directives... don't know how update model instantly , pass directive scope controller scope . another think i can't able pass function parameter html controller function. i think have use $apply or $digest somewhere.. but , how should use ? autofillapp.directive('autofilldropdown', function($rootscope) { return { restrict: 'a', templateurl: "dropdowntemplate.html", replace: true, scope: { 'items': '=autofillitems', 'selected': '=autofillselected', 'change': '&

java - Stop multiple maven build in cmd -

i've got following .bat file : cd project1 && mvn clean install && cd project2 && mvn clean install when project 1 failes on module, continue building project2. the problem here project 2 depends on project 1 , if there failure , want stop. do have suggestions how can that? i parent pom these 2 projects modules , run mvn clean install on parent. when there failure building of other projects skipped.

HTML OData Query Builder -

Image
i developed odata web services exposes entity framework model, need develop query builder this, http://odata.intel.com/querybuilder are there html or js plugin use, open jquery or angularjs, bootstrap or other plugin available instead of recreating wheel. https://odataquerybuilder.codeplex.com/ var url = 'https://services.odata.org/v4/northwind/northwind.svc'; var builder = new xrm.odata.querybuilder(url) .setentity('orders') .setcolumns('orderid,customerid,shipcountry') .setexpand('order_details') .setfilters(new xrm.odata.filterinfo({ filtertype: xrm.odata.filtertypes.and, filterexpressions: [ "shipcountry eq 'sweden'", 'orderid lt 10800' ], filters: [ new xrm.odata.filterinfo({ filtertype: xrm.odata.filtertypes.or, filterexpressions: [ "customerid eq 'bergs'", 'orderid gt 10700' ],

visual studio 2010 - Searching for a string in file using c# -

i wanna search string(function) in large file , if found, have search string(signal) , replace it. have written code signal getting updated outside function. want modify signals found inside function. iam beginner c# , kind of appreciated. if (openfiledialog2.filename.contains(function)) file.writealltext(openfiledialog2.filename, file.readalltext(openfiledialog2.filename).replace(signal, replace)); messagebox.show("done"); } i tried, string contents = file.readalltext(openfiledialog2.filename); if(contents.contains(function)) { file.writealltext(openfiledialog2.filename, file.readalltext(openfiledialog2.filename).replace(signal, replace)); messagebox.show(

email - Postfix mail server issue -

i error in postfix mail.log postfix/error[2537]: 3c1e26fb3a: to=<root@ar.net>, orig_to=<root>, relay=none, delay=9.3, delays=9.3/0/0/0, dsn=4.0.0, status=deferred (delivery temporarily suspended: host mailgot.xo.com[192.13.11.78] refused talk me: 550 many invalid recipients) and result of ps aux | grep postfix error -n retry -t unix -u. put google: refused talk me: 550 many invalid recipients . if send many messages unknown mailboxes, mail server can blacklist ip... grep log mailgot.xo.com see sent.

php - Input Double Value with Ajax -

how input 2 value in database ajax? or maybe have solution php $model_reservasi_detail = new tmreservasidetail; $model_reservasi_detail->idreservasi = $model->idreservasi; $model_reservasi_detail->nokamar = $_post["idkamarbed"][$i]; $model_reservasi_detail->idkamar = $_post["nokamar"][$i]; ajax html += "<td align='center'><input type='checkbox' value='"+obj[key]["nokamar"]+"' id='idkamarbed_"+obj[key]["idkamar"]+"' name='idkamarbed[]'></td><td>&nbsp;</td><td align='center'><b>"+obj[key]["nokamar"]+"</td><td align='center'><b>"+obj[key]["kapasitas"]+"</b></td>"; in code input nokamar. how input idkamar too? can replace "nokamar" "idkamar"

php - Get Updated Record in Session -

i'm trying store latest record updated in user profile using session, record updating in database unable latest record value in session, session showing old value. here code of controller class // update student information public function model_studentupdate() { $studentid = $this->db->escape($this->session->userdata('student_id')); $studentname = $this->db->escape($this->input->post("name")); $studentcontact = $this->db->escape($this->input->post("contact")); $studentcity = $this->db->escape($this->input->post("city")); $studentcountry = $this->db->escape($this->input->post("country")); // update record in user table $this->db->query("update `ot4u_users` set `user_name`=$studentname, `user_phone`=$studentcontact, `user_country`=$studentcount

javascript - Is it possible to limit "each in" in Meteor? -

i'm writing rss reader using meteor. server parses .rss/.xml , splits in several items written collection. on client-side feed items displayed. how can limit number of items displayed on page ? tried limit in return statement that's not working. {{#each item in feed_item}} <div class="row"> <div class="col-lg-12"> <h3><a href="{{item.link}}" target="_blank">{{item.title}}</a></h3> <h4>{{item.pubdate}}</h4> <h5>{{item.website}}</h5> <p>{{item.description}}</p> </div> </div> {{/each}} db_feed_item = new meteor.collection("feed_item"); template.feed.helpers({ 'feed_item': function () { return db_feed_item.find({} , {sort: {pubdate: -1}}, {limit: 10}); } }); any appreciated. there should 1 ob

asp.net mvc - would you like to trust the iis express ssl certificate -

i read tutorial http://www.asp.net/mvc/overview/security/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on . in paragraph 8 , accidentally click "no".how fix it?

php - WordPress get data into variables -

i having trouble figuring out how data instead of printing it. want data , store variables. i want navbar instead of printing it, how can store in variable $navbar ? wp_nav_menu( array('menu_class' => 'nav navbar-nav navbar-right','theme_location' => 'primary','container' => false,) ) can try below code: <?php $navbar = ''; ob_start(); wp_nav_menu( array('menu_class' => 'nav navbar-nav navbar-right','theme_location' => 'primary','container' => false) ); $navbar = ob_get_contents(); ob_end_clean(); echo $navbar; ?>

mysql - Hibernate not inserting rows -

i able generate schema when try insert, nothing seems happening. won't print in logs either. phone table primary key composite key consisting of phonenumber , foreign key id. i have classes below student.java import java.io.serializable; import java.util.set; import javax.persistence.cascadetype; import javax.persistence.entity; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.id; import javax.persistence.joincolumn; import javax.persistence.onetomany; @entity @suppresswarnings("serial") public class student implements serializable { @id @generatedvalue(strategy = generationtype.auto) private int id; private string fname; private string lname; private string mname; @onetomany(cascade = cascadetype.all) @joincolumn(name = "id") private set<phone> phones; /** * @return fname */ public string getfname() { return fname; } /** * @return id */ public int getid() { return id;

c++ - Generic method to apply operation on the given struct member -

i want implement generic method apply determined operation on struct member, passing member parameter. this: typedef struct type_t{ int a; double b; } type; void gen_method(type &t, typemember m){ t.m += 1; } what i've done until now: typedef struct type_t{ int a; double b; } type; typedef double type::* pointertotypememberdouble; void gen_method(type &t, pointertotypememberdouble member){ t.*member += 1; } what want do now want implement same generic method using templates allow user access struct member, independentrly of type. i've tested: typedef struct type_t{ int a; double b; } type; template<typename t> struct pointertotypemember{ typedef t type::* type; }; template<typename t> void gen_method(type &t, pointertotypemember<t>::type member){ // ... } the error when try compile, errors list: error c2061: syntax error : identifier 'type' and warning: warning c4346: 'm

php - How to fix: Warning: mysqli_get_server_info() expects parameter 1 to be mysqli? -

i'm bad in php , i'm trying install arfoo.com on host. had problem mysql , mysqli, fixed now. but error: warning: mysqli_get_server_info() expects parameter 1 mysqli, string given in /home/***/install/step4.php on line 47 for following code: <?php /** * arfooo * * @package arfooo * @copyright copyright (c) arfooo annuaire (fr) , arfooo directory (en) * guillaume hocine (c) 2007 - 2010 * http://www.arfooo.com/ (fr) , http://www.arfooo.net/ (en) * @author guillaume hocine & adrian galewski * @license http://creativecommons.org/licenses/by/2.0/fr/ creative commons */ session_start(); error_reporting(e_all); require_once('languages/' . $_session['selectedlanguage'] . '.php'); $chemin_includes_header = 'includes/'; include_once($chemin_includes_header.'header.php'); require_once("dbfunctions.php"); require_once("createdb.php"); function createdbconfig

jsf 2.2 - Remove comments from CSS and JavaScript files in JSF page -

is there configuration in jsf can configure jsf engine skip comments in css , javascript files similar xhtml files? no. jsf doesn't offer facility. jsf nothing dynamic js files. dynamic thing jsf css files evaluating el expressions, particularly in order support resource mapping #{resource} in css files. see a.o. how reference jsf image resource css background image url . your best bet using css , js minifier. not removes comments, can compress it. known example yui compressor . there maven plugins automatically run during build, such minify .

php - Wechat : OAuth with test account -

Image
i'm trying set oauth login wechat web application. so, have create account on wechat, , used test account have access unlimited. so, on test account configuration, have validate token wechat (see here : http://admin.wechat.com/wiki/index.php?title=getting_started ). on doc, oauth explain here : http://admin.wechat.com/wiki/index.php?title=user_profile_via_web we must redirect user url login: https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state#wechat_redirect i have replace appid test account appid, redirect uri : http://wechat.mydomain.net , scope correct 1 (snsapi_userinfo) , remove state param (optional). but, had error on wechat : oops! went wrong:( after hours of research, set domain on "api permission list", in " webpage account" but have error. maybe missing something, don't find what. there final url called : https://open.weixin.qq.com

Has anyone implemented an android plugin for unity using OpenCV? -

i have written android app using opencv , native code, when try extract libraries unity crashes when loads opencv libs. public class mainactivity extends unityplayeractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); if (!opencvloader.initdebug()) { log.e(this.getclass().getsimplename(), " opencvloader.initdebug(), not working."); } else { log.d(this.getclass().getsimplename(), " opencvloader.initdebug(), working."); } //this doesn't work either //opencvloader.initasync(opencvloader.opencv_version_3_1_0, this, mloadercallback); } } is there way overcome , load opencv libs? or should create interface unity , load .jar without extending unityplayeractivity? the time spend implementing , converting plugin not worth it. use made plugin asset store. not free worth supports other platforms well.

html - Safari - Adding content in iframe with javascript CSS issue -

i'm adding html in iframe: <div class="parentclass"> <div class="classchild1">block 1 content</div> <div class="classchild2">block 2 content</div> <div> my classchild1 has no css rules defined (but should) , refuses triggered in javascript. tried to: console.log(myiframecontent.find('.classchild1')); // output 0 when directly change element dom , add class, css , works fine. since can't find javascript can't manipulate block. everything working fine classchild2 css defined same .css , got no problem in chrome/ie/firefox. thanks suggestions

javascript - Match a pattern with a string and extract information -

i working on google apps script. want user enter pattern mm/dd/yyyy hh:mm:ss according pattern want extract information string. string 02/29/2016 07:00:00 pm est . want extract date, month, year, hour, minute , second time-stamp string using pattern given user. how can achieved in javascript ? you can try example (in google apps script): var = extractdatetimeinfo('mm/dd/yyyy hh:mm:ss', '02/29/2016 07:10:14 pm est'); logger.log(a); //output: year: 2016, month: 02, date: 29, hours: 07, min: 10, sec: 14 var b = extractdatetimeinfo('yyyy-mm-dd hh:mm', '2016-12-26 16:13 pm est'); logger.log(b); //output: year: 2016, month: 12, date: 26, hours: 16, min: 13, sec: function extractdatetimeinfo(patt, t) { var yyyypos = patt.indexof('yyyy'); var mmpos = patt.indexof('mm'); var ddpos = patt.indexof('dd'); var hhpos = patt.indexof('hh'); var mmpos = patt.indexof('mm'); var sspos = patt.index

android - i want a popup menu when i click on my listview item -

my activity contains listview have 5 item in listview. items in listview , , want when click on first item in listview , there radio button in popup menu also package com.example.shivnandan.fit; import android.content.context; import android.content.intent; import android.content.res.resources; import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.snackbar; import android.view.contextmenu; import android.view.layoutinflater; import android.view.view; import android.support.design.widget.navigationview; import android.support.v4.view.gravitycompat; import android.support.v4.widget.drawerlayout; import android.support.v7.app.actionbardrawertoggle; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.menu; import android.view.menuitem; import android.view.viewgroup; import android.widget.adapterview; import android.widget.baseadapter; import android.widge

java - FileAlreadyExistsException with REPLACE_EXISTING option -

inside code there loop substitute file file. this done with: java.nio.file.files.move(path source, path target, copyoption... options) throws ioexception the following exception thrown: exception in thread "main" java.nio.file.filealreadyexistsexception: c:\brute-force\test-loads-2-forces-only.dat.temp -> c:\brute-force\test-loads-2-forces-only.dat @ sun.nio.fs.windowsexception.translatetoioexception(unknown source) @ sun.nio.fs.windowsexception.rethrowasioexception(unknown source) @ sun.nio.fs.windowsfilecopy.move(unknown source) @ sun.nio.fs.windowsfilesystemprovider.move(unknown source) @ java.nio.file.files.move(unknown source) (*) @ bruteforce.main.changevalue(main.java:260) @ bruteforce.main.main(main.java:71) the line @ exception thrown: (*) @ bruteforce.main.changevalue(main.java:260): files.move(path, path.resolvesibling("destiny_file"), replace_existing); javadoc defines exception: ... filealreadyexistsexcept

python 2.7 - Saving Interactive Bokeh Chart -

i have created interactive bokeh chart various widgets allow manipulation of data. want understand standard way of sharing such plot or how save sharing. the plot created curdoc method , output bokeh server using session.show(). #create current visualization using plot p , widgets inputs curdoc().add_root(hbox(inputs, p, width=1100)) #run session session = push_session(curdoc()) session.show() # open document in browser session.loop_until_closed() # run forever does app trigger actual python code? if not, might consider reworking non-server standalone document (using customjs callbacks, instance). generate self-contained static html file publish or send anywhere, , have accessible. if app does rely on executing actual python code work, needs running somewhere users interact it. first off, suggest make real app runs in server, ones in demo app gallery (see use case scenarios in user's guide). real server app, i.e. 1 run bokeh serve myapp.py , preferred on

profiling - Error with djigger in agent mode (java.io.InvalidClassException) -

when trying out newer features of develop branch in djigger, i'm running following exception (see below). not sure i'm doing wrong. unexpected error java.io.invalidclassexception: io.djigger.monitoring.java.model.threadinfo; local class incompatible: stream classdesc serialversionuid = 2091258603924023895, local class serialversionuid = 4152628234709390380 @ java.io.objectstreamclass.initnonproxy(objectstreamclass.java:616) ~[na:1.8.0_73] @ java.io.objectinputstream.readnonproxydesc(objectinputstream.java:1623) ~[na:1.8.0_73] @ java.io.objectinputstream.readclassdesc(objectinputstream.java:1518) ~[na:1.8.0_73] @ java.io.objectinputstream.readordinaryobject(objectinputstream.java:1774) ~[na:1.8.0_73] @ java.io.objectinputstream.readobject0(objectinputstream.java:1351) ~[na:1.8.0_73] @ java.io.objectinputstream.readobject(objectinputstream.java:371) ~[na:1.8.0_73] @ java.util.arraylist.readobject(arraylist.java:791) ~[na:1.8.0_73] @ sun.refle

css - Gradients give the wrong color on iOS mobile safari -

Image
i'm developing mobile app cordova phonegap uses gradients stack on top of eachother. on android works supposed on ios gradients shows different. edges green whereas when preview in browser blue it's supposed be. there's weird transition @ bottom of page. this css: #gradient2layer1 { position: fixed; height: 100px; bottom: 0; left: 0; height: 20%; width: 100%; color = "blue"; background: -webkit-linear-gradient(270deg, rgba(15,431,28,0) 35%, #b3c6ff 50%,rgb(128,128,128) 100%); z-index: 100; } #gradient2layer2 { position: fixed; height: 100px; bottom: 0; left: 0; height: 20%; width: 100%; opacity: 0.5; color = "blue"; background: -webkit-linear-gradient(270deg, rgba(15,431,28,0) 35%, blue 50%, blue 100%); animation: fadein 5s infinite alternate; z-index: 100; } how can fix this? i believe typo , wanted use rgba(15,43,128,0) (which shade of blue you're looking for) instead of rgba(15,431,28,0) , not valid rgb value (limited 0.

java - JAXB schemagen doesn't reference classes in episode file -

i using schema first approach, hit roadblock "ominous" jaxb map problem ! , worked around switching code first approach one. i'd reuse type in other modules , continue schema first approach creating episode file generated schema. unfortunately generated episode file empty. here tried: <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>jaxb2-maven-plugin</artifactid> <version>2.2</version> <executions> <execution> <id>schemagen</id> <goals> <goal>schemagen</goal> </goals> <phase>generate-sources</phase> </execution> </executions> <configuration> <outputdirectory>${project.build.outputdirectory}</outputdirectory> <generateepisode>true</generateepisode> <transformschemas> <t