Wednesday, March 30, 2016

meteor run android- spawn ENOENT and gradle errors from Cordova

Leave a Comment

I am attempting to run a Meteor project on an Android device and/or emulator. When I run either meteor run --verbose android or meteor run --verbose android-device, I get errors related to Cordova not being able to find certain gradle files. Here's some output from my console:

sarah@sarah-ThinkPad-X220:~/simple-todos$ meteor run --verbose android Getting installed version for platform android in Cordova project Checking Cordova requirements for platform Android [[[[[ ~/simple-todos ]]]]]                      => Started proxy.                              => Started MongoDB.                            Local package version is up-to-date: autopublish@1.0.4 <... removed some other "Local package" messages here ...> Preparing Cordova project from app bundle      Copying resources for mobile apps              Writing new config.xml                         Preparing Cordova project for platform Android Running Cordova app for platform Android with options --emulator ANDROID_HOME=/home/sarah/Android/Sdk/        | JAVA_HOME=/usr/lib/jvm/default-java => Started your app.                            => App running at: http://localhost:3000/      WARNING : no emulator specified, defaulting to nexus4 Waiting for emulator...oid Emulator          | emulator: UpdateChecker: skipped version check BOOT COMPLETEpp on Android Emulator          -                                                cp: no such file or directory: /home/sarah/Android/Sdk/tools/templates/gradle/wrapper/gradlew  chmod: File not found: /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/gradle/wrapper/gradle-wrapper.properties  sed: no such file or directory: /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/gradle/wrapper/gradle-wrapper.properties  Running: /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildDebug -b /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true  events.js:72app on Android Emulator          \         throw er; // Unhandled 'error' event               ^ Error: spawn ENOENT     at errnoException (child_process.js:1011:11)     at Process.ChildProcess._handle.onexit (child_process.js:802:34) => Errors executing Cordova commands:              While running Cordova app for platform Android with options --emulator:    Error: Command failed:                         /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/cordova/run --emulator     at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)    at ChildProcess.emit (events.js:98:17)    at Process.ChildProcess._handle.onexit (child_process.js:820:12)  ExitWithCode:1 

Indeed, the files and directories it is trying to access are not there. $ANDROID_HOME/tools/template/gradle/wrapper does not have a directory gradlew

sarah@sarah-ThinkPad-X220:~/Android/Sdk/tools/templates/gradle/wrapper$ ls gradle 

Likewise, there are no files at all in my ~/simple-todos/.meteor/local/cordova-build/platforms/android/gradle/wrapper directory, so there is no gradle-wrapper.properties.

I'm also quite uncertain about the meaning of the spawn ENOENT error.

How can I fix this?

EDIT: I wanted to test that gradle worked at all on my machine, so I made an app in Android Studio and ran it on my phone-- worked fine. My Meteor project still doesn't run on Android, but I think this tells me that gradle is working (somewhere) on my computer.

EDIT: I searched for a gradlew directory on my computer and the only ones I found were in an android-studio, not in my $ANDROID_HOME(~\Android/Sdk). Not sure what to do with this info, but it seems relevant.

EDIT It occurred to me that the output of gradle -v might be useful:

$ gradle -v  ------------------------------------------------------------ Gradle 2.5 ------------------------------------------------------------  Build time:   2015-08-31 14:26:53 UTC Build number: none Revision:     UNKNOWN  Groovy:       2.4.3 Ant:          Apache Ant(TM) version 1.9.6 compiled on July 8 2015 JVM:          1.7.0_95 (Oracle Corporation 24.95-b01) OS:           Linux 4.2.0-23-generic amd64 

0 Answers

Read More

jsx react debugger not matching despite webpack source maps

Leave a Comment

