原创 Flutter報錯The argument type 'Future< String>' can't be assigned to the parameter type 'String'.

返回值的類型錯誤,解決辦法主要有兩種,第一種使用async和await,第二種時直接使用futures, 第一種示例 Future<Void> printDailyNewsDigest() async { String new

原创 Base64 編碼【代碼實現】

C #include <stdio.h> #include <stdlib.h> #include <resolv.h> #include <fcntl.h> #include <unistd.h> #include <sys/t

原创 Base64 解碼【代碼實現】

C++ #include <algorithm> #include <iostream> #include <string> #include <vector> typedef unsigned char ubyte; con

原创 排序算法——圓形排序(Circle Sort)【代碼實現】

僞代碼 function circlesort (index lo, index hi, swaps) { if lo == hi return (swaps) high := hi low := lo

原创 0-1揹包【代碼實現】

C #include <stdio.h> #include <stdlib.h> typedef struct { char *name; int weight; int value; } item_t

原创 排序算法——雞尾酒排序(Cocktail sort)【代碼實現】

僞代碼 function cocktailSort( A : list of sortable items ) do swapped := false for each i in 0 to length( A ) -

原创 排序算法——堆排序【代碼實現】

僞代碼 function heapSort(a, count) is input: an unordered array a of length count (first place a in max-heap o

原创 排序算法——煎餅排序(Pancake sort)【代碼實現】

C int pancake_sort(int *list, unsigned int length) { //If it's less than 2 long, just return it as sorting isn'

原创 N皇后問題【代碼實現】

C #include <stdio.h> #include <stdlib.h> int count = 0; void solve(int n, int col, int *hist){ if (col == n) {

原创 排序算法——基數排序(Radix sort)【代碼實現】

C #include <stdio.h> #include <limits.h> #include <stdlib.h> #include <time.h> // Get size of statically allocate

原创 平衡二叉樹【代碼實現】

C { struct node *n = calloc(1, sizeof *n); *n = (struct node) { value, 1, {nnil, nnil} }; return n; } int max

原创 布朗樹(Brownian tree)【代碼實現】

C #include <string.h> #include <stdlib.h> #include <time.h> #include <math.h> #include <FreeImage.h> #define NUM_

原创 排序算法——全排序(Permutation sort)【代碼實現】

ActionScript //recursively builds the permutations of permutable, appended to front, and returns the first sorted p

原创 查找算法——二分查找【代碼實現】

僞代碼 遞歸 // initially called with low = 0, high = N-1 BinarySearch(A[0..N-1], value, low, high) { // invar

原创 報錯Duplicate classes in commons-collections and commons-beanutils

錯誤信息簡述: 引入依賴’net.sf.json-lib:json-lib:2.4:jdk15後報錯。 org.apache.commons.collections.ArrayStack org.apache.commons.co