What’s the difference between methods for defining a matrix function ( Jordan canonical form, Hermite interpolation and Cauchy integral)?

There’s many equivalent way of defining $ f(A)$ . We focus on Jordan canonical form, Hermite interpolation and Cauchy integral.

What’s the difference between methods for defining a matrix function ( in application )? What is superiority to each other? Can you introduce a source?Thanks

Nested loop in lisp to process a 2d array – what’s good style (with and/or without loop macro)?

Code below is answer to an exercise in Paul Graham’s ANSI Common Lisp (ex. 4.1). The challenge is to rotate an array by 90 degrees. I found an example solution which I’ve commented below.

It seems ok’ish and I’m enjoying learning how to use do, but in this particular case it seems actually more verbose than the familir c-style nested for loops to process a 2d array. I’m wondering if the below is good style or if it can be improved upon?

Is the answer going to be the loop macro? I’m avoiding that at the moment while learning, waiting till I have better mastery of the basics. Yet would like to not pick up bad habits. Hence this question about style regarding the below.

(defun quarter-turn (arr)   (let* ((dim (array-dimensions arr))  ; let* sets sequentially, not in parallel.          (row (first dim))          (col (second dim))          (n row)  ; initialise n to row, just to organise          new-arr) ; shorthand for (new-arr nil)     (cond ((not (= row col))            (format t "The arg is not a square array.~%"))           (t (setf new-arr (make-array dim :initial-element nil))              (do ((i 0 (+ i 1)))  ; Q. surprisingly, lisp's 'do' here looks more                  ((= i n))        ; verbose than c-style 'for'. Is this good style?                  (do ((j 0 (+ j 1)))                      ((= j n))                      (setf (aref new-arr j i) (aref arr (- n i 1) j))))              new-arr)))) 

Source for the above code: http://www.cs.uml.edu/~lhao/ai/lisp/ansi-common-lisp/solution-ch04.htm

What´s the proper way of packing this struct in python?

I have a C written tcp server that expects a struct like this to be sent.

struct Foo {     unsigned short bar;     unsigned long bar_len;     char cksum[16]; }  __attribute__((packed)) foo; 

I am using this python code to pack the data

struct.pack('<HLs', bar, bar_len, cksum) 

But when using this python code:

#prepare data for sending bar=8 bar_len=4096 cksum='\x00'*16 sign_header = struct.pack('<HLs', bar, bar_len, cksum) 

Sometimes it works and some times it does not:

[+] Connection received from [+] bar is 8 [+] bar length is 8315179830358315008 Malloc failed : Cannot allocate memory [+] Connection received from [+] bar is 8 [+] bar length is 4096 

What am I doing wrong?

What’s the complexity of the algorithm to find median of 2 sorted arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be $ O(log(𝑚+𝑛))$

Here is the code that I wrote, What is it’s complexity. Is it $ O(m+n)$ or $ O(log(m+n))$

public double findMedianSortedArrays(int[] nums1, int[] nums2){     int totalLength = nums1.length + nums2.length;     boolean isAverageRequired = (totalLength % 2) == 0;      double array[] = new double[(totalLength / 2) + 1];      int nums1Idx = 0;     int nums2Idx = 0;      for (int i = 0; i < array.length; i++){         if (nums1Idx == nums1.length && nums2Idx < nums2.length){             array[i] = nums2[nums2Idx++];         } else if (nums2Idx == nums2.length && nums1Idx < nums1.length){             array[i] = nums1[nums1Idx++];         } else {             if (nums1[nums1Idx] < nums2[nums2Idx]) {                 array[i] = nums1[nums1Idx++];             } else {                 array[i] = nums2[nums2Idx++];             }         }     }      if (isAverageRequired){         return (array[array.length - 1] + array[array.length - 2]) / 2;     } else {         return array[array.length - 1];     } } 

What’s the safest way to make home server available from outside the network?

I have an old laptop that I decided to use as a server, with some samba shares and whatnot (making available some dvd rips and the like), and I’d like to be able to access the files in it from not only inside my home network, but also the outside network.

I read about port knocking, and that seemed like a decent idea — until I realized that because the server would be behind a router it might not be the best idea unless I get a new router that allows for it specifically. Then I read a bit more, and realized it might not be as safe as I’d originally gathered.

While investigating if my router allowed for port knocking, though, I came upon the notion of the DMZ — ’cause my router lets me configure that and all. My understanding of this, though, is that I’d need to make the whole server available to the world, and I’m not entirely sure how complicated it’d be to set up proper protection on a server in a router’s DMZ, to later SSH into it from the outside.

Finally, while trying to get some answers out there, I also crossed paths with the idea of maybe getting a RaspberryPi and making it a VPN server so I can VPN into my home network. However, once again, not sure how vulnerable to exploitation that’d be.

I have a limited knowledge of security principles, not being a pro or anything, hence the doubt on this. My knowledge of iptables, for instance, is very limited, so I wouldn’t know how to properly protect the router if I put it in the DMZ.

Is one of the three methods mentioned above generally preferred, in terms of safety? And what methods of securing it are generally recommended too? Bonus points: is one of them easier to set up too?

What’s the advantage of being proficient with a Disguise Kit over the Deception skill?

In one instance, a player uses his Disguise kit proficiency to craft a well-made disguise, and then whenever someone makes a check to see though it, he adds his proficiency bonus plus relevant ability modifier (which would presumably be Charisma, but an argument could be made for Intelligence) to the roll versus their Insight. In another instance, a player (proficient in Deception) throws together a disguise from what’s lying around, and then when trying to pass himself off as that to someone suspicious nearby, he adds his proficiency bonus plus his Charisma modifier to the roll versus their Insight.

I don’t understand what the benefit of the tool proficiency is when in many cases, you can choose instead to become proficient in Deception, which has more applicable uses.

What’s the limit of “soil” for the Prestidigitation cantrip?

What’s the definition of “soil” for the prestidigitation cantrip?

I’ve been trying to find anything that defines any kind of limit to what soil means. I know the literal definition would be to make something dirty or unclean, but that doesn’t mean it has to be soiled with dirt either.

What limits would there be to soil a 1-foot cubic object with nearly anything?

I know some of that would be up to the DM, but I’ve thought about soiling an arrow with poison, oil, or whatever I could think of. I have thought of other options, but that should hopefully explain my question.

whats this codes means ( for encrypt datas )

1 SecretKeySpec(d9f52f6d-5168-4e5c-b7e6-57d6b57bac683f7315e7854047f5bed41a3f2f5a38a2,HmacSHA256) , Cipher[AES/CBC/PKCS5Padding] [PBEKeySpec] – Password: d9f52f6d-5168-4e5c-b7e6-57d6b57bac68 || Salt: 166:62:2.0.3

2 IV: 3f7315e7854047f5 (9HaB0schKRqnnO6iQQc85+P6KAKZ+omsLlDBW/9BLB0Vmb8VMO3AYtKh+RyxORTv , 967219be2a9048c8abf0f50a8e7b4364)

3 [PBEKeySpec] – Password: d9f52f6d-5168-4e5c-b7e6-57d6b57bac68967219be2a9048c8abf0f50a8e7b4364 || Salt: 166:62:2.0.3

4 IV: 3f7315e7854047f5 (fifyusiih@gmail.com , jBdL3XPKOl9pQPF/cI7NUGFBxD6N5nnSBFuGoC4R690=)

5 [PBEKeySpec] – Password: d9f52f6d-5168-4e5c-b7e6-57d6b57bac68967219be2a9048c8abf0f50a8e7b4364 || Salt: 166:62:2.0.3

6 IV: 3f7315e7854047f5 (hivhigf , NKB62GnZ5zugT+ArL/QQEg==)