armor – Which damage types are the most and least common?

(Inspired by this question)

The only mechanical difference (beside price) between Hide and Scale mail is that once you can use the pecialization, the one provides resistance against piercing, the other bludgeoning.

So which is more common, monsters with piercing, bludgeoning or slashing damage?

Why is the common explanation to the halting problem an oversimplification?

So watching many youtube channels, the explanation to the impossibility of solving the halting problen involves assuming you can, doing the opposite, and feeding it back into itself to create a paradox.

What I don’t get is why this is an (over)simplification. The logic seems to check out. What is the flaw in this reasoning?

Most Common Aspect Ratio? – Photography Stack Exchange

The two most common aspect ratios are 4:3 and 3:2. You will also see a significant number of 1:1 (square) photos and 16:9 (“widescreen”) images.

3:2 is the aspect ratio of 35mm film cameras, and that has carried over to most DSLRs, both the APS-C size and “full-frame”. Most compact digital cameras, along with the Micro Four Thirds interchangeable-lens mirrorless system, use 4:3.

Most smartphones are also normally 4:3, but popular apps like Instagram produce square 1:1 images, so you can’t discount that. And, the HDTV-like 16:9 aspect ratio is a common option in many cameras of all types (usually but not always just by cropping off the top and bottom of each image in-camera).

It would probably also be wise to consider the possibility of arbitrarily-wide panoramic images, as many cameras (both via apps and just as a feature) have the ability to produce those very easily. And, of course, you really shouldn’t discount cropping, both to historically-standard ratios like 8:10 and 5:7, and completely arbitrarily.

And keep in mind that you will also see these turned the other way: 3:4 and 2:3 for portraits; 9:16 looks odd and is less likely, but the theme here really is that anything goes.

This is all off of the top of my head, but if you’d like the referenced and researched background on these aspect ratios and other common ones found in photography, see my answer to What historic reasons are there for common aspect ratios?

count pairs of matching integers in a collection in Common Lisp

This defines count-pairs which

  • takes a collection of integers
  • returns the number of pairs of integers that are equal to each other.

If the input collection has these integers …

1 2 2 1 1

… then count-pairs returns 2 because

  1. one pair can be made with the 1’s
  2. a second pair can be made with the 2’s
  3. The leftover 1 does not affect the answer.
(defun make-pair (table i)
  (setf
   ;; increment pair count:
   (gethash 'pairs table) (1+ (gethash 'pairs table 0))
   ;; make first half of the new pair unavailable:
   (gethash i table) nil)
  table)

(defun keep-first-half-of-pair (table i)
  (setf (gethash i table) t)
  table)

(defun first-half-available-p (table i)
  (gethash i table))

(defun consider-one (table i)
  (if (first-half-available-p table i)
      (make-pair table i)
      (keep-first-half-of-pair table i)))

