Unable to Load Package into R - package

I'm not able to load/install packages all a sudden.
install.packages("fpp")
library(fpp)
install.packages("fpp")
Installing package into ‘C:/Users/andre/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/fpp_0.5.zip'
Content type 'application/zip' length 82399 bytes (80 KB)
downloaded 80 KB
I tried different version of R 4.2.2 and R 4.2.1 which my instructor uses who has no problem running the code.

Related

GStreamer failing to build on macOS Big Sur

Downloading the pkg installers from the official GST resource - https://gstreamer.freedesktop.org/download/.
Install the pkgs and add the framework to sample command line project in XCODE.
When I try to run the app, I got this error
file not found: #rpath/lib/libgstnet-1.0.0.dylib for architecture x86_64
Tested with GST 1.20 / 1.18 on 2 Macs - same results.
Question: how to address the framework usage correctly?

Where are pacman package databases downloaded from?

When updating your system on archlinux with pacman -Suy, pacman gets package databases from somewhere and then downloads packages from mirrors according to versions specified in these databases.
I know these databases are in /var/lib/pacman/sync/. My question is, where does pacman get them from?
The db files also come from the package mirrors specified in /etc/pacman.d/mirrorlist.
For example in this core repo:
...
core.db 136.6 KiB 2022-Mar-05 12:53
core.db.tar.gz 136.6 KiB 2022-Mar-05 12:53
...
The wiki also mentions what to do if you get an error:
Failed retrieving file 'core.db' from mirror
If you receive this error message with correct mirrors, try setting a different name server.

How to install Snapper on Ubuntu 16.04 Server using BTRFS as file system

I am having some difficulty installing Snapper(http://snapper.io/) on Ubuntu Server 16.04.
When I follow instructions from Snapper for Ubuntu 16.04, I am getting the below error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libsnapper
0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded.
Need to get 197 kB of archives.
After this operation, 674 kB of additional disk space will be used.
Err:1
(download.opensuse.org/repositories/filesystems:/snapper/xUbuntu_16.04 libsnapper 0.5.1 Protocol "http" not supported or disabled in libcurl
E: Failed to fetch)
(download.opensuse.org/repositories/filesystems:/snapper/xUbuntu_16.04/./amd64/libsnapper_0.5.1_amd64.deb Protocol "http" not supported or disabled in libcurl)
This seems to work fine for Ubuntu 16.04 Desktop. Can I make it work for server???
I just changed the https to http in the /etc/apt/sources.list.d/snapper.list and now it works
This is a work around as opensuse org does not support https i guess.
https://github.com/openSUSE/snapper/issues/357

PHP Coinbase API not working on live but localhost

I'm developing a system that will send BTC to a certain receiver via coinbase php api. The system is working fine in my localhost but after moving it to live it doesn't work and no error message. I tried tracing an error step by step by echoing the -3 and run the script and I found that when I put the echo after
$account = $client->getPrimaryAccount();
echo -3;
...I've got a white page and no -3 as a test result.
Here's the full construction of this process:
$apiKey = "dfdsfsd";
$apiSecret = "fdsfdsfsfdff";
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$_btc_wallet = #$_GET['_btcwallet'];
$_btc_amount = #$_GET['_btc_amount'];
$transaction = Transaction::send([
'toBitcoinAddress' => $_btc_wallet,
'bitcoinAmount' => $_btc_amount,
'description' => 'Group Fund Transfer',
]);
$account = $client->getPrimaryAccount();
echo -3;
$client->createAccountTransaction($account, $transaction);
echo 1;
exit;
Need help badly.... :-(
Tl;dr. You must install and run Composer and add this line before
the rest of your code:
require __DIR__ . '/vendor/autoload.php';
Coinbase PHP API uses Composer to handle its dependencies, so that following the install procedure detailed on Github is mandatory to avoid headaches.
Composer reads a configuration file provided by the author of the Coinbase PHP API, and creates automatically a directory structure that contains all the dependencies needed, and, most important, an autoload script.
PHP used to be 100% self contained, having a plethora of functions and classes already built in, so many PHP coders (me for example) had some problems to switch to a more modular approach, someway similar to the Python style with its pip command or to PEAR in Perl galaxy, and so on, with some important differences, of course.
So, be sure to follow this sequence:
1) Let's say you are on Linux, you have a local web server installed, and the document root of your web site is /var/www/newsite.
2) Enter the your document root, download the latest Coinbase PHP API release and untar/unzip it. I suggest to go for the releases, and not to clone the repository.
$
$ cd /var/www/newsite
$
$ tar xzvf coinbase-php-2.5.0.ta.gz
3) Now you need to download Composer. Go to its homepage at https://getcomposer.org/ and click on Download. Follow the instructions in the Command-line installation section.
I report them here for convenience, but they may change so always check the Composer's homepage. From your document root:
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$ php composer-setup.php
$ php -r "unlink('composer-setup.php');"
4) last step, run Composer and wait while he does the job:
$ php composer.phar install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 26 installs, 0 updates, 0 removals
- Installing guzzlehttp/promises (v1.3.1): Downloading (100%)
- Installing psr/http-message (1.0.1): Downloading (100%)
- Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)
- Installing guzzlehttp/guzzle (6.2.3): Downloading (100%)
- Installing psr/log (1.0.2): Downloading (100%)
- Installing symfony/yaml (v3.2.8): Downloading (100%)
- Installing sebastian/version (1.0.6): Downloading (100%)
- Installing sebastian/global-state (1.1.1): Downloading (100%)
- Installing sebastian/recursion-context (1.0.5): Downloading (100%)
- Installing sebastian/exporter (1.2.2): Downloading (100%)
- Installing sebastian/environment (1.3.8): Downloading (100%)
- Installing sebastian/diff (1.4.2): Downloading (100%)
- Installing sebastian/comparator (1.2.4): Downloading (100%)
- Installing doctrine/instantiator (1.0.5): Downloading (100%)
- Installing phpunit/php-text-template (1.2.1): Downloading (100%)
- Installing phpunit/phpunit-mock-objects (2.3.8): Downloading (100%)
- Installing phpunit/php-timer (1.0.9): Downloading (100%)
- Installing phpunit/php-file-iterator (1.4.2): Downloading (100%)
- Installing phpunit/php-token-stream (1.4.11): Downloading (100%)
- Installing phpunit/php-code-coverage (2.2.4): Downloading (100%)
- Installing webmozart/assert (1.2.0): Downloading (100%)
- Installing phpdocumentor/reflection-common (1.0): Downloading (100%)
- Installing phpdocumentor/type-resolver (0.2.1): Downloading (100%)
- Installing phpdocumentor/reflection-docblock (3.1.1): Downloading (100%)
- Installing phpspec/prophecy (v1.7.0): Downloading (100%)
- Installing phpunit/phpunit (4.8.35): Downloading (100%)
symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Writing lock file
Generating autoload files
$
5) Mind the last line above. The examples on the Github's README of the Coinbase PHP API are a little bit misleading, since Composer is nice and creates a file called autoload.php which must be used to load the new libraries the proper way.
So, here is your code modified to use it, thus loading all the needed dependencies:
<?php
require __DIR__ . '/vendor/autoload.php';
$apiKey = 'topsecret';
$apiSecret = 'topkey';
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$account = $client->getPrimaryAccount();
The line:
require __DIR__ . '/vendor/autoload.php';
should make the difference. Without it, the script exits with no errors on screen, but with many errors in the php log file, but this behaviour depends on the server configuration.
Hope this helps!

