inverselaplace – Is this method of finding the Inverse Laplace correct?

I was recently given a question to solve by my professor that required me to find the Inverse Laplace. I’m sure my solution was correct but I’m wondering if my professors solution is also correct.

My professor and I both manage to start off the problem the same way but as soon as we get to partial fractions our work begins to differ. I want to include that I do understand what my professor did to get the answer he did. He used the formula for partial fraction expansion and inverse shown below. I just want to know if both answers are somehow equivalent to one another because I’m having trouble seeing whether or not they are and if so, is one way preferred to the other because my solution was the method originally taught to me. Thank you.

The question: Q

My Solution: Solution

Professors Solution:Prof Solution

Expansion and Inverse formula:Formula

mysql 5.5 – Performance at finding all foreigns with 3 one-to-many relation

Basically, I have 2 tables : user and object. One user can be associated to one object by three ways (roles). I want to list all users associated at least to one business object by any role.

This query works, but it takes 5 seconds !

FROM user u
LEFT JOIN translation_revision t1
    ON = t1.translator_id
LEFT JOIN translation_revision t2
    ON = t2.proofreader_id
LEFT JOIN translation_revision t3
    ON = t3.reviewer_id

Complete fiddle with creation and data here :

Any idea on how to improve perf here ?

fast fourier transform – Finding the twiddle factors for FFT algorithm

I am trying to calculate the twiddle factors for the FFT algorithm and the iFFT algorithm, but i am unsure if i have it correctly calculated and was hoping some one could tell me if i have gone wrong as currently i get the wrong output for my FFT and i believe the twiddle factors might be the reason.