(defun count-pairs (integers)
  (let ((table (reduce #'consider-one
                       integers
                       :initial-value
                       (make-hash-table))))
    (gethash 'pairs table 0)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; boilerplate for running as a hacker rank submission
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(read-line) ;; we don't need n

(defvar integers
  (read-from-string
   (concatenate 'string
                "(" (read-line) ")")))

(format t "~a~%" (count-pairs integers))

Some questions I have:

  1. What changes would make this more idiomatic?
  2. Is there an alternative for setf that returns the modified container instead of the multiple values returned by the storing form for the last altered place? (See how I really want the container as the result of make-pair and keep-first-half-available-p …)
  3. Should I stick with the -p naming convention for predicates? It seems ending with a ? is possible and looks more readable to me.
  4. I guess Emacs knows if is a macro and is indenting it that way?
  5. If there is an entirely different and better way to solve in Common Lisp, please do let me know.

Thanks in advance!

5 Common Uses for a LowEndBox (Cheap VPS)

This article was contributed by Dustin B. Cisneros from RackNerd, a seasoned contributor of the hosting industry for 12+ years. Consider checking out all of the KVM offers recently posted on LwoEndBox!

In 2020, what are some 5 common uses for a LowEndBox? LowEndBox recently ran a poll and in this tutorial, we’ll be going more in depth into most common use cases for a LowEndBox. Are you looking for ideas on what to purpose your VPS for? Looking to get started on a new project during these quarantined times? Read on…

  • Web / Application Hosting

Do you find yourself outgrowing shared hosting? Or perhaps you are desiring more control over your environment, such as the ability to control your own php.ini limits, apache modules, and more? This is a top reason why many choose to host a website or application based upon a Virtual Private Server (VPS) instead of shared hosting. More control and resources as VPS’s come with full root access.

Need a VPN/proxy to use from school/college, or from work? Or perhaps you live in a different country and need to access the Internet from a different IP address location? Setting up your VPS as a VPN/proxy can be a fun project – using free software such as OpenVPN and Socks5.

Want to enhance your skills in Linux? Want to try out a different Linux operating system and expand your knowledge? A VPS is the perfect way to learn about systems administration – thanks to the ability to easily reinstall the VPS on the fly. For VPS hosting services who utilize the SolusVM VPS Control Panel, you can easily reinstall your VPS on the fly within SolusVM. All it takes is a few clicks, and a few minutes, and you’re up and running on your new OS – all without having to worry about reinstalling the OS manually!

Need to store large amounts of data remotely, or a secure place to back up your websites? A VPS is a great way to do it! Because every VPS offer featured on LowEndBox includes full root access, you can set it up to your liking. Some people prefer to set up FTP servers, while others prefer using rsync/SCP methods.

Looking to set up a game server to host for your friends/community? A VPS is a great way to do it, and the beauty about it is, there’s no shortage of tutorials on the Internet on how to set up a game server. Choosing to host your VPS with a DDoS protected provider can give you extra peace of mind, in the world of gameserver hosting.

What do you use your VPS for? We would love to hear, discuss your thoughts below!

Jon Biloh

I’m Jon Biloh and I own LowEndBox and LowEndTalk. I’ve spent my nearly 20 year career in IT building companies and now I’m excited to focus on building and enhancing the community at LowEndBox and LowEndTalk.

Should "Teachers" and "Students" be kept in a common "Person" table?

I’ve already read these posts:

Storing whether a user is a student or teacher? Is a lookup table necessary?

Creating a database for a scenario involving students, teachers and courses

In a school database, do I need to have repeating data when a student can also be a teacher?

All of them were close, but none are exactly what I want. A few points:

  • This app will be used by Grade School teachers.
  • A student will never be a teacher, and a teacher will never be a student.
  • In addition to Students and Teachers, there will also be contact info for Admins who are neither students nor teachers.
  • Teachers will always be Users. Admins may or may not be users. (We may store an Admin’s name and contact info, but that admin may never have a reason or need to log into the app.)

My thought is to create a "Person" table:

  • PersonId
  • FirstName
  • LastName
  • Email (NULL if student)
  • PersonType (Enum: 1 = Admin/Teacher, 2 = Student)
  • Other Columns as needed

And another table "Passwords":

  • PasswordId
  • PersonId
  • PasswordHash
  • Other Columns as needed

If a Person is also a user, they will have a value for ‘Email’ and also a record in the Password table.

Am I on the right track?

custom field – How to display Common posts from specific Tag & Category with Shortcode

How to display posts that are common in Category A and Tag A, and I want to display posts by shortcode so that the Shortcode can be used on multiple locations with different category Ids and Tags.

I found the below code by google but don’t know how to implement it in functions.php and not sure how to use it in the shortcode. I want to display Post Title, And Some Custom Field Value (For Example – Value A, Value B) in a table structure.

        $args = array(
        'category__and' => 'category', //must use category id for this field
        'tag__in' => 'post_tag', //must use tag id for this field
        'posts_per_page' => -1); //get all posts
        $posts = get_posts($args);
        foreach ($posts as $post) :
       //do stuff 
        endforeach;```

type systems – Using ftype to Declare Functions in Common Lisp

The Common Lisp Cookbook discusses how to use ftype to declare the inputs and outputs of functions. In compilers with a lot of type inferencing like SBCL, this would seem to offer a lot of support during development at both compile time and run time for error checking and generating efficient compiled code. (The extent of run time checks seem easily adjusted by changing compiler policy.)

However, much of the professional code I’ve looked at doesn’t use such declarations. For example, Edi Weitz’s popular cl-ppcre doesn’t (although he does declaim the types of parameters). Special efficiency considerations obviously call for declarations in hot spots, but wouldn’t program-wide ftype declamations also be a significant help during development? Or is this overkill?

licensing – Can I use a creative common licensed CC BY 4.0 model in a commercial indie game?

I am not a lawyer and this is not legal advice. What we can help you with here are the game parts of making a game. For aspects relating to law, you should always consult a lawyer.

What I’ll do here is simply read to you the text of the page you’ve already linked, which contains every piece of information you need.

Share — copy and redistribute the material in any medium or format

“Indie game” is included in “any medium or format”

Adapt — remix, transform, and build upon the material for any purpose, even commercially.

Building a game that includes this asset is “building upon the material,” and “any purpose, even commercially” means you have permission to sell the result.

Attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

So you can’t put a licence on your game that forbids players from using the keyboard model in their own projects. (You probably weren’t going to anyway)

There are tooltips on the page that clarify how to give appropriate credit:

If supplied, you must provide the name of the creator and attribution parties, a copyright notice, a disclaimer notice, and a link to the material.

Here, you have the name of the creator, Oscar Herry, and a link to the material, so you would be expected to make those available alongside your work that builds on this asset – like in the credits screen of your game. This would also be the place to mention whether you modified the asset, like changing the material or textures to work with your game’s style.

quadratics – Faster method to find one common root.

If both the roots of $ k(6x^2 +3)+rx+2x^2 −1=0$ and $6k(2x^2 +1)+px+4x^2 −2=0 are common, then ,
Q1 Find 2r-p equals.

Q2 Find that common root

The method which I solved is
$(c1a2-a1c2)^2$ = (b1c2 – c1b2)(a1b2-a2b1).

But it is very lengthy and it is not something you can remember during the exam.Is there any other short method to solve this question?