Transpose a data frame

You’d better not transpose the data.frame while the name column is in it – all numeric values will then be turned into strings! Here’s a solution that keeps numbers as numbers:

Categories r

How to install Java 8 on Mac

Oracle has a poor record for making it easy to install and configure Java, but using Homebrew, the latest OpenJDK (Java 14) can be installed with: For the many use cases depending on an older version (commonly Java 8), the AdoptOpenJDK project makes it possible with an extra step. Existing users of Homebrew may encounter Error: Cask adoptopenjdk8 exists … Read more

WSL – GEDIT Unable to init server: Could not connect: Connection refused

You need an X server to run graphical applications like gedit. I use VcXsrv or Xming on my Windows desktops, both are very small and easy to install, but there exist other servers like Cygwin/X. Short instructions for VcXsrv/Xming: download and install the Windows package start XLaunch or Xming export the DISPLAY variable in your WSL terminal and start geditexport DISPLAY=0:0 … Read more

What is callq instruction?

It’s just call. Use Intel-syntax disassembly if you want to be able to look up instructions in the Intel/AMD manuals. The q operand-size suffix does technically apply (it pushes a 64-bit return address and treats RIP as a 64-bit register), but there’s no way to override it with instruction prefixes. i.e. calll and callw aren’t encodeable in 64-bit mode, so it’s just … Read more

catDog string problem at Codingbat.com

While you are pretty close to a solution, there are a few critical problems in your code: Your call to substring() fetches a string of size 2. That string can never be cat nor dog. Change the second parameter in the method call to i + 3 to get 3 characters. Your call to substring() will throw an IndexOutOfRangeException, as i approaches the end of the length of the input string. Make … Read more