Posts

javascript - Angular $templatecache name conflicts -

we have single page application structure multiple html templates. multiple developers pushing own submodules app , during bundling process (webpack) pushing these templates $templatecache. inevitably of apps partials happen have same names (dashboard, nav, section etc) , angular overwriting templates. is there way avoid name conflicts during angular template caching process? or there gulp-grunt etc plugin create unique template names , match-replace them in htmls? well, try out longer names won't conflict... dashboard, nav, section generic , conflict try: dashboard-for-admin-page, nav-for-submodule-alpha-0, section-right-of-main-page, etc the way team have folder structure each module complex names example: /partials ----/global-partials --------/header-global.html --------/footer-global.html ----/main-page --------/index-for-main-page.html --------/partial-header-on-main-page.html --------/left-pane-on-main-page.html ----/about-us-page ----/cart-page...

javascript - Creating a CSV file from a Meteor.js Collection -

i've written code far , can list of records show on webpage, need able csv (comma separated values) file. right page shows list follows: name address description bob 1 street journalist bill 2 street fireman etc... anyway can have meteor create csv file download, instead of showing webpage html markup? based on how serve file using iron router or meteor itself? html: <template name="blah"> <a href="{{pathfor 'csv'}}">download csv</a> </template> js: // example collection var dummydata = new mongo.collection("dummydata"); // create sample data if (meteor.isserver) { meteor.startup(function() { var dummydatacursor = dummydata.find(); if (dummydatacursor.count() === 0) { for(var i=1; i<=100; i++) { dummydata.insert({name: "name" + i,address: "address" + i, description:"description" + i}); } } }); }...

OpenXava Impossible to execute Add files action Member not found in model -

i'm experimenting openxava files stereotype , embedded class , finding strange error. first of all, if create record , attach bunch of files before saving first time, works. if i, however, first create record (temple), leave in embedded record (library) blank, save (saves successfully, says), go edit it, following message: "impossible execute add files action: member library.documents not found in model temple" i have not been able find useful via google on this. is i'm doing wrong or error in openxava library. i'm using: openxava version 5.1.1 tomcat comes it: apache tomcat version 7.0.50 oracle 11g here's temple , inner library class: package org.openxava.zen.model; import javax.persistence.*; import org.openxava.annotations.*; @entity public class temple { @id @column(length=3) @generatedvalue @readonly private int id; @version private integer version; @column(length=50) private string name; @stereotype(...

Google Cloud Print from Web -

i wrote script prints test pages url on web-site, , every time press print button, dialog frame choosing printer appears . want avoid because account synchronized printer. window.onload = function() { var gadget = new cloudprint.gadget(); gadget.setprintbutton( cloudprint.gadget.createdefaultprintbutton("print_button_container")); // div id contain button gadget.setprintdocument("url", "test page", "https://www.google.com/landing/cloudprint/testpage.pdf"); } you use oath , html button rather gadget accomplish this. requires using google developer console oauth permissions. then need authorize cloud print service. the following set of functions use in google apps scripts, can adapted. first thing log url link can go in order authorize cloud print service. function showurl() { var cpservice = getcloudprintservice(); if (!cpservice.hasaccess()) { logger.log(cpservice.getauthorizationurl()); } } in foll...

java - Why can't I add an object to a HashSet -

i trying populate hashset in constructor penny objects i'm not sure how this. have written keep getting error messages. public pocket(int numofpennies){ hashset penniesset = new hashset<penny>(); while( penniesset.size() <= numofpennies){ penniesset.add(penny); } you're not adding object set rather trying add type, , won't work or compile. instead of penniesset.add(penny); try // assuming penny has default constructor penniesset.add(new penny()); also, add collection using loop, not while loop, since know prior starting loop how many times want loop. are sure want use hashset hold pennies? hashsets used when want have no duplicates in collection, wouldn't 1 penny equivalent another? in other words, shouldn't true: pennya.equals(pennyb) . of course depend on how define equals(...) , hashcode() penny class. would different collection such arraylist more logical?

javascript - Getting data from Google Chrome Webview to Caller/Parent window -

i'm working on chrome kiosk application (so packaged app limitations apply) that's web browser deployed chrome devices. i'm looking support screenshots, , i'm using html2canvas this, need store them uploaded later on. i'm calling html2canvas using webview.executescript{file:} callback. in callback i'm executing actual html2canvas call webview.executescript({ file: "kiosk/html2canvas.js" }, handlehtml2canvasinjected); function handlehtml2canvasinjected(event) { var webview = document.queryselector('webview'); webview.executescript({code: "html2canvas(document.body).then(function(canvas){ //whatever });"}); } i can append canvas object body , see screenshot working. however, need returned caller. i've tried use localstorage, seems webviews storage , caller's storage 2 different things. it boils down fact need able communicate "stuff" between webview , window created webview. loa...

google apps script - GmailApp.search doesn't filter the labels -

i try send attachments google drive account have problem search of gmailapp.search. i have camera in home sends email every 5 minutes same subject , each message has attached file that's name day-time.jpg first think in search label , of process, put new label mark , don't repeat message, receive message. i tried test many ways , received message has label:processed. function () { //all message of camera have label googledrive var threads = gmailapp.search("has:attachment -label:processed label:googledrive", 0, 5); var folder = getfolder(drivefolder); (var x=0; x<threads.length; x++) { var message = threads[x].getmessages(); for(var y=0; y<message.length; y++) { var desc = message[y].getsubject() + " #" + message[y].getid(); var att = message[y].getattachments(); (var z=0; z<att.length; z++) { try { if (check) { var name = att[z].getname(); i...