I'm learning React and JSX and using webpack to compile but when I throw in 'debugger' into my component, the line isn't matched when I'm in Chrome Dev Tools' Sources tab (in general the sources doesn't reflect what I have in my app.jsx file at all). The React tab doesn't really load up either. Below is my webpack.config:

module.exports = {   context: __dirname,   entry: "./api_assignment.jsx",   output: {     path: "./",     filename: "bundle.js"   },   module: {     loaders: [       {         test: /\.jsx?$/,         exclude: /node_modules/,         loader: 'babel',         query: {           presets: ['react']         }       }     ]   },   devtool: 'source-map',   resolve: {     extensions: ["", ".js", ".jsx"]   } }; 

enter image description here

//Webpack screenshot

enter image description here

enter image description here

1 Answers

Answers 1

If you are loading your html from local file and not webpack server, you need to enable React Developer Tools extension option "Allow access to file URLs".

Read More

MS Access 2010 Error - OLE Object Failed Attempting to Insert Object (.bmp)

Leave a Comment

MS Access 2010 on Windows 7 Pro x64

  • Right-click on a cell in a table (Data Type = OLE Object)
  • Click on Insert Object...
  • Select Create from File
  • Click Browse to find .bmp file (844KB)
  • Click OK

Receive the following error:

The operation on the OLE object failed. The OLE server may not be registered. To register the OLE server, reinstall it.

Does anyone know how to fix this issue? I've tried running Access in compatibility mode and making the database a trusted source. I am not running Norton Antivirus, which some posts say might be the problem.

1 Answers

Answers 1

@Andre and @Raju have already answered briefly in the comments, but I'm posting a proper answer for the sake of tidyness:

OLE Objects are a bit tricky, but changes are you are missing the OLE Automation Server for the file type, which in this case is - a photo editor (like Paint or Microsoft Photo Editor).

Generally I found 2 solutions you might try:

  1. If you're coming from an older version (which is unlikely nowadays, but still), according to this Microsoft Photo Editor is removed when you install Office 2010.

    If that's the case, see https://support.microsoft.com/en-us/kb/817095 on how to reinstall Microsoft Photo Editor,

    Otherwise, try to restore Paint as the default application used by Access. See here https://support.microsoft.com/en-us/kb/177587 how. (Basically just remove and reinstall Paint. Instructions in the link are for an older Windows version, but I guess most steps are similar).

  2. If you don't mind losing the existing data in your image column (or table is still empty), you can switch from the OLE Object data type to the (newer) Attachment data type.

    You also gain the added value of being able to attach multiple images.

    You can read more on Attachment data type here - https://support.office.com/en-us/article/Attach-files-and-graphics-to-the-records-in-your-database-d40a09ad-a753-4a14-9161-7f15baad6dbd#bm1

Good luck :)

Read More

wpp.targets to change folder permissions not being applied

Leave a Comment

I am deploying to elastic beanstalk via Visual Studio 2013.

Here is my wpp.targets file:

<?xml version="1.0" encoding="utf-8"?>  <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  <Target Name="SetupCustomAcls" AfterTargets="AddIisSettingAndFileContentsToSourceManifest">     <ItemGroup>      <MsDeploySourceManifest Include="setAcl">        <Path>$(_MSDeployDirPath_FullPath)\ChatFiles</Path>        <setAclAccess>Read,Write</setAclAccess>        <setAclResourceType>Directory</setAclResourceType>        <AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>      </MsDeploySourceManifest>      <MsDeploySourceManifest Include="setAcl">             <Path>$(_MSDeployDirPath_FullPath)\FileHoldingForS3</Path>             <setAclAccess>Read,Write</setAclAccess>             <setAclResourceType>Directory</setAclResourceType>              <AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>          </MsDeploySourceManifest>      <MsDeploySourceManifest Include="setAcl">        <Path>$(_MSDeployDirPath_FullPath)\FileHoldEmail</Path>        <setAclAccess>Read,Write</setAclAccess>        <setAclResourceType>Directory</setAclResourceType>        <AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>      </MsDeploySourceManifest>          </ItemGroup>   </Target>   <Target Name="DeclareCustomParameters" AfterTargets="AddIisAndContentDeclareParametersItems">      <ItemGroup>       <MsDeployDeclareParameters Include="FilesSetAclParam">         <Kind>ProviderPath</Kind>         <Scope>setAcl</Scope>         <Match>^$(_EscapeRegEx_MSDeployDirPath)\\ChatFiles$</Match>         <Description>Add write permission to the ChatFiles folder.</Description>         <DefaultValue>{$(_MsDeployParameterNameForContentPath)}/ChatFiles</DefaultValue>         <Value>$(_DestinationContentPath)/ChatFiles</Value>         <Tags>Hidden</Tags>         <Priority>$(VsSetAclPriority)</Priority>         <ExcludeFromSetParameter>True</ExcludeFromSetParameter>       </MsDeployDeclareParameters>       <MsDeployDeclareParameters Include="FilesSetAclParam">            <Kind>ProviderPath</Kind>               <Scope>setAcl</Scope>              <Match>^$(_EscapeRegEx_MSDeployDirPath)\\FileHoldingForS3$</Match>             <Description>Add write permission to the FileHoldingForS3 folder.</Description>               <DefaultValue>{$(_MsDeployParameterNameForContentPath)}/FileHoldingForS3</DefaultValue>               <Value>$(_DestinationContentPath)/FileHoldingForS3</Value>              <Tags>Hidden</Tags>              <Priority>$(VsSetAclPriority)</Priority>              <ExcludeFromSetParameter>True</ExcludeFromSetParameter>         </MsDeployDeclareParameters>       <MsDeployDeclareParameters Include="FilesSetAclParam">         <Kind>ProviderPath</Kind>         <Scope>setAcl</Scope>         <Match>^$(_EscapeRegEx_MSDeployDirPath)\\FileHoldEmail$</Match>         <Description>Add write permission to the FileHoldEmail folder.</Description>         <DefaultValue>{$(_MsDeployParameterNameForContentPath)}/FileHoldEmail</DefaultValue>         <Value>$(_DestinationContentPath)/FileHoldEmail</Value>         <Tags>Hidden</Tags>         <Priority>$(VsSetAclPriority)</Priority>         <ExcludeFromSetParameter>True</ExcludeFromSetParameter>       </MsDeployDeclareParameters>     </ItemGroup>   </Target>  

