Posts

Showing posts from September, 2012

debian - Google Cloud Platform: ssh from VM_1 in project_A to VM_2 in project_B -

i trying connect virtual machine vm_1 in project_a virtual machine vm_2 in project_b. bot on debian linux. steps did: on vm_1 project_a generated private , public keys ssh-keygen -t rsa -f ~/.ssh/my-ssh-key -c example-user $ chmod 400 ~/.ssh/my-ssh-key in browser, metadata page of project_b. clicked ssh keys show list of project-wide public ssh keys , added public keys created vm_1 project_a now keys added tried ssh virtual machine vm_1 on project_a vm_2 on project_b it giving error permission denied (publickey) please advise it seems bug can not apply public key particular vm in project. able connect applying public ssh key whole project.

excel - Invert day and month from a date value if condition is met -

i have following 2 date columns in excel: a b dd-mm-yyyy dd-mm-yyyy hh:mm if day value , month value of 2 columns don't match, , month of b column matches day of column , day of b column matches month of column, have invert day , month values of b column. for example, if have: a b 04-10-2016 10-04-2016 22:10 i need vba turns into: a b 04-10-2016 04-10-2016 22:10 i like: for j=1 range("a1").end(xldown).row if extractdate(cells(j, 2)) <> cells(j, 1) , extractmonth(cells(j, 2)) = extractday(cells(j, 1) , extractday(cells(j, 2)) = extractmonth(cells(j, 1) invertdayandmonth(cells(j, 2) end if next j i know functions don't exist, can me out that? no real need perform check. if date in column guaranteed accurate, need column b time part. extract time part column b , add date part of column a. put result need it.

ios - keeping track of newly created subviews -

