Skip to main content

Resolving "The procedure entry point ... library vulkan-1.dll" error when launching Hyper Scape

Hi. As the title says, I resolved the following error. What I tried There were two. When you try these, you will need to take full responsibility for your action. Backup is important. The first one is a GPU driver update. Valkan will be installed along with the driver update, so I tried this method first. However, changing the driver sometimes causes instability, so I recommend checking the current version from the device manager. The second one is installing the latest version of Valkan Runtime. I referred to this nice Japanese article. https://emulog.net/ps3-emulator-rpcs3-cant-run-missing-vulkan-1-dll/ In my environment, the problem was resolved.  However, my GPU was too old to play :(  I hope these information helps you. Bye.

Easy programming at home - Part 2 Let's use R

Hi. Good morning / afternoon / evening. I’m ponpokorin.

In this Part 2, I will write about lesson after installing R. If you haven't installed R, please refer to Part 1 "Let's install R"Part 1 is here

It's hard to remember programming's technical terms just by looking at them, so let's use them more and more!

So, this article's content will be like this.
  • Try to open and close R (additional administrator settings)
  • Let's do four arithmetic operations
  • Let's create vectors
  • Introducing useful commands
  • Console and editor
  • Bonus: Let's customize R
There are a lot of contents, but I will write it as easily as possible!


Try to open and close R (additional administrator settings)

First, if you have successfully installed R, you will see this icon on your desktop.

This is official logo. By Hadley Wickham and others at RStudio - https://www.r-project.org/logo/, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=35599651

If you double-click the icon on the desktop, R will start, but let's make some settings before starting it.

Place the cursor on the icon and right-click to display the "Properties" item. Left-click on "Properties". When you go to the "Compatibility" tab, there is a box of "Run this program as an administrator" in the "Settings" column, check it, and left-click "Apply" in the lower right.


My environment is Japanese

By making this setting, errors are less likely to occur. If you want to know more, try searching for "run as administrator programming R".

By the way, if you try to start R after setting, you will see this screen.

This is japanese ver. too

To start R, please select "Yes."
You may be asked for an administrator password, but it's OK, you can enter your password. Not dangerous.

Next, I think that the screen looks like this,


At first, I want you to see how to close. Click on the upper right "X" button and you should see this pop-up.


Basically, select "No" here. If you make a mistake and answer "Yes", search with "R workspace save data delete" etc. and do as written.


Let's do four arithmetic operations

Now the setup has been completed, let's write the commands!

After starting R, let's do the calculations as the most traditional way to use a computer. Type the following commands into the window labeled "R Console."

3+2
3-2
3*2
3/2

You sure got the results, right? Then what about "3 // 2"? Let's type.

I think there was an error. If you enter the wrong command like this, you will get an error, but please be assured that this will not damage your PC. Even if you get such an error, you only try again, so you don't have to worry if you get an error. If you make a mistake, investigate the cause yourself and make sure it works. I think that such experience is the most powerful.

Next, the computer can calculate more troublesome calculations in an instant. Let's type the following formula in your “R Console.”

1985+10/2*6+3+4/2

Your computer gives priority to multiplication and division according to the rules of mathematics. However, this(↓) will change the result a little.

(1985+10)/2*6+3+4/2

It is no longer “2020”. This is because the calculation in () has priority. This is also according to the rules of mathematics. As you can see, basically, if you write a mathematical formula according to the rules of mathematics, it will calculate correctly.

In addition, you can calculate such as "45 ÷ 10 = 4, remainder of 5", exponentiation, square root, etc. Let's type the following commands into R console.

45%/%10
45%%10
2^3
sqrt(16)

Take a break here. After drinking a cup of coffee, let's deal with vectors.

Let's create vectors

When you hear "creating a vector," you may find it difficult, but it's easy. If we extend vector we can handle matrix, but for now, it's OK if you just think of vector as a line of numbers. Let's make it.

Vectors are created like this.

 c(1, 4, 2, 1, 5)

There is no need to leave a space between each comma and the number, but I put space because I thought it would be easier to see. Basically, spaces are ignored in programming.

You can do the following with vectors. Please copy & paste the command below as it is.

a <- c(1,4,2,1,5)
a
summary(a)
mean(a)
sum(a)

Of course…

mean(a) == sum(a)/length(a)

Did you get TRUE? OK. I will explain the commands used here.

First, "<-" mean Assignment. As we saw above, if you type "a <- c (1,4,2,1,5)", then the computer remembers that "a is the vector of (1,4,2,1,5)."

Next, "summary" tells you minimum value (Min.), first quartile (1at Qu.), median (Median), average (Mean), third quartile (3rd Qu.), and maximum value (Max.).

Also, you can know the average only by using "mean", and you can get the sum by using "sum" .

And about the last line. As you know, the average value is the sum divided by the total number. Considering that, "length" is a command that gives the number of elements in a vector. In this way, "mean (a)" and "sum (a) / length (a)" are the same meaning. If you enter "mean (a) == sum (a) / length (a)", the computer will judge if "mean (a)" and "sum (a) / length (a)" are the same. In this case, it was the same, so the computer returned TRUE.

So, if you enter following command...

mean(a)+1 == sum(a)/length(a)

the computer returned FALSE.

In addition, let's create a vector b. Try the following command on R Console.

b <- c(2,2,2,2)
a
b
a+b
a*b

In this way, in R, arithmetic operations between vectors are easy.

As described above, using a vector allows you to see the characteristics of multiple numerical values, calculate the values of summary, and perform multiple calculations at once. The match judgment by "==" can be done other than vector.

Introducing useful commands

You may be a little tired, so here are some simple and useful commands. Please look lightly while taking a break.

