Posts

cq5 - device simulator not working in AEM 6 -

the device simulator not working in aem 6 (mongo db persistence manager) installation. it's throwing error that's stopping page loading. i'm trying open demo geometrixx media site has required deice groups set. stack trace of exception *error* [0:0:0:0:0:0:0:1 [1410351155706] /content/geometrixx-media/en.html http/1.1] com.day.cq.wcm.tags.includetag error while executing script head.jsp org.apache.sling.api.scripting.scriptevaluationexception: org.apache.sling.scripting.jsp.jasper.jasperexception: unable compile class jsp: error occurred @ line: 103 in jsp file: /libs/wcm/mobile/components/simulator/simulator.jsp type java.lang.charsequence cannot resolved. indirectly referenced required .class files 100: }); 101: </script><% 102: } else { 103: log.warn("mobile page [{}]: no device groups, cannot initialize emulators.", currentpage.getpath()); 104: } 105: } 106: %> @ org.apache.sling.scripting.core.impl.defa...

osx - How to a file uploading using Automator in apple script? -

i’m new automator. i’m trying achieve. i have code uploading file in safari using applescript ( upload file myfile points to): on run argv set myfile item 1 of argv activate application "safari" tell application "system events" tell process "safari" keystroke "g" using {command down, shift down} delay 2 key code 51 delay 2 keystroke myfile delay 30 key code 52 delay 10 key code 52 delay 5 end tell end run this applescript been called java , works fine. this working totally fine. want put in automator service, safari has directly access applescripts, rather java doing it. have 2 questions: many safari running , calling service. safari needs give file uploading process needs figured out. possible automator find process id of application called ? if so, how shall pass parameter (the file location uploaded) automator, when service called? ...

android - Want to restart service if application stopped by user from application manager. -

i'm using sticky android service using code snippet in service class @override public int onstartcommand(intent intent, int flags, int startid) { return start_sticky; } but restarts when app force closed android o/s, although when user force stop app application manager, service terminated. however, requirement want keep running service forever till app installed in device. 1 me on this? you can use forground service make service alive. @override public int onstartcommand(intent intent, int flags, int startid) { notification notification=new notification(r.drawable.icon,"the service running",system.currenttimemillis()); intent j=new intent(this, activity.class); pendingintent pi=pendingintent.getactivity(this, 0, j, 0); notification.setlatesteventinfo(this, "notification message", "runningservice", pi); notification.flags|=notification.flag_no_clear; startforeground(1, notification);...

shell - How to read file names from a txt file in cmd prompt(script) and then combine a subset of the files into a PDF file using the cmd line in windows -

i have text file in following format: 2014-05-13 03:35 pm 48,841 sur2-**c01**-00-000-pce-1001-002.pdf 2014-05-13 03:36 pm 43,599 sur2-**c01**-00-000-pce-1002-001.pdf 2014-05-13 03:35 pm 51,900 sur2-**c02**-00-000-pce-1000-001.pdf 2014-05-13 03:35 pm 53,622 sur2-**c02**-00-000-pce-1000-002.pdf 2014-05-13 03:35 pm 52,145 sur2-**c02**-00-000-pce-1000-003.pdf 2014-05-13 03:35 pm 50,426 sur2-**c02**-00-000-pce-1000-004.pdf i need parse file, , pull out files match c01 or c02, , send these files combined pdf file, 1 c01 , 1 c02. how can parse file, , string match file names on c01 or c02? then, how can take above parse result, , using file names found, combine them pdf command line or in script? merge-c01.bat 1.use awk parse file array set list=($(awk '/c01/{print $5}' file.txt)) 2.use pdf merge tool (pdftk) merge files in array for %%i in %list% pdftk out.pdf %%i cat output out.pdf...

css - Maintain aspect ratio and font size based on browser height and width? -

the code below attached window.onresize = resize; . basewidth , baseheight read on load basis calculations. main variable defined setting main html node. font set on block element cause of em based elements within resize in kind. when width or height of browser changed ratio recalculated. please see demo understand achieve js find pure css solution: http://codepen.io/anon/pen/nlauf i have been exploring options in css3 such calc . feel free suggest improvements js below also. function resize() { var height = 0, width = 0; if(window.innerwidth <= window.innerheight) { size = window.innerwidth / basewidth; height = baseheight * size; width = window.innerwidth; } else { size = window.innerheight / baseheight; height = window.innerheight; width = basewidth * size; ...

scala - access google cloud storage using java library gets '403 forbidden' -

i'm trying use google cloud storage java library in scala list items in bucket val credential = new googlecredential.builder() .settransport(googlenethttptransport.newtrustedtransport()) .setjsonfactory(jacksonfactory.getdefaultinstance()) .setserviceaccountid("xxx@developer.gserviceaccount.com") .setserviceaccountscopes(collections.singleton(storagescopes.devstorage_read_only)) .setserviceaccountprivatekeyfromp12file(new file("file.p12")) .build() val storage = new storage.builder( googlenethttptransport.newtrustedtransport(), jacksonfactory.getdefaultinstance(), credential) .sethttprequestinitializer(credential) .setapplicationname("app") .build() storage.objects.list("bucket").execute however got com.google.api.client.googleapis.json.googlejsonresponseexception: 403 forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "...

m4a - android-aac-enc does not work on Samsung Star phone -

i need implement audio recording pause/resume functionality , output has m4a file format. implemented recording in pcm format. i'm using (for old android versions only) library found here - https://github.com/timsu/android-aac-enc the strange part is working lot of devices (like nexus 7) not work samsung star. there no crash, player after tries play there strange noise. i suspect architecture of processor don't know might , how fix it. please if have experience library me. (or if know better 1 integrate) thanks , kind regards ok, managed make working. in documentation written call multiple times encode method. implemented encoding on small chunks. problem seems @ end of each chunk puts , awful beep :-( so know not perfect solution manage make working load whole file in byte array , encode @ once... if finds better solution please let me know.