Posts

Showing posts from March, 2012

java - How to use Degraph to graph only models -

i want generate relationship graph among model classes using degraph. here representative example model, pojo taskentryimpl relates task: package com.packag.tm.model.pojo; public class taskentryimpl implements taskentry,serializable { private integer id; private task task; public task gettask() { return this.task; } public void settask(task v) { this.task = v; } packages containing models have model.pojo part of package name: com.somepackage.events.model.pojo.durationimpl au.com.anotherpackage.ecrm.model.pojo.payphoneimpl how graph of models meet abovementioned characteristics? for curious: wish have entity-relation diagram instead. these model classes wired hibernate orm. original developers maintained sql independent of codebase , have never used foreign keys. rules out getting entity-relation diagram database schema. create file pojo.config following content output = pojo.graphml classpath = yourlib.jar inclu...

How to disable scrolling between FlipView items with mouse wheel on Windows 8.1 -

i have windows 8.1 store c#/xaml app, in app have flipview several flipview items. in 1 item have webview quite long. problem - when scroll using mouse wheel in webview , reach end of page, the flipview scrolls next item, unwanted . the expected behavior freely scroll within webview , not between flipview items. ideally switching between flipview items should work using touch or programmatic change. i've tried setting different scrollviewer properties on flipviewitem or nested items, changining manipulationmode, nothing worked far. sample code: <flipview> <flipviewitem> <grid background="red"/> </flipviewitem> <flipviewitem> <grid> <!-- when scrolling on page, not navigate blue or red flipviewitem--> <webview source="http://cnn.com"/> </grid> </flipviewitem> <flipviewitem> <grid background="blue"/...

html - Resize SVG in DIV and don't preserve aspect ratio -

how resize svg image in div jquery ui ? want resize div , don't preserve aspect ratio of svg image in div. jsfiddle example html <div style="width: 100px; height:100px; border: 1px solid black;"> <svg style="width:100%; height:100%; " version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="340.156px" height="340.152px" viewbox="0 0 340.156 340.152" enable-background="new 0 0 340.156 340.152" xml:space="preserve"> <path fill="#2121ed" fill-opacity="1" stroke="#000000" stroke-width="1" stroke-opacity="0" class="path_vector_1" d="m340.156,170.078c0,93.926-76.146,170.074-170.077,170.074c76.146,340.152,0,264.004,0,170.078 c0,76.146,76.147,0,170.079,0c264.011,0,340.156,76.146,340.156,170.078z"...

java - JavaFX TreeTableView custom TreeCell with controls -

i'm new javafx 8 , tried implement treetableview jfxtras controls in second , third column. therefore set cell factories of columns custom treecells e.g. this: col3.setcellfactory(new callback<treetablecolumn<object, string>, treetablecell<object, string>>() { @override public treetablecell<object, string> call(treetablecolumn<object, string> param) { treetablecell<object, string> cell = new treetablecell<object, string>() { private colorpicker colorpicker = new colorpicker(); @override protected void updateitem(string t, boolean bln) { super.updateitem(t, bln); setgraphic(colorpicker); } }; return cell; } }); now can see colorpickers , can use them, column somehow not react on expanding or collapsing nodes of column 1 (which sho...

error handling - Why ErrorHandler component is not registering properly in SlingMainServlet? -

i have simple component own errorhandler implementation: @component(immediate = true) @service @properties( @property(name = "service.ranking", intvalue = 1) ) public class myerrorhandler implements errorhandler { @override public void handleerror(int status, string message, slinghttpservletrequest request, slinghttpservletresponse response) throws ioexception { handleerror(status, request, response); } @override public void handleerror(throwable throwable, slinghttpservletrequest request, slinghttpservletresponse response) throws ioexception { handleerror(505, request, response); } private void handleerror(int status, slinghttpservletrequest request, slinghttpservletresponse response) throws ioexception { if (status != 200) { try { request.getrequestdispatcher("/etc/errors/" + status + ".html").forward(request, response); } catch (servletexception ...

javascript - Chrome App: Window interacting with another window's HTML code -

i'm coding app which, in main window's javascript code, creates new window. mainwindow.js : chrome.app.window.create('sample.html', { id: 'newwindow', 'bounds': { 'width': 200, 'height': 200 }, 'resizable' : false, 'alwaysontop' : true, 'frame': { type: "none" } }, function(createdwindow) { /*here*/ }) sample.html : <!doctype html> <html> <head> <title>chrome app</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div style='background-image: url("img1.png"); height: 50px; width: 200px;'> </body> </html> the thing i'd interact sample.html code inside mainwindow.js, in order change path of background image. there way ?

jquery - Prevent column name wrap in shiny DataTable -

i have shiny datatable (package "dt") quite long column names (+ whitespace) want rendered without name wrapping - i.e. colnames wrapped on 2-3 lines. have enabled horizontal scrolling try , facilitate this: renderdatatable(dataframe_with_long_colnames, ..., options = list(scrollx = true)) but default whitespace collapsed new lines. i think answers question: https://www.datatables.net/forums/discussion/8923/how-do-you-stop-the-header-from-wrapping-into-multiple-rows i'm not sure how translate r function. in addition, datatable options listed here: https://www.datatables.net/reference/option/ thanks in advance. in ui.r add following line before line render table: tags$head(tags$style("#table1 {white-space: nowrap; }")), replace table1 xxxxx output statement in server.r file output$`xxxxx`<-renderdatatable(.....

python - Django model field default based on another model field -

i use django admin build management site. there 2 tables, 1 modela data in it, modelb nothing in it. if 1 model field b_b in modelb none, can displayed on webpage value of modela 's field a_b . i don't know how it, here pseudo code: in models.py from django.db import models class modela(models.model): a_a = models.charfield(max_length=6) a_b = models.charfield(max_length=6) class modelb(models.model): modela = models.onetoonefield(modela) b_b = models.charfield(max_length=6, choices=[(1, 'm'), (2, 'f')], default=self.modela.a_b) in admin.py from django.contrib import admin .models import modela, modelb class modelbadmin(admin.modeladmin): fields = ['b_b'] list_display = ('b_b') i think if b_b of modelb have default value of relative a_b value of modela, have default value of b_b(view) in django admin change(edit) page associate data particular modelb instance. i want fill b_b in web page more easily. i don...

mongodb - How to find date between stat date and end date -

i have 2 fields in database start_date , end_date. how find if date passing in between these 2 dates. model class schedule include mongoid::document field :start_date, type: date field :end_date, type: date end simple activerecord query schedule.where(["start_date <= ? , end_date >= ?", params[:date], params[:date] ]) date saved in database in following format { "_id" : objectid("559d182f6368611dbf000000"), "start_date" : isodate("2015-06-10t00:00:00.000z"), "end_date" : isodate("2015-07-10t00:00:00.000z") } and parameter contain date "2015-06-10" what query while using mongodb database mongoid? this should work schedule.where(:start_date.lte => date, :end_date.gte => date)

python - How Do I put 2 matrix into scipy.optimize.minimize? -

i work scipy.optimize.minimize function. purpose w,z minimize f(w,z) both w , z n m matrices: [[1,1,1,1], [2,2,2,2]] f(w,z) receive parameter w , z. i tried form given below: def f(x): w = x[0] z = x[1] ... minimize(f, [w,z]) but, minimize not work well. what valid form put 2 matrices ( n m ) scipy.optimize.minimize ? optimize needs 1d vector optimize. on right track. need flatten argument minimize , in f , start x = np.reshape(x, (2, m, n)) pull out w , z , should in business. i've run issue before. example, optimizing parts of vectors in multiple different classes @ same time. typically wind function maps things 1d vector , function pulls data out objects can evaluate cost function. in: def tovector(w, z): assert w.shape == (2, 4) assert z.shape == (2, 4) return np.hstack([w.flatten(), z.flatten()]) def towz(vec): assert vec.shape == (2*2*4,) return vec[:2*4].reshape(2,4), vec[2*4:].reshape(2,4) def doopti...

rest - Building spark-jobserver Using SBT and Scala -

can suggest me better documentation spark-jobserver. have gone through url spark-jobserver unable follow same. great if 1 explain step step instruction on how use spark-jobserver. tools used in building project. sbt launcher version 0.13.5 scala code runner version 2.11.6 with above mentioned tools getting errors while building spark-jobserver. here steps used install: clone jobserver repo. get sbt using wget https://dl.bintray.com/sbt/native-packages/sbt/0.13.8/sbt-0.13.8.tgz move "sbt-launch.jar" in sbt/bin /bin create script /bin/sbt, contents found here , making sure change pointer java if necessary make above script executable now cd spark jobserver directory, , run sbt publish-local assuming above successful, run sbt in same directory finally, use command re-start , , if succeeds server running!

Android google map - get map click location when marker clicked -

i've got map plenty of large custom markers on it. want allow user create path on map (displayed polyline , later saved list of geocoordinate pairs). if user clicks on map can collect these positions setonmapclickedlistener method of map. if user clicks on marker ( setonmarkerclickedlistener ), can retrieve markers position (generally position of ancor of marker). is possible somehow retrieve clicked map location when marker clicked? i'm using supportmapfragment. try below mmap.setonmarkerclicklistener(new onmarkerclicklistener() { @override public boolean onmarkerclick(marker marker) { latlng position = marker.getposition(); toast.maketext( mainactivity.this, "lat " + position.latitude + " " + "long " + position.longitude, toast...

c++ - gdk (gtk3) in codeblocks on windows 7 -

i have configured gtk3+ (i've changed gtk2+ gtk3+) in codeblocks 13.2 on windows 7, , created new gtk+ (exmaple) project. example projcet compiled , works properly. next included gdk: #include <gdk/gdk.h> but when added lines: gdk_init(&argc, &argv); gdkscreen *screen = gdk_screen_get_default();` i got 2 errors: undefined referrence 'gdk_init' and undefined referrence 'gdk_screen_get_default' where problem? i'm looking concrete solution. compilation log: ||=== build: debug in gtk4test (compiler: gnu gcc compiler) ===| c:\myp\gtk4test\main.c||in function 'main':| c:\myp\gtk4test\main.c|37|warning: 'gtk_vbox_new' deprecated (declared @ c:\gtk\include\gtk-3.0/gtk/deprecated/gtkvbox.h:60): use 'gtk_box_new' instead [-wdeprecated-declarations]| c:\myp\gtk4test\main.c|53|warning: unused variable 'screen' [-wunused-variable]| obj\debug\main.o||in function `main':| c:\myp\gtk4test\main.c|5...

c++ - Shortest code to split std::string into std::pair -

i have text, in "key:value" format. actual text may like, "server: nginx" or "server:nginx" ignoring whitespaces between key, : , value. what fastest , shortest way split std::pair<std::string, std::string> ? david close, didn't test code. here's working version. auto index = str.find(':'); std::pair<std::string,std::string> keyval; if (index != std::string::npos) { // split around ':' character keyval = std::make_pair( str.substr(0,index), str.substr(index+1) ); // trim leading ' ' in value part // (you may wish add further conditions, such '\t') while (!keyval.second.empty() && keyval.second.front() == ' ') { keyval.second.erase(0,1); } } ( live demo )

javascript - How to call a web method async in ASP.NET (SharePoint behind) -

this question has answer here: is there way handle async/await behind asmx service? 2 answers calling async web method, 500 error. there other ways call web method async? stacktrace: server error in '/' application. unknown web method sendmessage. parameter name: methodname description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.argumentexception: unknown web method sendmessage. parameter name: methodname source error: an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [argumentexception: unknown web method sendmessage. parameter name: methodna...

Simple Javascript Jquery not working -

this question has answer here: event binding on dynamically created elements? 18 answers one button, when clicked, changes html in body tag, in there new button. new button, when clicked, should give alert message, not. i think it's document.ready part, needs reinitialized. don't know how that. please check code: <!doctype html> <html> <head> <title>title website</title> <script src="js/jquery-2.1.4.min.js"></script> </head> <body> <div id="bigbox"> <button id="idol">idol</button> </div> <script> $(document).ready(function(e){ $('#idol').click(function(event) { console.log("success"); var x = '<button id="clickhere">click here!</button...

vba - Disable any incoming external links to a Excel Workbook -

i have 2 workbooks. test1.xlsx , test2.xlsx , have saved them in same directory. i write formula create external link in cell a1 of sheet1 of test2.xlsx. example: in a1 cell of sheet1 of test2.xlsx write =[test1.xlsx]sheet1!a1 , press enter. copies corresponding cell content of test1.xlsx test2.xlsx i don't want formula executed. want workbook "test1.xlsx" shouldn't accessed other external workbook i.e. no 1 can provide external reference test1.xlsx , if provided, should return error "!#ref" i using excel 2010. it quite helpful me know events taking place in test1.xlsx not behavior requested, this: password-protect test1. user prompted password when formula entered. if password correctly entered, formula(s) execute, users prompted password update links each time test2 opened.

java - sorted map implementation (ValueComparableMap), sorting not maintained when calling Map.Entry setValue -

i've used solution here describes how implement value comparable map in java, , working fine put method, however, when try modify values in map through map.entry type, sorting no longer maintained. following code exhibits issue: treemap<integer, float> valcompmap = new valuecomparablemap<integer, float>(ordering.natural()); // code puts entries in map random random = new random(); (map.entry<integer, float> e : valcompmap.entryset()) { e.setvalue(e.getvalue() + random.nextfloat()); } //parse keys list list<integer> sorted_keys = new arraylist<integer>(valcompmap.keyset()); //here sorted_keys not sorted according values in original key value pair in map as work around, i'm re-putting keys new values such: list<integer> keys = new arraylist<integer>(valcompmap.keyset()); (integer k : keys) { valcompmap.put(k, valcompmap.get(k) + random.nextfloat()); } problems work around: not straight forward (doesn't express int...

cassandra extract month from timestamp -

in postgres, have function extract month, year etc timestamp using extract function. see below. select extract(month timestamp '2001-02-16 20:38:40'); is possible same in cassandra? there function this? if possible, can run queries such find entries in year "2015" , month "may". possible in postgres using extract function. in cassandra handle little differently. can have fields in table of type timestamp or timeuuid, , use field in time range query. for example if wanted entries 2015 , may , have timestamp field called 'date', query this: select * mytable date > '2015-05-01' , date < '2015-06-01' allow filtering; you can use number of different formats specifying date specify time more precisely (such down fractions of seconds). cassandra converts date strings using org.apache.commons.lang3.time.dateutils class, , allows following date formats: private static final string[] datestringpatterns = new ...

c# - Defining Route for Composite Primary Keys in WebAPI2 -

how can define composite pks in webapi controller? have 2 entities. in 1 of them have 2 primary keys. the entity "person" has following properties: id (pk), lname (pk), fname, age, groupid (fk). here controller code: // get: api/person/5 [httpget] [route("id")] [responsetype(typeof(person))] public async task<ihttpactionresult> getpersonbyid(int id, string lname) { person person = await db.persons.findasync(new object[] {id, lname}); if (person == null) { return notfound(); } return ok(person); } entity person: public partial class person { public int id { get; set; } public string lname { get; set; } public string fname { get; set; } public int age { get; set; } public int groupid { get; set; } [foreignkey("id")] public virtual group group { get; set; } } do have define lname in route dataannotation?

java - Multiple GCM Registration IDs for the same user sending push notifications multiple times -

in backend receive gcm registration_id , user_id (unique), latitude , longitude , score etc android application , save in amazon dynamodb table. when want send push notifications mobiles, fetch gcm registration ids, put java.util.set avoid duplicates , send push notifications android devices based on set of registration ids. but problem is, since whenever user uninstall , install android application again, new registration_id generated , receive & save in database. hence, same user receive push notifications multiple number of times, , it's because of multiple gcm registration_ids saved same user. how solve problem in backend? want send 1 push notification every user. using java spring framework? example code , code query dynamodb highly helpful. tia you need keep 1 entry of gcm registration_id against each user in database, whenever user loagin or install application @ time should send gcm registration_id server , replace older 1 new id... check follow...

java - import module package not exist -

i have imported module (squarecamera) have error whin error:(26, 32) error: package com.desmond.squarecamera not exist this code : import com.desmond.squarecamera.cameraactivity; ... public void launchcamera() { intent startcustomcameraintent = new intent(this, cameraactivity.class); startactivityforresult(startcustomcameraintent, request_camera); }

c# - Query to many-to-many joiner table in EDMX -

i facing performance problem whenever i'm accessing navigation property of entity. i have 3 tables: usercategory , user , usercategoryuser . there many-to-many relation between user , usercategory tables. usercategoryuser table joiner table , has 2 columns userid , usercategoryid i.e primary keys of user , usercategory tables. joiner table usercategoryuser used maintaining many-to-many relationship between user , usercategory tables. i'm using database first approach. hence in edmx, user entity have 1 navigation property usercategories . usercategory entity there navigation property users . i want add user usercategory. before adding, i'm doing check whether user added usercategory or not. in database i've around 100k user records , 1 usercategory. users associated usercategory. i'm accessing users navigation property follows: var usercategory = context.usercategories.firstordefault(uc => uc.usercategoryid == usercategoryid); if (us...

css - Adding radial gradient to multiple separated arcs with same center point -

i need add multiple arcs 1 svg elements (every 1 got different animation). need fill them radial gradients, now, center of radial gradient not in centre of whole svg element, in centre of specific arc. how looks now. first make of gradients need in defs. var tmpgrad=null; for( var k = 0; k<data.length;k++){ tmpgrad = grads .append("radialgradient") .attr("gradientunits", "userspaceonuse") .attr("r", "50%") .attr("id", function(d, i) { return "grad" + k; }); tmpgrad .append("stop") .attr("offset", "0%") .style("stop-color", data[k].endcolor) .style("stop-opasity", 0); tmpgrad .append("stop") .attr("offset", "100%") .style("stop-color",data[k].startcolor) ...

mongoDB query Result Output -

i have following documents in collection: { "_id" : objectid("539c118b310c022c947b0055"), "term" : "aero storm tour", "year" : "2015", "month" : "06", "day" : "01", "hour" : "17", "dayofyear" : "4", "weekofyear" : "22", "productcount" : 0, "count" : 22 }, { "_id" : objectid("558c118b310c022c947b1145"), "term" : "aero", "year" : "2015", "month" : "06", "day" : "01", "hour" : "17", "dayofyear" : "4", "weekofyear" : "22", "productcount" : 0, "count" : 21 }, { "_id" : objectid("558c992b310c022c947b0055"), "term" : ...

ios - Set Navbar hidden = false don't work -

Image
i have 2 viewcontroller vc , vc b vc => navigationbar hidden = true vc b => navigationbar hidden = false i make segue => b, navgiationbar in vc b not visible. i have include following swift code in vc b: override func viewwillappear(animated: bool) { self.navigationcontroller?.navigationbarhidden = false } any ideas? the navigation bar , tool bar should disappear in storyboard when change segue -- that's normal. try checking following should work ios 8 particular view override func viewwillappear(animated: bool) { self.navigationcontroller?.navigationbarhidden = false } to show on viewcontrollers place in viewdidload self.navigationcontroller?.navigationbarhidden = false

AngularJS ngClass conditional for multiple variable in sorting -

i using multiple-sorting in angularjs here want add class on clicked li tag, working fine when using single value sorting code below: <li ng-class="{ active:sorttype === 'rollno'}"><a ng-click="sorttype = 'rollno';"><span>sort rollno</span></a></li> <li ng-class="{ active: sorttype === 'marks'}"><a ng-click="sorttype = 'marks';"><span>sort marks</span></a></li> but when use multiple-value sorting not changing class expected in code below: <li ng-class="{ active:sorttype === ['rollno','marks']}"><a ng-click="sorttype = ['rollno','marks'];"><span>sort rollno</span></a></li> <li ng-class="{ active: sorttype === ['marks','rollno']}"><a ng-click="sorttype = ['marks','rollno'];"><sp...

angularjs - Angular controller scope variable not updated -

hello have code permit signin via social networks : i have html page wich call facebooksubscrib, googleplussubscribe function on click, works : kecooapp.controller('homectrl', ['$scope', '$rootscope', 'configuration', '$state', '$modal', function ($scope, $rootscope, configuration, $state, $modal) { } ]); kecooapp.controller('signupctrl', ['$scope', '$rootscope', 'configuration', '$state', '$modal', 'facebook', 'googleplus', 'linkedin', '$state', function ($scope, $rootscope, configuration, $state, $modal, facebook, googleplus, linkedin, $state) { $scope.rsuserinfo = {}; $scope.check = function() { console.log($scope.rsuserinfo); } $scope.rsuserinfoparse = function(provider,data) { switch(provider) { case "facebook": ...

elasticsearch - Mapping for Different Type of Properties -

in application have class extended 2 other classes. 2 other classes serialized in json , indexed on elasticsearch. the problem i'm facing 2 classes extending first 1 present property same name different types (one string , other 1 object) follows: { "property1" : "a string", "property2" : "another string" } { "property1" : "this ok first 1 string too", "property2" : { "propertyfromproperty2" : "this not ok" } } when indexing receive following exception: org.elasticsearch.index.mapper.mapperparsingexception: failed parse [property2] @ org.elasticsearch.index.mapper.core.abstractfieldmapper.parse(abstractfieldmapper.java:418) @ org.elasticsearch.index.mapper.object.objectmapper.serializeobject(objectmapper.java:517) @ org.elasticsearch.index.mapper.object.objectmapper.parse(objectmapper.java:459) @ org.elasticsearch.index.mapper.object.objectmapp...

Shade on HTML - CSS -

i have website on localhost , i'm using html design little bit. i've seen on internet how put css in html shade in background, doesn't work on website... do know how works ? thanks try code <!doctype html> <html> <head> <style> body { height: 200px; background: -webkit-repeating-linear-gradient(red, yellow 10%, green 20%); background: -o-repeating-linear-gradient(red, yellow 10%, green 20%); background: -moz-repeating-linear-gradient(red, yellow 10%, green 20%); background: repeating-linear-gradient(red, yellow 10%, green 20%); } </style> </head> <body> </body> </html>

php - Ajax post json response issue -

i have issue ajax response. using custom query fetch result database. json response shows null value while query running successfully. here code: if(isset($_post)){ $arr = array(); //$query = mysql_query(" insert login (user,pass) values ('".$_post['firstname']."','".$_post['lastname']."') ") or die('test'); $query = mysql_query(" select * login user = '".$_post['firstname']."' && pass = '".$_post['pass']."' ") or die('test'); $rows = mysql_num_rows($query); while($fetch = mysql_fetch_array($query)) { if($fetch) { $_session['id']= $fetch['id']; $arr['id'] = $_session['id']; } else { $arr['failed']= "login failed try again...."; } } echo json_encode($arr); } @amandhiman ...

Does google search API eliminate stop words? -

consider if search query in google search api "i love you". in query, "i" , "you" stop words , occur in every document. keyword(s) present in search "love" should searched for. so, there must process detect stop words , eliminate them document list feed api. google automatically in search api or have process search query before firing query? if google uses idf (inverse document frequency) table eliminate (or less - prioritise) stop words, how it? if not, how can eliminate stop words? algorithm (if any) works other (vernacular) languages too? link google search api here google full text search api not eliminate stop words. if perform global search search query "i love you", documents have 3 words , not stop words the white space between words, quoted strings, numbers, , dates treated implicit , operator. if want same functionality while searching within field here 1 approach for: if enclose query between par...

javascript - Fuzzy Logic Duplicate Name Detector -

i working on application large number of products , brands. need match brand names , identify duplicates (possibly mis-typed) , merge them. similar android contacts. i have seen solutions using database distance functions. can suggest javascript libraries may me achieve this. brand names aren't (hopefully long). fuse library works well. it's simple as: var fue = new fuse(json_array_of_objects, object_with_keys_to_retrive); var rslt = fuse.search('yourstring'); the other alternative is: fuzzyset.js

python - initialize objects in numpy matrix -

i have numpy matrix filled unique objects. creating list of list , converting numpy array (see code below, under workaround). using because want use slicing access elements in matrix i wondering if there better way create such matrix. import random import numpy np class randomcell(object): def __init__(self): self.value = random.randint(0, 10) def __repr__(self): return str(self.value) # workaround temp_matrix = [[randomcell() row in range(3)] col in range(3)] workaround_matrix = np.array(temp_matrix) edit: want create matrix of objects not generate matrix of random numbers your method of building array list of lists fine. option be arr = np.array([randomcell() item in range(9)]).reshape(3,3) usually, save memory use np.fromiter build array iterator. however, since array has dtype object , unfortunately np.fromiter not option in case.

javascript - easiest way in R or Python to add image/video in map plot marker click popup/infowindow -

i have many different (lat,long data) points of world associated unique place names , corresponding each point specific image or video data. want create html file if user click on each point can see specific image or video in pop-up/infowindow. have used html files shiny web application. target examples links below in java: custom image in marker custom video in marker <script> // example displays marker @ center of australia. // when user clicks marker, info window opens. function initialize() { var mylatlng = new google.maps.latlng(-25.363882,131.044922); var mapoptions = { zoom: 4, center: mylatlng }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var contentstring = '<div id="content">'+ '<div id="sitenotice">'+ '</div>'+ '<h1 id="firstheading" class="firstheading">video in info window</h1>'+ ...

I can't enable Classroom API to project -

i know question has been asked here not answered... can't access classroom api in developers console though i've been aproved so. you, please, share neccesary steps? any appreciated :-) the google classroom api in developer preview. please apply access , wait confirmation email.

vba - How to make sure from Excel that a specific Word document is open or not? -

i wanted excel macro create report inserting spreadsheet data after bookmarks placed in template word documents. but found out if template word document open, macro crash , , consequently template document locked read-only , no longer accessible macro. is there way prevent macro crashing if template word document open ? below code set wdapp = createobject("word.application") 'create instance of word set wddoc = wdapp.documents.open(thisworkbook.path & "\templates\template_confirmation.docx") 'create new confirmation note here comes evolution of suggested in comments : a function test if file open , offer set directly while testing . how use : sub test() dim wddoc word.document set wddoc = is_doc_open("test.docx", "d:\test\") msgbox wddoc.content wddoc.close set wddoc = nothing end sub and function : public function is_doc_open(filetoopen string, folderpath string) word.document 'will open doc if is...

AngularJS - write custom directive to validate passed values -

i have html form looks : <div class="row col-lg-offset-3"> <div class="form-group col-lg-6" ng-class="{ 'has-error': userform.age.$invalid && userform.age.$dirty}" show-errors > <label class="control-label">age</label> <input type="text" class="form-control" name="age" ng-model="user.age" ng-required='!user.phonenumber' placeholder="age"/> </div> </div> directive: (function(){ angular.module('myapp', []) .controller('studentdatacontroller', function($scope) {}) .directive('showerrors', function() { return { restrict: 'a', require: '^form', link: function (scope, el, attrs, formctrl) { var inputel = el[0].queryselector("[age]"); var inputngel = angular.element(inputel); var inputvalue = inputngel...

javascript - Using MVC resource in Jquery - function stops working -

i have jquery function in mvc view check if @ least 1 checkbox clicked. function working if use hardcoded string. when add @resources.mystring into, stops working, can't figure out why $('.form-horizontal').on('submit', function (e) { if ($("input[type=checkbox]:checked").length === 0) { e.preventdefault(); alert("this working"); alert(@resources.mystring); //with function not working anymore return false; } }); i need add the string multilingual purpose. tried diferent aproches alert(@resources.mystring); alert(@html.raw(resources.mystring)) var aaa = { @html.raw(resources.mystring)} //and calling aaa i think missing basic knowlage of how should work together during page rendering, @resources.mystring injected in code. instance, if mystring == "abc"; , you'll end alert(abc); not want. just try enclose string in quotes: alert("...

Apache module - How to check existence of directive in httpd.conf -

i trying write sample apache module read config file file path specified in httpd.conf that: <location ~ /(?!.*\.(png|jpeg|jpg|gif|bmp|tif)$)> setinputfilter sample_input_filter setoutputfilter sample_output_filter configfilepath "/etc/httpd/conf.d/sample/sample.config" </location> at command record structure, do: static const command_rec config_check_cmds[] = { ap_init_take1( "configfilepath", read_config_file, null, or_all, "sample config"), { null } }; i set: module ap_module_declare_data sample_module = { standard20_module_stuff, create_dir_config, /* create per-dir config structures */ null, /* merge per-dir config structures */ null, /* create per-server config structures */ null, /* merge per-server config structures */ config_check_cmds, /* table of config file commands */ sample_reg...

Libgdx android app remove fullscreen and show titlebar -

here link doubt have regarding app.any kind of solve appreciated. https://gamedev.stackexchange.com/q/103610/68334 alright, after checking through files, believe following configurations work case. in styles.xml, declares gdxtheme. <style name="gdxtheme" parent="android:theme"> <item name="android:windowbackground">@android:color/transparent</item> <item name="android:colorbackgroundcachehint">@null</item> <item name="android:windowanimationstyle">@android:style/animation</item> <item name="android:windownotitle">true</item> <item name="android:windowcontentoverlay">@null</item> <item name="android:windowfullscreen">false</item> </style> in androidmanifest.xml, set application theme android:theme="@style/gdxtheme" . this need make status bar visible.

javascript - What's the best way of modifying event handler in jquery? -

i have call method in dispatch function "platform.performmicrotaskcheckpoint()". for eg. dispatch: function( event ) { platform.performmicrotaskcheckpoint(); //rest of code goes here } what best way of doing instead of making changes in jquery library ? how override jquery event handlers ?

ruby on rails - accepts_nested_attributes_for creating duplicates -

accepts_nested_attributes_for creating duplicates model class article < activerecord::base has_many :article_collections accepts_nested_attributes_for :article_collections, :allow_destroy => true, reject_if: :all_blank end class articlecollection < activerecord::base belongs_to :article end controller def update @article = article.find_by_id(params[:id]) @article.update_attributes(params[:article]) redirect_to :index end params params = {"utf8"=>"✓" "article"=> { "data_id"=>"dfe9e32c-3e7c-4b33-96b6-53b123d70e7a", "name"=>"mass", "description"=>"mass", "status"=>"active", "volume"=>"dfg", "issue"=>"srf", "iscode"=>"sdg", "image"=>{"title"=>"", "caption"=>"", "root_image...

python - DeepDream taking too long to render image -

i managed install #deepdream in server. i have duo core , 2gb ram. taking 1min process image of size 100kbp. any advice ? do run in virtual machine on windows or os x? if so, it's not going work faster. in virtual machine (i'm using docker) you're of time not able use cuda render images. have same problem , i'm going try installing ubuntu , install nvidia drivers cuda. @ moment i'm rendering 1080p images around 300kb , takes 15 minutes 1 image on intel core i7 8gb of ram.

osx - How to manually invoke a WiFi login splash window when already connected to WiFi? -

i'm using hotel wifi network after accepting terms & conditions in wifi login splash window when first connected. wifi login window (in chrome browser) offered 2 choices - free (slow, apparently veryyy slow) , paid (presumably faster). chose free option. however, want use paid version, cannot invoke login splash window again make selection. how can manually, through browser or terminal? i'm on mac os. removing wifi network , reconnecting again not help. have (slow) access internet time , login splash window never appears. try releasing , renewing dhcp lease . if doesn't work, try going page directly; it's located @ 192.168.1.1 , go in history find it.

mysql - ORA-01843 error found in netbeans while injecting sql query -

data entered netbeans form not been able insert database table . error found ora-01843 not valid month found occurs . following code showing error under submit button , private void submitnewequipactionperformed(java.awt.event.actionevent evt) { string status="park"; string type_id=getid(typelist.getselecteditem().tostring()) ; calendar cal = new gregoriancalendar(); int month=cal.get(calendar.month); int day=cal.get(calendar.day_of_month); int year=cal.get(calendar.year); system.out.print(cal.get(calendar.date)); system.out.print(month+1); system.out.print(year); simpledateformat sdf = new simpledateformat((day)+"/"+(month+1)+"/"+year); //system.out.print(sdf.format(cal.gettime()).tostring().tostring()); try { statement stmt=(statement)conn.createstatement(); string sql="insert eqp (id, eqp_type, name, status,make,...

javascript - how to use <div ng-view = ""> mulitple times -

in application have index.html file have loaded required scripts , body contains empty ng-view content update based on route url. first page landing page i'am showing button user, clicking on showing login page, changing path value of $location. on successful login dashboard page should come header, sidebar footer area going fixed , center area going changed based on menu clicks there in header section, changing route value center area declared when trying load dashboard.html page going infinite loop , when removing center div nothing empty view , view rendering fine. problem using can suggest me whether understanding corect ?? if yes please suggest me how achieve requirement... index.html <div class="row"> <div data-ng-view=""></div> </div> dashboard.html <div class = "row"> <header div here> <div> <sidebar div> **<div data-ng-...

shell - On Linux, FIND command with LS not showing proper result without option -d -

i need check files created in last day inside current folder has million of files. if used following command correct 80 or 90 files shown. correct. find . -ctime -1 -exec ls -ld {} \; but if change ls option rt or l or else without d. shows wrong result. shows thousands of file. have press control c stop output. following wrong never ending results. find . -ctime -1 -exec ls -l {} \; find . -ctime -1 -exec ls -t {} \; find . -ctime -1 -exec ls -rt {} \; find . -ctime -1 -exec ls {} \; can tell going on here. why works d. following works though find . -ctime -1 -exec ls -lrtd {} \; if ls /tmp , you'll see why. gives files in /tmp directory rather details on directory itself. you can 'fix' using -d have ls show directory rather files within (as you've seen) or using find -type f restrict search regular files only. that's assuming it's regular files you're interested in, there things fifo pipes , devices exist in hierarchy, t...

Can't test my Android apps on my LG MS395 -

i've allowed usb debugging on phone , connect through usb port. doesn't show in "choose running device" (i'm using android studio 1.2.2). i thought i'd have update usb driver or something, when online lg ms395 usb driver, come nothing. so, of now, i'm stumped , wondering if 4g phone incapable of testing android apps (which seems asinine me honestly). there's extremely simple solution guys can point me toward. the phone lg optimus f60 model # of lgms395.

mysql - How can I make a simple login system with PHP? -

my university left task create login system php (obviously, connected database ). problem registration page not save data sent database. don't know why is. here code: <html> <head> <link type="css/text" rel="stylesheet" href="unixyz.css"/> <meta charset="utf-8"/> <title>registro</title> </head> <body> <?php session_start(); $host="****"; $username="****"; $password="****"; $db_name="****"; $tbl_name="****"; mysqli_connect($host,$username,$password,$db_name)or die("cannot connect"); $email=$_post['email']; $password=$_post['password']; if (filter_var($email, filter_validate_email)){ $sql="select 'email' 'user' 'email'='$email'"; $result=mysqli_query($sql); $count=mysqli_num_rows($result); if($count>0){ echo ("<center><h1><font color='red...

asterisk - FreePBX 2.10 odbc storage -

i store voicemessages on odbc mysql database. app_voicemail compiled odbc storage support? this question cause setup in: - "freepbx 2.11" ask me enable file-storage or odbc-storage' - "freepbx 2.10" same question not asked. maybe cause support 'file-storage'? when leave message in vocalmail, in log there no trace of 'sql insert'. in examples i've seen, sql statement insert in table row of voicemessage? odbc dsn settings ----------------- name: asterisk dsn: asterisk-connector last connection attempt: 1970-01-01 01:00:00 pooled: no connected: yes ----------------- root@pbx:~ $ isql asterisk root passw0rd +---------------------------------------+ | connected! | | | | sql-statement | | [tablename] | | quit | | | +--------------------...

java - MainActivity to Fragment and from that Fragment back to MainActivity -

solve using getactivity() have mainactivity.java , repeatentry.java inside mainactivity have code have repeatentry ui //i did hide 2 linear layout here buttons , edittext inside ,using following method hidetwolinearlayout(); showcategorycontainerlayout(); fragment fragment = new repeatentry(); fragmentmanager fm = getfragmentmanager(); fragmenttransaction ft = fm.begintransaction(); //category_cont linear layout container fragment ft.replace(r.id.category_cont, fragment); ft.settransition(fragmenttransaction.transit_fragment_open); ft.commit(); inside repeatentry.java sample code button k = (button) v.findviewbyid(r.id.button); k.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { // intent intent = new intent(getactivity(),mainactivity.class); // startactivity(intent); // if use popbackstack , remove code intent , cannot show hide //note have metho...

python - Kivy BoxLayout - move widgets to the top -

i have widgets sized , positioned relative 1 another. if add "label:" bottom of kv code move top. can't "right" way it. missing? import kivy kivy.require('1.9.0') kivy.app import app kivy.uix.button import button kivy.uix.textinput import textinput kivy.uix.boxlayout import boxlayout kivy.lang import builder builder.load_string(''' <controller>: boxlayout: orientation: 'vertical' padding: 20 spacing: 20 textinput: hint_text: 'feed name' multiline: false size_hint: (0.75, none) height: 30 pos_hint: {'center_x': 0.5} textinput: hint_text: 'feed url' multiline: true size_hint: (0.75, none) height: 68 pos_hint: {'center_x': 0.5} button: text: 'add feed' padding: (10, 10) height...