This is my code (in C#) to calculate them:

For _N = 4 and _passes = log(_N)/log(2) = 2

        //twiddle factor buffer creation
        _twiddlesR = new Vector2(_N*_passes); //inverse FFT twiddles
        _twiddlesF = new Vector2(_N*_passes); //forward FFT twiddles
        for (int stage = 0; stage < _passes; stage++)
            int span = (int)Math.Pow(2, stage); // 2^n

            for (int k = 0; k < _N; k++) // for each index in series
                int arrIndex = stage * _N + k; // get index for 1D array
                // not 100% sure if this is correct for theta ???
                float a = pi2 * k / Math.Pow(2,stage+1);

                //inverse FFT has exp(i * 2 * pi * k / N )
                Vector2 twiddle = new Vector2(Math.Cos(a), Math.Sin(a));

                //forward FFT has exp(-i * 2 * pi * k/ N ) which is the conjugate
                Vector2 twiddleConj = twiddle.ComplexConjugate();

                /*this ternary checks if the k index is top wing or bottom wing
                the bottom wing requires -T top wing requires +T*/

                float coefficient = k % Math.Pow(2, stage + 1) < span ? 1 : -1;

                _twiddlesR(arrIndex) = coefficient * twiddle;
                _twiddlesF(arrIndex) = coefficient * twiddleConj;

My debug data:

For inverse FFT twiddles:

First pass
1 + 0i
1 + 0i
1 + 0i
1 + 01
Second pass:
1 + 0i
0 + i
1 + 0i
0 + i

For forward FFT twiddles:

First pass
1 + 0i
1 + 0i
1 + 0i
1 + 01
Second pass
1 + 0i
0 - i
1 + 0i
0 - i

I am not convinced i have it right, but i am unsure what i have got wrong. Hoping some one who has a better understanding of this algorithm can spot my math error.

linux – Finding a solution to a Network programming issue

I have a question how can i implement such a solution for this problem : there is a program which it must be run in a shell, as for example:
./desiredprogram ifs=eth01,eth02,eth03

1 – i want to bridge the interfaces as the program inputs together , the entered interfaces as input parameters must be bridged together by program, and it must be listen in passive mode 2 – i want it to hold the statistics of packets (in Network and Transport Layers) how can i implement this ? and could you please tel me which books and topics would be helpful for my question ? Thanks in advcance

path finding – How to make pathfinding agents avoid each other using A* in unity?

How the it looks before I play

So far Ive implemented a 2D grid graph using 2D physics. My enemies have a seeker script, AI destination setter (with the player position attached) and a basic AIPath script that is set to 2D

When I press play, my enemy game objects move away from the marked area where they can’t go, and the area remains static. Is there a way to make this marked area follow the colliders using A*?

computability theory – Finding 1-generic paths through a tree $T subseteq 2^{

Consider Cantor space $2^omega$ with the standard topology generated by open sets $(sigma) = { sigma^frown x: x in 2^omega }$. If $A subseteq 2^{<omega}$ and $x in 2^omega$, we say $A$ is dense along $x$ if for every prefix $sigma prec x$, there is $tau succ sigma$ such that all finite extensions of $tau$ are in $A$.

An element $x in 2^omega$ is 1-generic if, for every $Sigma^0_1$ (computably enumerable) set $A subseteq 2^{<omega}$ which is dense along $x$, we have $x in (A)$ ($x$ is a path through $A$). I think this is the standard definition (from here).

Now, suppose $T subseteq 2^{<omega}$ is a tree. What conditions can we impose on $T$ that guarantee $(T)$ contains a 1-generic member? Effectively, I’m looking for some type of “generic basis theorem”. In particular, if $T$ is infinite and $Sigma^0_2$, can we guarantee it contains a 1-generic path?

time complexity – Finding $l$ subsets such that their intersection has less or equal than $k$ elements NP-complete or in P?

I have a set $M$, subsets $L_1,…,L_m$ and natural numbers $k,lleq m$.

The problem is:

Are there l unique indices $1leq i_1,…,i_lleq m$, such that

$hspace{5cm}left|bigcap_{j=1}^{l} L_{i_{j}}right| leq k$

Now my question is whether this problem is $NP$-complete or not. What irritates me is the two constraints $l $ and $k$ because the NP-complete problems that were conceptually close to it that I took a look on (set cover, vertex cover) only have one constraint respectively that also appears in this problem.

I then tried to write a polynomial time algorithm that looks at which of the sets $L_1,…,L_m$ share more than $k$ elements with other sets but even if all sets would share more than $k$ elements with other this wouldn’t mean that their intersection has more than $k$ elements…

This question kind of comes close but in it there is no restriction on the amount of subsets to use and the size of the intersection should be exactly $k$, but maybe this could be useful anyways.

Can somebody further enlighten me ?

javascript – Finding the sum of all numeric palindromes that are less than N

I wrote a function that finds the sum of all numeric palindromes lesser than N.

const sumOfPalindromes = (n) => {
    let x = 0;
    for (let i = 0; i <= n; i++) {
      x += i == (''+i).split('').reverse().join('') ? i : 0;
    return x;


Are there shorter, more-concise alternatives to the above approach (preferably without using a for loop)?

algorithms – Runtime Complexity of finding a loop in an array

Having a hard time understanding the runtime complexity of the following algorithm:

public class Solution {
    public boolean circularArrayLoop(int() nums) {
        int n = nums.length;
        if(n < 2){
            return false;
        for(int i = 0; i < n; i++){
            if(nums(i) == 0){
            int slow = i, fast = advance(nums, i);
            while(nums(slow) * nums(fast) > 0 && nums(advance(nums, fast)) * nums(slow) > 0){
                if(slow == fast){
                    //one element loop does not count
                    if(slow == advance(nums, slow)){
                    return true;
                 slow = advance(nums, slow);
                 fast = advance(nums, (advance(nums,fast)));
            //loop not found, set all the elements along the way to 0
            slow = i;
            int val = nums(i);
            while(nums(slow) * val > 0){
                int next = advance(nums, slow);
                nums(slow) = 0;
                slow = next;
        return false;
    public int advance(int() nums, int i){
        int n = nums.length;
        return i + nums(i)  >= 0 ? (i+nums(i)) % n : n + ((i + nums(i)) %n);

Been told that the complexity should be $O(n)$ because each node is visited at most four times by slow, by fast, be marking zero, be zero checking. Cannot quite agree, because even it is marked zero, the rest of the nodes still have to check whether it is zero or not. So you have to check it at least $n-1$ times.