AR-Speeker: raw cannot be resolved or is not a field - r.java-file

I am using the AR-Speeker project
And I am facing the following error: raw cannot be resolved or is not a field
In the file: AR_SpeekerActivity.java, in the following 2 lines:
players.add(new Player("Porl.obj", "Porl.patt", 3.0f, R.raw.porl_01));
players.add(new Player("Elaine.obj", "Elaine.patt", 3.0f, R.raw.elaine_01));
Thank you for your help

I guess it's because in that project there is no raw folder in the res folder. Try to add the raw folder inside res folder and also add 2 mp3 files in the raw folder but change the name to porl_01.mp3 and elaine_01.mp3. Finally clean the project, this may solve the problem.

Related

Storage::move giving “File not found at path:”

I am trying to move an image from one folder into another folder by using:
Storage::move(storage_path('app/public/temporary/').$imageName, storage_path('app/public/profilePic/'.$imageName));
But when i run it gave me the error:
File not found at path: home/vagrant/code/avida/storage/app/public/temporary/5bfb7272e9dc9.download.jpeg
i google and found the following solution:
Storage::disk('local')->move(storage_path('app/public/temporary/').$imageName, storage_path('app/public/profilePic/'.$imageName));
but then it gave another error:
Method 'disk' not found in \Illuminate\Support\Facades\Storage
Can anyone please help me how can i move this file ?
Thank you
Storage class operate in storage directory so there is no need to use storage_path() helper.
Change your code to the one below:
Storage::move('public/temporary/'.$imageName, 'public/profilePic/'.$imageName);
I hope that helps :)

Cannot install search-guard - "ERROR: `elasticsearch` directory is missing in the plugin zip"

As topic states, I have a problem while trying to install search-guard plugin for my ELK stack:
[XXX#XXXX bin]$ ./elasticsearch-plugin install -b file:///home/xxxx/search-guard-6-6.2.1-21.0.zip
-> Downloading file:///home/xxxx/search-guard-6-6.2.1-21.0.zip
[=================================================] 100%  
ERROR: `elasticsearch` directory is missing in the plugin zip
I tried to do it from custom directory, then, following this answer from home, but it did not help. When I unzip the archive, I can see that there is a directory called "elasticsearch" there:
Does anyone have any suggestions how to proceed with that?
The error comes from InstallPluginCommand.class within the lib\plugin-cli-x.x.x.jar and is exactly what is says. Here's a clipped portion of the code as it's reading thru the entries in the zip file:
ZipInputStream zipInput = new ZipInputStream(Files.newInputStream(zip));
try {
ZipEntry entry;
while((entry = zipInput.getNextEntry()) != null) {
if (entry.getName().startsWith("elasticsearch/")) {
hasEsDir = true;
...
}
}
if (!hasEsDir) {
throw new UserException(2, "`elasticsearch` directory is missing in the plugin zip");
}
I realize that doesn't help you much, but as a last ditch effort, if you can't get to the root cause of the issue, 1 thing I did to get me over the hurdle was to just copy the files from the zip file into the es plugins directory (/usr/share/elasticsearch/plugins in our case). They go within /plugins, but under a directory, which is the name that Elasticsearch knows the plugin by.
The only 2 gotchas are:
You need to know the directory name to create under /plugins.
You need to know the replacement values for the plugin-descriptor.properties file.
If you can get that far, you can start ES and it should load everything fine.

How can I avoid "Zip end of central directory signature not found (Zip::Error)" with rubyzip?

I'm reading a lot of zip file with rubyzip.
However this error message is always showing in only specific file even it is zip file.
/app/vendor/bundle/ruby/2.3.0/gems/rubyzip-1.2.1/lib/zip/central_directory.rb:143:in `get_e_o_c_d': Zip end of central directory signature not found (Zip::Error)
I guess this error occures in rubyzip.
How can I manage this error?
Here is my code.
url = 'http://example.zip'
zipfilename = open(url)
Zip::File.open(zipfilename, :allow_redirections => :all) do |zip_file|
entry = zip_file.glob("*ixbrl.htm").first
stream = entry.get_input_stream.read
puts stream
end
Thank you!
I faced this error when I try to extract data from a uploaded .xlsx file in my application. On my context, the .xlsx file was corrupted, so my solution was save the content (I usually handle the buffer file after the upload) as a csv file (in my application I dont need to worry about the file extension), fixing the content by force it to encode as utf-8, and extract it's data after it. here is a example of the code, I'm using roo-xls gem to handle .xls files and roo gem to handle .csv and .xlsx files.
I ran into the same error. Also only reproducible on Heroku. The error was fixed after I added an unzip buildpack (second, after Ruby).
https://github.com/davidlibrera/heroku-buildpack-unzip
If you're using a google docs xlsx file try checking if the access of the sheet link is public.

Sparrow.Chart.WinRT.45 Payload file 'C:\...\' does not exist errors

When I add Sparrow.Chart.WinRT.45 through NuGet package manager, upon attempting to compile, I am faced with
Error 7 Payload file 'C:\Repository\Application\packages\Sparrow.Chart.WinRT.13.1.0.114\lib\netcore45\Sparrow.Chart.WinRT.45\Sparrow.Chart.WinRT.45\Legend\Legend.xaml' does not exist. Electroencephalograph
Error 8 Payload file 'C:\Repository\Application\packages\Sparrow.Chart.WinRT.13.1.0.114\lib\netcore45\Sparrow.Chart.WinRT.45\Sparrow.Chart.WinRT.45\Themes\generic.xaml' does not exist. Electroencephalograph
Error 9 Payload file 'C:\Repository\Application\packages\Sparrow.Chart.WinRT.13.1.0.114\lib\netcore45\Sparrow.Chart.WinRT.45\Sparrow.Chart.WinRT.45\Themes\Styles.xaml' does not exist. Electroencephalograph
Any ideas?
In case if you couldn't figured out still, the path to the .xaml files are wrong. If you check the packages you will see that it has one Sparrow.Chart.WinRT.45\ folder, but the VS search them in Sparrow.Chart.WinRT.45\Sparrow.Chart.WinRT.45. So you should create a folder in the packages folder and copy those files to there.

How does MediaWiki calculate the file path to an image?

I'm just installing MediaWiki (loving it). I'm lookin at this for adding images. I can se the logic of
[[File:MediaWiki:Image sample|50px]]
but where so I set the filepath for "File" (nothing obvious in LocalSettings.php) ... or is there some other logic at work?
I'd appreciate any help
Thanks
File location is determined by $wgLocalFileRepo which by default depends on $wgUploadDirectory and $wgHashedUploadDirectory. The upload directory defaults to [MediaWiki base dir]/images (Adrian must be using an older version). If hashing is enabled, /x/xy will be appended to the path, where xy are the first two letters of the md5 hash of the filename.
The defaults from DefaultSettings.php are:
$wgUploadPath = "$wgScriptPath/uploads";
$wgUploadDirectory = "$IP/uploads";
If you want to change this, you should copy and paste this into LocalSettings.php
And make sure that $wgEnableUploads = true; is in LocalSettings.php too.
Your "Image sample" is the name of image, not the name of a file. By config file you can just set the root folder for image uploads.
Just for future reference in case someone else runs into this issue:
I installed MediaWiki on my Mac OS Sierra and when I attempted to upload an image I got the following message:
Failed:
Could not open lock file for "mwstore://local-backend/local-public/d/d9/babypicture.png".
I changed the permissions on the mediawiki_root/images folder to be owned by _www user and group.
chown -R _www:_www wiki/images
I was able to upload the image afterward.

Resources