web practice -- card drawing simulator (1)

There are so many card pullers playing. I have come to write a card puller simulator. There are six card classes: s s s, ss, s, a, b, c. the probability of sss is 0.01%, ss probability is 0.1%, s probability is 1%, a probability is 15%, b probability is 30%, and the rest is c. in order to avoid staying in Africa for a long time ...

Posted by rahish on Sat, 28 Dec 2019 16:06:14 +0100

Simple blockchain demo implemented by golang

The principle will not be introduced. You can see another one of mine Deeply understand the operation principle of blockchain through an App Demo demonstration The code is only the simplest. It simply implements the definition of a block and the connection between blocks. There is no p2p, incentive or consensus. Important da ...

Posted by Blekk on Tue, 24 Dec 2019 20:10:09 +0100

Create and publish a tomato clock from scratch

1. Make your own tomato clock On a PC I've been using "Little Tomato" as my tomato clock software, and I turn it on and maximize it on my secondary monitor so that not only does it do its part, but I can also tell my colleague that I'm working hard.But I always wanted to write a tomato clock software by myself. It was so itchy that I ...

Posted by neogemima on Sat, 21 Dec 2019 20:06:22 +0100

How do I use Assert to verify that an exception was thrown?

How to use Assert (or other Test classes?) To verify that an exception was thrown? #1st floor Well, I can almost sum up what everyone else said before... Anyway, here is the code I built based on the good answer:) the rest is to copy and use /// <summary> /// Checks to make sure that the input delegate throws a exception of type T ...

Posted by DefunctExodus on Fri, 20 Dec 2019 09:48:10 +0100

Django Rest Framework serialization component

drf serialization component Basic use urls.py from django.urls import re_path urlpatterns = [ re_path(r'books/$', views.BookView.as_view()), re_path(r'books/(?P<pk>\d+)/$', views.BookFilterView.as_view()), ] serialization class from rest_framework import serializers class BookSerializer(serializers.Serializer): title = seri ...

Posted by robcrozier on Fri, 13 Dec 2019 17:54:49 +0100

Delegations that Neter should know thoroughly

This article will lead to several questions, and through examples to analyze the delegation and usage in C#as a starting point For delegation I find that most people have the following questions, or may have encountered such questions in an interview: Is a delegate equivalent to a C/C++ function pointer? What exactly is a delegation? What exac ...

Posted by quiettech on Wed, 11 Dec 2019 01:01:13 +0100

Stack and queue of C + + Learning (C language part)

data structure1. Save data 2. Process dataArray + operationCensored deletion Stack and queueIt is a linear table with limited operation Stack is the operation of inserting and deleting at one end -- > the other end of the stack is called the stack bottom (stack and stack area are two concepts) (it is a data structure)The queue is first in, ...

Posted by mckooter on Mon, 09 Dec 2019 08:56:01 +0100

Spring cloud learning - Eureka registry

[TOC] 1.1 what is Eureka When developing large-scale projects, service providers and service callers will be very large, and the cost of managing services will increase exponentially. Eureka will be responsible for service registration, discovery and status monitoring. 1. Registration: Eureka is responsible for managing and recording the inform ...

Posted by whmeeske on Sat, 07 Dec 2019 19:49:11 +0100

jQuery - (similar to lottery Carousel) highlighted

The effect is as follows: The original picture starts to change after the mouse enters                                                                                Implementation requirements: Page loading starts, and the effect is as shown in the original figure. After the mouse enters the box, the picture will be highlighted at the current ...

Posted by sangamon on Sat, 07 Dec 2019 03:38:57 +0100

Suddenly want to see the thread pool

1 why to apply thread pool    first of all, we know that thread is a precious resource for the operating system. For example, if we create it manually every time we use it, the thread will shut down automatically after executing the run() method, and we have to create it manually the next time we use it. This is a waste of time and re ...

Posted by Daleeburg on Wed, 04 Dec 2019 19:58:28 +0100