Translate

Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, March 4, 2021

Using Real VNC server on Elementary OS

To setup Real VNC sever on Elementary OS the corresponding .deb file must be downloaded from their website and installed.

Make a Real VNC account and activate the 'Home' subscription, which is free. This will give you over the cloud access to the server from a Real VNC client.

Run sudo vnclicensewiz. This command prompts window were you must log into your Real VNC account.

Running systemctl start vncserver-x11-serviced.service , will start the VNC server and will pop a window on which the vnc server can be configured. Such settings can be accesed if the previous command is used with sudo. There will also be a promt to set a password for access to the server.

Moreover, to make the server start on boot run sudo systemctl enable --now vncserver-x11-serviced in the terminal.

Thursday, April 9, 2020

Free Books, Courtesy of Springer

Springer, has announced some days ago, that they are making available plenty of their books (aimed at higher education) for free during the coronavirus pandemic. "These books will be available via SpringerLink until at least the end of July." Take a look at the announcement and at the list of the texts available in english and german.

If you are going to download some of them, I encourage you to obtain them as .epub, since it is more space efficient than pdf.

Disclaimer: the source of the books is completely legal, given away by the publisher itself.

Wednesday, February 19, 2020

Primer on the R Language

Disclaimer: This material is based on my notes during an R course. It also includes content I consider important for starting. The original material may be found in a GITLAB repository.

Introducction and Basic Interface Commands

Clean a session of R: Ctrl + L
Save a script,in Mac OS Command+S; Linux/Windows Ctrl+S
A command may be interrupted using Esc o Ctrl+C You may want to interrupt a command when there is a loop that just won’t finish
Define the workspace (In RStudio you can also use Session > Set Working Directory > Choose directory)
setwd("PATH")
#Insert the path of your workspace
To run a selected line: In Mac, Command+Enter. In Linux or Windows Ctrl+Enter.

Using R for arithmetical calculations

1+100
## [1] 101
The order of arithmetical operations is respected
(3+(5*(2^2)))
## [1] 23
3 + 5 * 2^2
## [1] 23
1/100000
## [1] 1e-05
Exponential notation may be used
3e2
## [1] 300
3e-2
## [1] 0.03

Trigonometrical functions

Trigonometrical functions are incorporated
•          cos(x)
•          sin(x)
•          tan(x)
•          acos(x)
•          asin(x)
•          atan(x)
For default you must use radians
sin(pi/2)
## [1] 1

Logarithms

The function log() is a natural logarithm Be noticed that the number e, is written as exp(1) in the R language
log(exp(1))
## [1] 1
For a logarithm of base ’n’, use logn()
log2(2)
## [1] 1

Rational Operators

•          ‘>’ More than
•          ‘<’ Less than
•          ‘<=’ Less or equal than
•          ‘>=’ More or equal than
•          ‘==’ Equal
•          ‘!=’ Different
4 != 4
## [1] FALSE

Logical Operators

•          ‘!’ Logical negation
•          ‘&’ Logical conjunction by element
•          ‘&&’ Logical conjunction
•          ‘||’ Logical disjunction

Variable Assignation

Use the operator ‘<- o:p="">
x <- span=""> 9 #Assigning 9 to the value of x
x #Check the value of x
## [1] 9
x <- span="">1/3
y <-x span="">+1

Basic rules for variable assignation

a.        They can’t start with numbers or ’_’
b.        There should not be blank spaces within the name

Vectorization

1:10 #Create a vector with all whole numbers from 1 up to 10
##  [1]  1  2  3  4  5  6  7  8  9 10
1+1:10 #Sum 1 to each member of the vector
##  [1]  2  3  4  5  6  7  8  9 10 11
var<- span="">1:10
var
*2 #Multiply by 2 every member of the vector
##  [1]  2  4  6  8 10 12 14 16 18 20
Consult the variables created
ls()
Delete elements
rm()
Example:
t=1
rm(t)

Administrating packages

Check for installed packages
installed.packages()
Install package
install.packages()
Update packages
update.packages()
Delete package
remove.packages()
Download package
install.packages()
”Activate” a package
library()
Search for help in R
-->
help()

Tuesday, February 11, 2020

After Attending a Wolfram U Webinar (Hands-on Start to Wolfram Mathematica)

Webinars are scheduled online events aimed at having a seminar-like experience over the web. I recently took the Hands-on Start to Wolfram Mathematica training tutorial. The event lasted for about one hour and forty-five minutes; but it could last up to two hours.

The webinar had about 3 breaks, giving time to ask written questions, that the team behind the seminar would answer. In these forum-like chat you are allowed to post questions regarding the presentation, and in this one in particular, you could ask for any short explanations on Mathematica's functions and capabilities.

As stated on the tutorial's title, the lesson is "hands on [the software]", therefore, if you don't have a Wolfram Mathematica license, you will be handed and email with a link to redeem a 15 day license.

During the lesson, the instructor writes a Mathematica notebook, which can be copied step by step by the attendants however not everyone is able to type in as fast. That being so, they offer you a copy of the final notebook of the lesson if you have bought the book with the same title. If you haven't by then, you can still ask for them to hand it over. As a result, you will receive an email stating that you must register your book in order to verify your purchase. Are you still worried you may have forgotten something else? Don't worry, as soon as they publish a video of the lesson, you'll be given through your mailbox a link to see it.

Hands-on Start to Wolfram Mathematica tutorial is a nice way to start with Mathematica and the Wolfram Language, you can also purchase the book to get a deeper and further stated introduction. The seminar basically comprises the first few chapters of the book.

My recommendations
Set up your computer with a second screen, specially if you are on a laptop (receiving the lecture on a 11 inch screen was uncomfortable). The ideal setup is to have the webinar in one screen and Mathematica on the other one. You will deal with multiple Mathematica windows, so a proper space for them would boost your performance.