every time create subview want update int can reference specific subview later. for example, class circularkey: uiview { var oscid = 0; //init 0 init(origin: cgpoint) { oscid = oscid + 1; ... } } can have number update every time create new circularkey each circularkey has own unique self.oscid? thanks edit: i'm trying viewcontroller.swift responsible adding these subviews. class viewcontroller: uiviewcontroller { var numoscs = 0; //update when add new bosc .... ... func didtap(tapgr: uitapgesturerecognizer) { numoscs = numoscs + 1 let newcircularkey = circularkeyview(origin: tappoint, oscindex: numoscs) self.view.addsubview(newcircularkey) } my assumption upon every didtap numoscs shall incremented, stays @ zero. do? edit2: never mind, works :d i believe best solution have invoking controller keep track of how many has made far. all i think controller add...

ruby on rails - Can i write this Query in ActiveRecord -

for data analysis need both results 1 set. a.follower_trackings.pluck(:date, :new_followers, :deleted_followers) a.data_trackings.pluck(:date, :followed_by_count) instead of ugly-merging array (they can have different starting dates , obv. need values date exists in both arrays) thought mysql select followers.new_followers, followers.deleted_followers, trackings.date, trackings.followed_by_count instagram_user_follower_trackings followers, instagram_data_trackings trackings followers.date = trackings.date , followers.user_id=5 , trackings.user_id=5 order trackings.date desc this working fine, wonder if can write same activerecord? you can following should render same query raw sql, it's quite ugly...: a.follower_trackings. merge(a.data_trackings). from("instagram_user_follower_trackings, instagram_data_trackings"). where("instagram_user_follower_trackings.date = instagram_data_trackings.date...

html - Cant add more content? -

i have added header , have added 1 paragraph, each time try adding content not show. have tried list, paragraph , header , neither of them have worked. have no clue why! html <div id="midwrap"><a class="headerone">tag helper</a> <p class="paragraph1tag">select coding in using "tag helper".</p> <p class="paragraph1tag">selesdgsdgdsgct coding in using "tag helper".</p> </div> css #midwrap { width: 70%; height: 90%; border-left: 1px solid #c4c4c4; top: 10px; position: relative; overflow: hidden; float: right; clear: right; margin-right: 7%; } .headerone { color: #000000;; font-size: 25px; font-family: sans-serif; position: relative; margin-left: 15px; } .paragraph1 { color: #000000;; font-size: 14px; font-family: sans-serif; position: relative; margin-left: 15px; } remove overflow: hi...

xml - LibXML - Looping through nodes until -

i'm trying parse below xml using perl's xml::libxml library. <?xml version="1.0" encoding="utf-8" ?> <taggedpdf-doc> <part> <sect> <h4>2.1 study purpose </h4> <p>this study purpose content</p> <p>content 1</p> <p>content 2</p> <p>content 3 </p> <p>content 4</p> <p>3. header</p> <p>obj content 4</p> <p>obj content 2</p> </sect> </part> </taggedpdf-doc> for header study purpose, i'm trying display related siblings. expected output is: <h4>2.1 study purpose </h4> <p>this study purpose content</p> <p>content 1</p> <p>content 2</p> <p>content 3 </p> <p>content 4</p> my perl code below. can display first node. given value of first node,study purpose, there way can loop , print nodes un...

php - Looping through and displaying multiple table rows from database sql -

im trying loop through database , displaying every row. don't know wrong code not displaying @ all... can help? <?php $players = mysql_query("select * users"); while ($row = mysql_fetch_assoc($players)) { $steamid = $row["name"]; $profilename = $row["profilename"]; $profileurl = $row["profileurl"]; $avatar = $row["avatar"]; $region = $row["region"]; ?> <p><?php echo $name ?></p> <p>><?php echo $profilename ?></p> <p>><?php echo $profileurl ?></p> <p><?php echo $avatar ?></p> <?php } ?> this im including file: <?php include 'fetch_players.php'; ?> an example of using mysqli_* correct approach given below. please take care of comments too:- <?php error_reporting(e_all); // check type of error ini_set('display_errors',1); // display error $connection = mysqli_conne...

php - CakePhP hasMany not working on different database -

i'm using latest cakephp 2.8 in system. i'm able data other database in system, different datasource, same connection (user/pass) local database server. i'm able query content of table on different database, problem has many relation not showing. when i'm using same datasource, has many working perfectly. is possible fix ?

java - Locale - two argument construct in action -

here's code snippet locale classes used date formatting: list<locale> locales = new arraylist<>(8); locales.add(new locale("en")); locales.add(new locale("pl")); locales.add(new locale("en", "pl")); locales.add(new locale("en", "ch")); locales.add(new locale("en", "br")); locales.add(new locale("pl", "jp")); locales.add(new locale("pl", "ger")); locales.add(new locale("pl", "dk")); dateformat dateinstance; (locale locale : locales) { dateinstance = dateformat.getdateinstance(dateformat.full, locale); system.out.println(dateinstance.format(date)); } i got following output: tuesday, april 19, 2016 wtorek, 19 kwietnia 2016 tuesday, april 19, 2016 tuesday, april 19, 2016 tuesday, april 19, 2016 wtorek, 19 kwietnia 2016 wtorek, 19 kwietnia 2016 wtorek, 19 kwietnia 2016 i can't understand constructor's second a...

php - MySQL - Order by honor and write it in "for" together with username from different table -

i have 2 tables. player , stats. in player username , id. in stats honor , id. ids same in both tables. 1 player, 1 id. order stats honor , echo username table. here try, can't order. player counter count of player. +1 reason starts 2 $getplayercounter = mysql_query("select `id` `player`"); $playercounter = mysql_num_rows($getplayercounter); ($i = 2; $i <= $playercounter + 1; $i++) { $username = mysql_query("select `player`.*, `stats`.* `player` inner join `stats` on `player`.`id`=$i , `stats`.`id`=$i") or die(mysql_error());; $fetch = mysql_fetch_assoc($username); echo "<tr>"; echo "<td>".$fetch['username']."</td>"; echo "<td>".$fetch['honor']."</td>"; echo "</tr>"; } without using loop. how solution query sorted list already? kind of like: select * player p join stats s on p.id = s.id order s.honor ...

java - Eclipse refactor Iterator/while to foreach -

does knows if there simple way of refactoring code use foreach iterate on collection instead of while/iterator combo? example: i have: iterator<myobject> iterator = list.iterator(); while (iterator.hasnext()) { myobject myobject = iterator.next(); // stuff } and want: for (myobject myobject : list) { // stuff } and yes, understand won't performance improvements. want less verbose , because fancy :) suppose occurrence of iteration code similar example, try using find , replace following regular expression. find: iterator<([a-za-z0-9_]{1,})> [a-za-z0-9_]{1,} = ([a-za-z0-9_]{1,})\.iterator\(\);\r[\t]{1,}while \(iterator\.hasnext\(\)\) \{\r[\t]{1,}[a-za-z0-9_]{1,} ([a-za-z0-9_]{1,}) = iterator\.next\(\); replace: for($1 $3 : $2) {

php - HTACCESS - Setting root folder as public_html -

so, i'm writing .htaccess file, , i've stumbled upon issue of root folders. currently, http://localhost/public_html/index root of website. want have url http://localhost/index instead. i know pretty simple, of posts have looked @ far have not proven work. here have far, producing 404 error. rewriteengine on rewritecond ${request_filename} !-f rewriterule ^([^\.]+)$ $1.php [nc,l] rewritecond %{request_uri} !^/public_html/ rewriterule ^(.*)$ /public_html/$1 [qsa] please include documentation or guides .htaccess if possible. thanks. the following .htaccess code can added achieve results wanted: rewriteengine on rewritecond %{request_uri} !public_html/ rewriterule (.*) /public_html/$1 [l]

plsql - Combine Rows output for multiple column checks -

Image
i want combine multiple rows single 1 based on multiple column checks. only if remaining columns match program_type should merged comma separated. i tried using listagg unable achieve . tried using connect still not able check conditions. any on same. regards. something select listagg(program_type,',') within group ( order program_type desc ) prog_group emp output: xyz,mno further if want have columns in single query with program1_type ( select distinct id,prog_type ( select id,listagg(program_type,',') within group ( order program_type desc ) on (partition id ) prog_type emp ) )select distinct e.id,e.name,prog_type program_type, e.mname,e.type --add remaining columns here program1_type p,emp e p.id=e.id o/p -screenshot

java - Hi, I am trying to figure out how to pass a string from one class to another -

sorry code. string trying pass contents. let me know if need more info i new java making silly mistakes. have tried making different methods pass string no luck. if able string appear in edittextbox, great. i'm new website; sorry if making rookie mistakes. main class: package com.app.david.booktracker; public class mainactivity extends appcompatactivity { static final string action_scan = "com.google.zxing.client.android.scan"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); inittoolbar(); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; } public void inittoolbar() { toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); toolbar.settitle(...

hadoop - How to correlate all combination of arrays in an RDD? -

i have rdd model.productfeatures() returns rdd in form of (id, array("d", (...))) . example: (1, array("d", (0, 1, 2))) (2, array("d", (4, 3, 2))) (3, array("d", (5, 3, 0))) ... i calculate pairwise correlation between each array, return each id id array has highest correlation. the first thing need pairs of elements, except "diagonal" they're same. >>> rdd.cartesian(rdd).filter(lambda (x, y): x != y).collect() [((1, array('d', [0.0, 1.0, 2.0])), (2, array('d', [4.0, 3.0, 2.0]))), ((1, array('d', [0.0, 1.0, 2.0])), (3, array('d', [5.0, 3.0, 0.0]))), ((2, array('d', [4.0, 3.0, 2.0])), (1, array('d', [0.0, 1.0, 2.0]))), ((3, array('d', [5.0, 3.0, 0.0])), (1, array('d', [0.0, 1.0, 2.0]))), ((2, array('d', [4.0, 3.0, 2.0])), (3, array('d', [5.0, 3.0, 0.0]))), ((3, array('d', [5.0, 3.0, 0.0])), (2, array(...

javascript - change property disabled in a variable containing html with jquery or js -

i need disable elements of class "gcf_crud" variable. my wrong code is: var deftext = ''+ ' <div class="form-group col-md-12">'+ ' <h4 id="minimum-setp">{{title}}</h4>'+ ' <input type="text" class="form-control gcf_crud" id="txtusuari" value="{{data}}"/>'+ ' </div>'; var deftextdisabled = $(deftext).find('.gcf_crud').prop('disabled', true); with code i'm obtaining input need original html. how may right? regards, seak your deftextdisabled variable returns input because of .find('.gcf_crud') . but seems need reference (variable) jquery object containing elements. in order that, break down process in steps: var deftext = '<div class="form-group col-md-12">' + '<h4 id="minimum-setp">{{title}}</h4>' ...

regression - R- cannot access dr.fit() function -

lately have been studying dimension reduction using sliced inverse regression .to implement in r ,im using dr() function dr package. when checked function body of dr(), there exist call dr.fit() inside major slicing , other computations. know how see body of dr.fit() function. when type dr.fit in console ,i error dr.fit object not found. tried getanywhere() too. i don't see dr.fit inside dr function (did mean dr.compute ?), if want browse code why don't download dr_3.0.10.tar.gz package source cran , browse code in r directory.

java - How to log within shutdown hooks with Log4j2? -

log4j2 uses shutdown hooks end it's services. of course want log throughout whole lifecycle of application - shutdown included. log4j no problem. seems impossible. logging shuts down, while application still working on it. has hope me? best regards martin as of 2.0-beta9 configurable in xml <configuration ... shutdownhook="disable"> considering disabled, guess need manually shutdown logging system @ end of shutdown hook. couldn't find means thorough external interface, in internal api import org.apache.logging.log4j.logmanager; import org.apache.logging.log4j.core.config.configurator; import org.apache.logging.log4j.core.loggercontext; ... public static void main(string[] args) { final annotationconfigapplicationcontext springcontext = new annotationconfigapplicationcontext(appconfig.class) runtime.getruntime().addshutdownhook(new thread() { public void run() { //shutdown application log.info("s...

Using word vba to format parts of table cell text -

i'm using following code combine text 2 excel cells word table cell. want format first part (captionstr) bold can't seem figure out how specify part of range. i tried .range(0,len(captionstr)).font.bold=true , .range.characters(0,len(captionstr)).font.bold=true both give me "wrong number of argument" errors. i'm using office 2010 ms word 14.0 object reference with tbl.cell(nrow, 2).range .style = rfpdoc.styles(wdstylenormal) captionstr = cstr(nsection) + ". " + activecell.text bodystr = activecell.offset(0, 1).text .text = captionstr .range.insertparagraphafter .range.insertafter(bodystr) end the trick use range object, rather refer entire cell range when writing information. gives finer control on formatting, go. formatting apply current content of range. more like dim rngcell word.range set rngcell = tbl.cell(nrow, 2).range rngcell 'go cell, rather entire cell .collapse wdcollapsestart 'other ...

python - How can i programmatically generate descriptors for an arbitrary data set? -

Image
i analyzing set of pictures, want classify. classification done artificial neural network in supervised manner. have test set assigns each picture class. what want generate lot of descriptors , pca on these , statistical analysis how descriptor able describe class of picture. how can generate descriptors these pictures programatically? me in future classification problems too. let assume have enough computation power (100 core cluster) there libraries incorporate lot of descriptors images? you can follow 2 approaches start: feature based, using methods such sift or gist followed called bag of words approach. vlfeat site contains excellent demo of this. deploying deeplearning algorithms, such sparse autoencoder learn basic features of dataset can further used classification.

c# - How to display data from many-to-many relationship using odata $expand? -

i have few database tables of them have many-to-many relationships. i'm using webapi , odata fetch data database. instance: tablea ---> tableb (one one) tablea ---> tablec (one one) tablea ---> tabled (one one) tablee --> tabled ---> table f (many-to-many) now, since i'm using odata controller, can use /odata/claims?$expand=tablea,tableb,tablec,tabled displays data expected. however, can't display data tablee , tablef using id's tabled . i'm not sure code show you, here's get method [enablequery(allowedqueryoptions = system.web.odata.query.allowedqueryoptions.all)] public iqueryable<tablea> get() { return dbcontext.deniedclaims.asqueryable(); } is there way can show data tablee , tablef in same query using odata? this how data shows when $expand { "@odata.context":"http://localhost:58891/odata/$metadata#tablea","value":[ { // values, ...

Run javascript after other javascript runs on WordPress -

i have 2 pop-under advertisement code runs clicking anywhere on wordpress website , want first run 1 script , then, after 1 pop-under open, on second click of same user, want second pop-under opened. how can on wordpress website? here pop-under codes <script type="text/javascript"> var _pop = _pop || []; _pop.push(['siteid', 1205741]); _pop.push(['minbid', 0.000000]); _pop.push(['popundersperip', 0]); _pop.push(['delaybetween', 0]); _pop.push(['default', false]); _pop.push(['defaultperday', 0]); _pop.push(['topmostlayer', false]); (function() { var pa = document.createelement('script'); pa.type = 'text/javascript'; pa.async = true; var s = document.getelementsbytagname('script')[0]; pa.src = '//c1.popads.net/pop.js'; pa.onerror = function() { var sa = document.createelement('script'); sa.type = 'text/javascri...

ios - Wait until NSNotification is Received -

i have method pauses execution until notification received before continuing. continue execution after notifications received. best way go doing this? you can using nsrunloop - (bool)method { __block bool finish = no; [[nsnotificationcenter defaultcenter] addobserverforname:@"mynotification" object:nil queue:nil usingblock:^(nsnotification *note) { finish = yes; }]; while(!finish) { [[nsrunloop currentrunloop] rununtildate:[nsdate datewithtimeintervalsincenow:0.1]]; } return yes; }

php - Infinite scroll on a foreach loop -

so created foreach loop below, , it's loading in images server couple hundred of em , want load more images scroll down page it's not loading hundreds of images @ once. <div id="container"> <?php foreach(glob("img/weddingcakes/*.*") $filename){ ?> <div class="item"><img src="img/weddingcakes/<?php echo basename($filename) . "\n"; ?>" alt=""></div> <?php } ?> </div> all images stored in database. any suggestions on how go adding infinite scroll? javascript handle better php. use ajax call chuncks of images list according scroll pos.

elixir multiple arguments with the pipe operator -

i'm trying load large json file , bind variable, here code failing..... deps = file.open("../depmap.json") |> io.read(:all) |> jsx.decode i'm getting ** (functionclauseerror) no function clause matching in :io.request/2 (stdlib) io.erl:556: :io.request({:error, :enoent}, {:get_line, :unicode, ""}) (elixir) lib/io.ex:82: io.do_read_all/2 lib/depchecker.ex:6: (module) (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6 what missing here? i'm assuming result of file.open gets passed first arguement io.read(:all) point of failure here , i'm not sure how rectify this. file.open returns either {:ok, pid} or {:error, reason} . second 1 in cases when fails. here you're getting {:error, :enoent} meaning file not exist - you'll need figure out what's wrong path there. you might want use bang version of file.open in pipeline: deps = file.open!("../depmap.json") |> io.read(:all) |> jsx.decode ...

c# - Moving Position of View animated -

i have problem animating movement of view. works stucks if start animating movement. without animation works fluently. if set animation starts stucking. here code: uiview.beginanimations("slide"); this.detailcontroller.view.layer.position = new pointf(50,50); uiview.commitanimations(); i tried: setting : this.detailcontroller.view.center = new pointf(50,50); working coreanimations is there possibility make thie animation more fluently ? thanks in advance. the default animation duration .2 seconds, might fast visible in case. if want fluid animations, play duration , easing functions. make sure set parameters @ beginning of animation block (just after beginanimation ) or won't taken account. uiview.beginanimations("slide"); uiview.setanimationduration (2); uiview.setanimationcurve (uiviewanimationcurve.easeinout); detailcontroller.view.layer.position = new pointf(50,50); uiview.commitanimations(); for more info, rea...

wordpress - Better URL formatting with Custom Post Types and Taxonomies -

i'm using toolset types , wondering how easy set url's how want. i have custom post type of venues , have custom category taxonomy of location. currently urls coming out http://domain.com/venue/location/manchester/ http://domain.com/venue/manchester/the-venue-name/ but want url's structured http://domain.com/manchester/ http://domain.com/manchester/the-venue-name/ where need make these changes? is .htaccess work or can done within permalinks section? thanks in advance if understand right, hack must work in template. first of have remove post type name url slug . function ft_remove_posttype_slug_fromurl( $post_link, $post, $leavename ) { if ( 'venue' != $post->post_type || 'publish' != $post->post_status ) { return $post_link; } $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); return $post_link; } add_filter( 'post_type_link', 'ft_...

c# - Set delay time to spawn object -

i have spawnscript (below) want create function within spawn, can put minimum , maximum delay time object can created inspector. using system.collections; using system.collections.generic; public class spawncontroller : monobehaviour { public float maxwidth; public float minwidth; public float mintime; public float maxtime; public float ratespawn; private float currentratespawn; public gameobject tubeprefab; public int maxspawntubes; public list<gameobject> tubes; // use initialization void start () { (int = 0; < maxspawntubes; i++) { gameobject temptube = instantiate (tubeprefab) gameobject; tubes.add (temptube); temptube.setactive (false); } currentratespawn = ratespawn; } // update called once per frame void update () { currentratespawn += time.deltatime; if (currentratespawn > ratespawn) { currentr...

mysql - SQL query to order by the top averages of previous data -

given table data these columns (other columns too, but, these important ones): gameid awayscore homescore 1 3 8 2 4 2 3 4 9 4 15 5 5 0 8 6 4 10 ... what looking average margin of victory on previous 3 games (assuming gameid order played), so, on game 6, should (6+8+10=24, average 8), on game 5 (8+10+5=23, average 7.666), etc. , show weeks 3-game average highest. i tried this: select g.gameid, (select avg(scores.ave) (select abs(awayscore-homescore) ave games gs (gs.gameid<=g.gameid) order gameid desc limit 3) scores) margin `games` g group g.gameid order margin desc limit 10; but "unknown column 'g.gameid' in 'where clause'", assume because subquery of subquery(?), , loses reference? @ loss of how structure otherwise though work correctly (if possible @ all). try query select g.gameid, (select avg(abs(awayscore-homescore)) games gs (gs....

html - creating a link to a div -

is possible create link div? line of code: output +='<h2><a href=\"link-to-a-website" >' + val.product + '</h2>'; i have created rich internet application , need link div within website yes possible need use id instead of class . example: <h2><a href="#targetdiv" >' + val.product + '</a></h2> <div id="topdiv"> </div> <div id="targetdiv"> </div> jsfiddle: https://jsfiddle.net/andrewl32/45o6u4le/2/ the target div on different page/site have specify path correctly.

AngularJS select with hard coded options -

q. why drop down not showing selcted value ? here javascript code have <div ng-app="myapp"> <div ng-controller="myctrl"> <select ng-model="mymodel.active" convert-to-number> <option value="-1">select</option> <option value="1">yes</option> <option value="2">no</option> <option value="3">maybe</option> </select> <span>{{mymodel.active}}</span> </div> </div> the javascript var myapp = angular.module("myapp",[]); myapp.controller("myctrl", function($scope){ $scope.mymodel = {}; $scope.mymodel.active=2; // }); the js-fiddle link -- https://jsfiddle.net/shatherali/4mxwzl5y/19/ edit: please note dont want use string value. active has number value. this solves issue: var myapp = angular.module('myapp', []); myapp.c...

django - How to replace 'example.com' with my IP for the reset password link -

i using django inbuilt auth urls , views user login/logout/passwordreset/ namely, in urlpatterns url(r'^accounts/', include('django.contrib.auth.urls')), in views.py from django.contrib.auth.views import * after enter email address resetting password, receive email link reset password, link similar http://example.com/accounts/reset/s-3is-7535266db5af311b2a02/ and after manually change 'example.com' ip address(as running server on localhost), change password login new password. i have read django auth codes , understand if no override given, take domain of current site , set as'domain' in passwordresetform what supposed make link works fine after click on link direct django url change passwor. (i thinking of override django's induilt passwordresetform in https://github.com/django/django/blob/master/django/contrib/auth/forms.py thing think need change 'domain_override=none' still have keep whole save function code. not ...

ruby on rails - TypeError: undefined is not an object (evaluating 'Backbone.Wreqr.radio') -

i using rails 4.2.6, ruby 2.3.0, backbone.js 1.3.3, marionettejs (backbone.marionette) v2.4.5, underscore.js 1.8.3. my application.js file is: //= require jquery //= require lib/underscore //= require lib/backbone //= require lib/marionette //= require backbone/app i following tutorial backbonerails.com . @ beginning of chapter 5 , app empty, no footer, no header no main content. i getting error: typeerror: undefined not object (evaluating 'backbone.wreqr.radio') _initchannel — marionette.self-5755e16504f179d152ad666130d554d6925cca98e4374dbad360dc6b42b17d74.js:3232 constructor — marionette.self-5755e16504f179d152ad666130d554d6925cca98e4374dbad360dc6b42b17d74.js:3100 (anonymous function) — app.self-a30509b2e8139de6bc6c843d616c92384df06b065083ad664d54a1bfa1e59250.js:4 (anonymous function) — app.self-a30509b2e8139de6bc6c843d616c92384df06b065083ad664d54a1bfa1e59250.js:16 global code — app.self-a30509b2e8139de6bc6c843d616c92384df06b065083ad664d54a1bfa1e59250.js:18 ...

python 2.7 - Saving checkpoints and resuming training in tensorflow -

i playing saving checkpoints , resuming training saved checkpoints. following example given in - https://www.tensorflow.org/versions/r0.8/api_docs/python/train.html#import_meta_graph keep things simple, have not used 'real' training of network. performed simple subtraction op , each check point saves same operation on same tensors again , again. minimal example provided in form of following ipython notebook - https://gist.github.com/dasabir/29b8f84c6e5e817a72ce06584e988f10 in first phase, i'm running loop 100 times (by setting value of variable 'enditer = 100' in code) , saving checkpoints every 10th iteration. so, checkpoints being saved numbered - 9, 19, ..., 99. when i'm changing 'enditer' value 200 , resuming training, checkpoints again start saved 9, 19, ... (not 109, 119, 129, ...). there trick i'm missing? can print out 'latest_ckpt', , see if points latest ckpt file? also, need maintain global_step using tf.variable: ...

android - Replace a tapped word with custom suggested words in edit text -

Image
i want tap on word in edit text. when word clicked, should show set of custom suggested words in popup window former word can replaced suggested word. please me how this. the suggestions should not shown while type word. i have implemented required feature. not elegant solution. so, if can make code more efficient, welcome. string meow = "i dont asu @ all"; // string supposed set in edit text final string[] tokens = meow.split("\\s+"); tokenlist = new arraylist<string>(arrays.aslist(tokens)); //create custom dictionary file used in suggested words dictionary = new hashmap<string, list<string>>(); dictionary.put("i", arrays.aslist("buenos aires", "córdoba", "la plata")); dictionary.put("dont", arrays.aslist("mumbai", "delhi", "gwalior")); dictionary.put("like", arrays.aslist("phoenix", "tucson...

android - App generated photo/video not appearing in Google Photos app -

i have application generates output video, i'm saving in dcim folder, however, when trying video in google photos app, doesn't appear. it's if output video wasn't generated @ (using file manager app, videos displaying) is there metadata or need attach videos generated appear?

base64 - Convert 64-bit Hex to nanoseconds timestamps -

i have timestamps represented in 64-bit hex. there way convert nanosecond timestamps? (preferably in c++) found it! i used std::hex convert hex value long, in turn gives me nanosecond precision.

html - Hiding Fixed Content Behind Div on Mobile -

i have navigation built fixed behind site wrapper. when menu link clicked, site wrapper slides on reveal fixed menu content. works great except fact on touch screens can drag screen (site wrapper) side reveal fixed content behind. there way lock screen not allow horizontal touch? code below. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> html <ul class="navigation"> <img src="img/splashred.svg" alt="" /> <li class="nav-item"><a href="#about">who</a></li> <li class="nav-item"><a href="#services">what</a></li> <li class="nav-item"><a href="#approach">approach</a></li> <li class="nav-item"><a href="#clients">clients</a></li> <li class="nav-item"><a h...

php - Datatables: Hide Column based on database value -

i'm trying show/hide column based on database values. i'm using jquery, php , mysql. i using ajax retrieve data , hide column, doesn't hide tbody data, header hidden: $(function () { //----------------------------------------------------------------------- // 2) send http request ajax http://api.jquery.com/jquery.ajax/ //----------------------------------------------------------------------- $.ajax({ url: 'account-number.php', //the script call data data: '', //you can insert url argumnets here pass api.php //for example "id=5&parent=6" datatype: 'json', //data format success: function(data) //on recieve of reply { var user = data[1]; //get id var table = data[2]; //get table name ...

oracle - Two Table SQL review -

!( http://imgur.com/rglmvue ) a pic of tables above. list youngest customer. list orders (ordereid, order date, amount) along customer details. i struggling these 2 questions. can't see table name pic? list youngest customer. try replact [top table pic] name of actual table. select custfname, custlname, min(date) (select *, cast(dateofbirth date) date customers) group 1,2; or select top 1 * customers order dateofbirth asc 4.list orders (ordereid, order date, amount) along customer details. select a.*, b.custlname, b.custfname, b.dateofbirth, b.custcity orders left join customers b on b.custid = a.custid

android - Error loading data into listvcoiew -

i tryinh load data listview remote server using custom baseadapter class.everything working fine except data not displayed on listview.no error generated on log cat. below code: activity class: public class myaccountactivity extends activity{ public static final string url="http://***.co.ke/ussd/get_shares.php"; private progressdialog progressdialog; private static final string tag_number = "share_number"; private static final string tag_name = "share_name"; arraylist sharelist; public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.activity_my_account); arraylist sharelist = update_shares(); final listview lv1 = (listview) findviewbyid(r.id.mylist); lv1.setadapter(new customsharelistadapter(this, sharelist)); //listview listview = getlistview(); } string data=""; public arraylist update_shares(){ inputstream is=null; string result=""...

html - My title is not sitting in my header? -

trying figure out why title far down on screens, previous solutions have told me take away negative margin when title hiding, far down. here link: http://aswanson.net/kiloart/visions.html you have line-height set 2.5em, causing title go down. change 0em space.

python - How to merge xArray datasets with conflicting coordinates -

let's have 2 data sets, each containing different variable of interest , incomplete (but not conflicting) indices: in [1]: import xarray xr, numpy np in [2]: ages = xr.dataset( {'ages': (['kid_ids'], np.random.rand((3))*20)}, coords={'kid_names':(['kid_ids'], ['carl','kathy','gail']), 'kid_ids': [10,14,16]}) in [3]: heights = xr.dataset( {'heights': (['kid_ids'], np.random.rand((3))*160)}, coords={'kid_names':(['kid_ids'], ['carl','keith','gail']), 'kid_ids': [10,13,16]}) this creates 2 data sets seem should merge well: in [4]: ages out[4]: <xarray.dataset> dimensions: (kid_ids: 3) coordinates: * kid_ids (kid_ids) int32 10 14 16 kid_names (kid_ids) <u5 'carl' 'kathy' 'gail' data variables: ages (kid_ids) float64 13.28 1.955 4.327 in [5]: heights out...

ios - UiTextField leftViewMode odd Behavior.. Bug? -

i have 2 textfields , in each textfield want put icon in leftimageview . when attempt load view, ui gets hung , never loads. if comment out 1 of tag blocks. ui loads fine , end textfield icon in leftview. my issue getting icon in both textfields. textfield in textfields { textfield.delegate = self textfield.autocorrectiontype = .no textfield.leftviewmode = .always if textfield.tag == 1 { textfield.keyboardtype = .emailaddress textfield.attributedplaceholder = attributedtext("username") leftimageviews[0].image = uiimage(named: "user") leftimageviews[0].contentmode = .scaleaspectfit lefttextfieldviews[0].addsubview(leftimageviews[0]) textfield.leftview = lefttextfieldviews[0] textfield.leftview?.frame = lefttextfieldviews[0].frame } else if textfield.tag == 2 { textfield.securetextentry = true textfield.att...

ios - Ambiguous use of subscript swift 2.2 -

i error right before ["toposition"] saying ambiguous use of subscript guard let toloc = self.currentdetailobj!["toposition"][0] as? pfgeopoint else { return } in previous statement works fine guard let fromloc = self.currentdetailobj!["fromposition"] as? pfgeopoint else{ return } why first statement not work? need position @ index 0. use .first guard let toloc = self.currentdetailobj?["toposition"].first as? pfgeopoint else { return }

objective c - Unable to change value of string from @property -

i have variable multiple methods need access , change. i have declared as: @property (nonatomic, retain) nsstring *curdate; i synthesise in code well. however, when trying change it's value so: curdate = "02-07-2012"; the app crashes. why this? how should change value? you need use @ symbol when using nsstring literal syntax. like this: curdate = @"02-07-2012"; read usage of @ symbol in objective-c here .

How does Java's generics work? -

could please me understand how java's generics work? understand concept of it. specific example of code don't understand compiler's error messages. example code: test class // test code public class < listtype extends comparable < listtype >> { // make instance variable y public int y; // make instance variable s public string s; //constructor method public a(int requiredy, string requireds) { y = requiredy; s = requireds; } more code here... } then in different class wrote list <a> = new arraylist<a>(); more code here... collections.sort(a) the error message getting test.java:20: error: no suitable method found sort(list<a>) collections.sort(a); ^ method collections.<t#1>sort(list<t#1>) not applicable (inference variable t#1 has incompatible bounds equality constraints: upper bounds: comparable<? super t#1>) method collections.<t#2>sort(list<t#2>,comparator<? super t#2...

mysql - Is there any best way to migrate existing tables without foreign keys to Laravel 5 with Eloquent? -

i testing laravel 5.2 mariadb 10.0, , love framework. migrate part of existing web app (custom accounting web application) laravel 5.2. there issues migrate current web application laravel. (1) current database doesn't use foreign key read laravel manual, use eloquent orm( not query builder), using foreign key mandatory far understand. existing database doesn't use foreign key @ all. (2) current database structure doesn't fit laravel understand laravel requrired own styled table structure although allow overriding not everything. review database, needs lot of modification fit laravel style. in summary, want migrating of existing tables , develope laravel web application using eloquent, not query builder. i looking forward great opinions , advices. (1) that's not true. using foreign keys not mandatory. relationships loaded using convention rules, has point 2. although using them recommended. screwed apps because foreign keys not created in mysql b...

android - Bottom Sheet not opening with the NavigationDrawer click -

i have 2 navigation drawers , bottom sheet in app. want expand bottom sheet click item navigation drawer. navigation drawers work fine. updated xml.... <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout_widget" android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="true" android:focusableintouchmode="true"> <android.support.design.widget.coordinatorlayout xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout android:layout_wi...