"Wkhtmltopdf didn't return any data" with CakePHP

I am running a CakePHP 2.8 environment and want to print a PDF with wkhtmltopdf. Once, I could create an PDF, then, I didn't used it for few weeks because I was working on something else. Today I restarted to work on that and got the error Message:
"WKHTMLTOPDF didn't return any data"
APP/Plugin/CakePdf/Pdf/CakePdf.php line 236 → WkHtmlToPdfEngine->output()
APP/Plugin/CakePdf/View/PdfView.php line 97 → CakePdf->output(string)
CORE/Cake/Controller/Controller.php line 963 → PdfView->render(null, null)
CORE/Cake/Routing/Dispatcher.php line 200 → Controller->render()
CORE/Cake/Routing/Dispatcher.php line 167 → Dispatcher->_invoke(InvoicesController, CakeRequest)
APP/webroot/index.php line 109 → Dispatcher->dispatch(CakeRequest, CakeResponse)
My machine is a MacBook Pro with El Capitan. Furthermore, I thought that it might be the El Capitan Update, but then I installed wkhtmltopdf to an equal system with CakePHP 2.8 and it is running on this machine. Unfortunately, I have no idea what I can do. I reinstalled wkhtml and updated CakePHP again, but no chance :-(
Can anyone help me?
Finally, I did it.
I first deleted all wkhtmltopdf /img files on usr/local/bin and then changed the wkthmltopdf from 64bit to 32bit. Although I have a 64bit system, it is working with the 32bit but not the 64bit. Don't ask me why it is working, but it works for me!
Same error, different cause in my case.
I found out, that problem was QT patch. Then wkhtmltopdf lacks some features and it is stated at bottom of wkhtmltopdf help
Reduced Functionality:
This version of wkhtmltopdf has been compiled against a version of QT without
the wkhtmltopdf patches. Therefore some features are missing, if you need
these features please use the static version.
Currently the list of features only supported with patch QT includes:
* Printing more than one HTML document into a PDF file.
* Running without an X11 server.
* Adding a document outline to the PDF file.
* Adding headers and footers to the PDF file.
* Generating a table of contents.
* Adding links in the generated PDF file.
* Printing using the screen media-type.
* Disabling the smart shrink feature of WebKit.
Solution is to use patched version:
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin/
ln -nfs /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
Source: https://gist.github.com/yajra/80ae402e2084191cd1f6e17fa581320e

Resources