But the folder permissions are not changed after deployment on any of my ec2 instances.

I am ensuring that I the wpp.targets file is not cached prior to deployment.

1 Answers

Answers 1

Make sure you didn't instruct MSDeploy to ignore ACLs via the MSDeploy.exe call

,includeAcls="False" 

Or in the build:

http://blogs.iis.net/msdeploy/skipping-setting-an-acl-in-a-visual-studio-2010-deployment-package

Read More

sub-architecture 'R' is not installed (in RStudio for certain CRAN package installations)

Leave a Comment

I am using RStudio (Version 0.99.484) and R (Version 3.2.3) on Mac OSX (Version 10.9.5).

Unfortunately, I cannot recall if I did anything to cause these changes, but since about two weeks ago, whenever I try to install certain package from CRAN, upon using the usual syntax:

install.packages("packageName") 

I receive an Error Message in RStudio. Here is an example of a new package for which I see this issue:

install.packages("plotly") 

Gives me the Error Message:

  There is a binary version available but the source version is later:        binary source needs_compilation plotly 2.0.16  3.4.1             FALSE  installing the source package ‘plotly’    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0   343    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  38 1039k   38  399k    0     0  1724k      0 --:--:-- --:--:-- --:--:-- 1724k100 1039k  100 1039k    0     0  3376k      0 --:--:-- --:--:-- --:--:-- 8521k * installing *source* package ‘plotly’ ... ** package ‘plotly’ successfully unpacked and MD5 sums checked ** R ** data *** moving datasets to lazyload DB ** inst ** preparing package for lazy loading Warning: package ‘ggplot2’ was built under R version 3.2.4 ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded *** arch - R ERROR: sub-architecture 'R' is not installed *** arch - x86_64 Warning: package ‘ggplot2’ was built under R version 3.2.4 ERROR: loading failed for ‘R’ * removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/plotly’ Warning in install.packages :   installation of package ‘plotly’ had non-zero exit status  The downloaded source packages are in     ‘/private/var/folders/vn/lhzbs8ds6xbg965nnfcj6ftm0000gn/T/RtmpmyVFR4/downloaded_packages’ 

This has happened for more than one packages (and seems sudden, the past two weeks). However, it does not happen for all packages. I am wondering how to approach this issue given my use of RStudio, Mac OSX, R, etc. I see very few resources when Googling my Error Message "sub-architecture 'R' is not installed".

Upon running R.Version():

$platform [1] "x86_64-apple-darwin13.4.0"  $arch [1] "x86_64"  $os [1] "darwin13.4.0"  $system [1] "x86_64, darwin13.4.0"  $status [1] ""  $major [1] "3"  $minor [1] "2.3"  $year [1] "2015"  $month [1] "12"  $day [1] "10"  $`svn rev` [1] "69752"  $language [1] "R"  $version.string [1] "R version 3.2.3 (2015-12-10)"  $nickname [1] "Wooden Christmas-Tree" 

1 Answers

Answers 1

In looking at the dependence for Plotly it looks as though it requires a ggplot2 version with R ≥ 3.1. So just update your base R to version 3.1 or newer and it'll work. It isn't your Rstudio but your base R which importantly is different.

If all else fails try installing to windows 10, Rstudio version 0.99.892 and R 3.2.4 as I was not able to replicate this problem using using these versions which happen to be the most up to date.

Read More

HTML5 video won't work with jquery bxSlider plugin on iPad

Leave a Comment

I'm using the Jquery bxSlider plugin to create a slider gallery of images and video for the iPad. I'm using the HTML5 video tag for video implementation:

<video width="400" height="260" controls> <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> </video> 

Video source code works fine on iPad when on its own, however when merged with slider markup, the video does not play.

Test link: http://www.ekimmedia.com/totem/TIC/MG/

If I remove this script:

<script src="js/jquery.bxSlider.js" type="text/javascript"></script> 

from the source code, the video then works on iPad.

Test link with bxSlider script removed: http://www.ekimmedia.com/totem/TIC/MG/index10.html

Not sure what is causing the conflict.

Thanks,

3 Answers

Answers 1