Earlier, we set "b <- c(2,2,2,2)", but the same vector can be created by "b <- rep(2,4)". This "rep" is the rep of repeat.

If you want to create "c (1,2,3,4,5)", you can just write "seq (1,5)". This "seq" is probably the seq of the sequence. "seq" can also be used like "seq (1,5,2)". In this case, this command create "c(1,3,5)".

There are many other commands, so check them out when you have time.
(If you understand Japanese, there is a site called "R-Source", which I have been using all the time since I was a beginner.)

After the break, let's learn about the editor finally.

Console and editor

The place where we wrote the command is "R Console", which was lightly mentioned at first. In any programming language, you write commands to the console and press Enter, and the computer responds.

On the other hand, there is an editor. Return to R, left-click on the "Files" tab at the top left, and left-click on "New Script". You can make something like this.

No problem even if the color is different

Write your favorite commands here. If you press the↑ key on the console, the command you typed before will appear, so please use that as well.

For example


Do you know the difference from the console? Yes, the computer does not respond to what is written in the editor. Roughly speaking, it's just like a notepad. To make the computer run the command written in the editor, there are these two methods.

  • Copy and paste to console
  • Select the command you want to run (you can select all by to press and hold the Ctrl key and press the A key, this is written as Ctrl + A) and press Ctrl + R

The role of the editor is to write commands together and save them in an easy-to-understand appearance. If you write to the console every time, the results are mixed with commands and errors, that make it difficult to see the commands with a well-organized appearance. On the other hand, it is easy to understand if you write them all in an editor.

Here is also a useful feature called "comment out". First, see the screenshot below.


You can use # to add a comment like this. From # to the next Enter is ignored at the time of running, so if you select all with Ctrl + A with comment and run with Ctrl + R, the processing will not change at all.

If you want to add a multi-line comment, do something like this (some other programming languages can easily make multi-line comments) In addition, you can put a comment to the right of the command.


After that, while using these, you will write a program in the following flow.

Record only the necessary commands in the editor,
Sometimes run these commands in the console and check errors.

Finally, save and load. As with games, frequent saves are important. Sometimes, if you forcibly terminate R due to a bug, unsaved commands will be lost. It's very sad if you take long time to write these commands. So, try to save frequently.

With the editor selected, left-click on "File" in the upper left corner and there is "Save", so please save it to your favorite place. My recommendation is to create a folder with a clear name in advance and save it there.

Sometimes you get this kind of error. (You might also get an error like "Could not save" on the console.)


In this case, press "OK", then copy everything written in the editor, and paste it into a notepad application.

After making a backup, close it with "X" button in the upper right corner (when asked "Save?", select "No"), Open the script again (this is what you wrote in the editor), and paste from backup, and then save again.

This is the end of the Part 2. Have you enjoyed it?

If you find this article useful or interesting, please share it on social media!

Thank you for your reading! See you again!

Part 3 is here

Bonus: Let's customize R

In R, you can change the font size, font and background color to your liking.

procedure:
Edit tab > GUI preferences

Edit with this Rgui settings editor. First, press Save... at the bottom left, and save the file name as “Rconsole (default)” or “Rconsole (vanilla)” so that you can return to the initial state.

After that, choose your favorite settings from the Rgui settings editor and Save... again. At this time, if you set the file name to "Rconsole" (perhaps overwriting), the next time you start up R, your favorite settings will be loaded from the beginning automatically.

I do like this. For your reference.

In the lower left, "background" is the console background color and "editorbg" is the editor background color



Comments

Popular posts from this blog

Japanese education system and problems of university and employment system

Hi, Good morning / afternoon / evening. I’m ponpokorin ( @ponpokorin_24 ). In this article, I will briefly explain the Japanese education system, then explain the internals of Japanese universities and the connection between universities and occupations. I am currently attending a university in Japan, so I can write more realistically. I would like to know about the state around Japanese universities. Table of contents Japanese education system Current state of Japanese universities Japanese employment system Afterword Japanese education system First, I would like to see the flow from kindergarten to university and 専門学校. Until children enter elementary school, each family can take a different choice, but after entering elementary school, children will generally go to elementary school, junior high school, and high school in six, three, and three years. Please see the image below for a rough overview. Reference: Ministry of education, culture, sport, science, and tec

Resolving "The procedure entry point ... library vulkan-1.dll" error when launching Hyper Scape

Hi. As the title says, I resolved the following error. What I tried There were two. When you try these, you will need to take full responsibility for your action. Backup is important. The first one is a GPU driver update. Valkan will be installed along with the driver update, so I tried this method first. However, changing the driver sometimes causes instability, so I recommend checking the current version from the device manager. The second one is installing the latest version of Valkan Runtime. I referred to this nice Japanese article. https://emulog.net/ps3-emulator-rpcs3-cant-run-missing-vulkan-1-dll/ In my environment, the problem was resolved.  However, my GPU was too old to play :(  I hope these information helps you. Bye.

Molting and Secondary growth of Apple tree

Hi. There are various discoveries when you grow plants by yourself. Today I took a picture of the molting (maybe there is a formal name...) of the new shoot of an apple tree in the second year of seedlings. The above picture is hard to look the "molting", so I expanded. If you look closely, you'll find a skin that is transparent and can be peeled off easily. When I first raised an apple tree, I thought it was an illness, but it is growing without dying. So now, I'm thinking it's one of the physiological phenomena. By the way, "Secondary growth" is another phenomenon. The trunk becomes thicker with vertical cracks as shown in the image below. At the beginning, I was worried about various things. For example, I thought my apple tree got sick by seeing the white hair (trichome) of the buds (I didn't know the buds has it). But after a year, I get used to raising apple trees. In how many years will apple trees grown from seeds bear fruit? I can't wait