The only way how I get this slider to work was to download it locally from the bxslider official website. And try to follow their tutorial on how to make responsive video slider. They do not mention anywhere about these arrow images as they do not come in the css. So, remember to grab an images folder from the downloaded bxslider zip and paste it into js folder of your project.

In my final setup I have had 4 local files in js folder: jquery-2.2.2.min.js, jquery.bxslider.css, jquery.bxslider.js and jquery.fitvids.js. js folder also included images subfolder where were controls.png and bx_loader.gif.

This all was then referenced in HTML file as follows:

<head>   <link rel="stylesheet" href="js/jquery.bxslider.css">   <script src="js/jquery-2.2.2.min.js"></script>   <script src="js/jquery.fitvids.js"></script>   <script src="js/jquery.bxslider.js"></script>   <script type="text/javascript">     $(document).ready(function () {     $('.bxslider').bxSlider({     video: true,     useCSS: false     });     });   </script> </head> <body>     <ul class="bxslider">         <li>             <iframe src="YOUR_LINK_TO_VIDEO" width="400" height="260" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>         </li>         <li>             <iframe src="YOUR_LINK_TO_VIDEO" width="400" height="260" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>         </li>     </ul> </body> 

I have tested my solution on iOS device and everything seems to work fine. There is somewhat similar solution to this problem, you can also look into it.

Answers 2

Try viewing the video element with a debugging tool like firebug or safari developer tools. You may have to use a PC/Mac browser to do this. See if the video element loses any attributes, or gets extra things added after your jquery script runs. Having done some mobile development involving videos I can tell you it is very touchy, especially since there are approximately 82 billion different browsers and OS versions floating around on mobile devices. If you see that the video element is changed, then you will need to add a script that takes it back to something viewable on your iPad.

You might also make sure your videos are wrapped correctly. It looks like this slider script requires the following format:

<div id="slideshowcontainer">  <div>slide1 content</div>  <div>slide2 content</div>  <div>etc...</div> </div>  OR  <ul id="slideshowcontainer">  <li>slide1 content</li>  <li>slide2 content</li>  <li>etc...</li> </ul> 

Answers 3

Try to change the position of

 `<script src="js/jquery.bxSlider.js" type="text/javascript"></script>` 

my be it is due to confliction of libraries, put it in middle of all scripts or in bottom or anywhere elc, i am sure it gona work.

Read More

Ruby on Rails cannot load such file — selenium-webdriver Error

Leave a Comment

I am testing running selenium webdriver with phantomjs from Ruby on Rails. I am testing locally on my computer.

The following code runs fine within my test Ruby script when I run "ruby test.rb"

  def google_title     require 'selenium-webdriver'     driver = Selenium::WebDriver.for :phantomjs     driver.navigate.to "https://www.google.com"     page_title = driver.title     puts page_title   end    google_title 

I have pretty much the same code in my application_controller.rb file:

  def google_title     require 'selenium-webdriver'     driver = Selenium::WebDriver.for :phantomjs     driver.navigate.to "https://www.google.com"     page_title = driver.title     render text: page_title   end 

But when I run my app I get a "cannot load such file -- selenium-webdriver" error.

enter image description here

I have added this to my Gemfile and ran bundle install but get the same error.

gem 'selenium-webdriver', '~> 2.45' 

When I run gem list --local it shows selenium is installed.

Any help would be appreciated.

Update:

I ran almost exactly the same code as above but with watir-webdriver and got the same results. The Ruby script ran fine by it's self but gave a "cannot load such file" error for watir-webdriver when I tried to run it from Rails.

I ran another test with nokogiri and it worked fine. Both by it's self and in Rails.

Update2:

It appears to be something I am doing and not my test environment. I just ran the same code on an online IDE and got the same type of error:

enter image description here

Update3:

Here is the full content of the application_controller.rb file when I run the test with watir-webdriver and headless. I get the same results. Maybe I am setting something wrong here?

class ApplicationController < ActionController::Base   def google_title     require 'watir-webdriver'     require 'headless'     headless = Headless.new     headless.start     b = Watir::Browser.start 'www.google.com'     page_title = b.title     b.close     headless.destroy     render text: page_title   end end 

enter image description here

1 Answers

Answers 1

did you restart your webrick, puma ...server?

works like a charm.

gem 'selenium-webdriver', '~> 2.45'

bundle install

on mac:

brew install phantomjs

class ApplicationController < ActionController::Base    protect_from_forgery with: :exception   #no need for require   def google_title     driver = Selenium::WebDriver.for :phantomjs     driver.navigate.to "https://www.google.com"     page_title = driver.title     render text: page_title   end end 

routes.rb:

get 'google-title' => 'application#google_title'

http://127.0.0.1:3000/google-title 

result Google

Read More