Vector – number * vector =?

I can’t wrap my head around these vector subtractions. They make 0 sense to me, can anyone help me get this simple step correct in my head? I’m getting nowhere since a hour.

Im trying to use the Gram-Schmidt on 3 vectors, but I can’t get my head around the first equation of

$ $ u_2 = a_2 – \langle a_2,u_1 \rangle u_1$ $

The final answer don’t make any sense to me, I appended 2 pictures of 2 calculations that I just can’t solve.

On the second equation I tried to multiply the 1/2 into the second vector and then tried to v1-v2, but it didn’t get me the expected result.

Can anyone enlighten me this simple step?


First Equation Second Equation

How to verify if an input is checked and how to display it number

I’m working on star ratings. I reused code from Olga on Codepen. And I want to display dynamically the rate that the user selected like this : “You gave this product : 3/5”.

I’m beginning in JS and jQuery so my ideas where limited ; I tried this just to test but it didn’t show anything

if ($  ('.rate2-star5').is(':checked')) {     alert("checked"); } 
<div class="row">     <fieldset class="rate">         ....         <input class="rate2-star5" type="radio" name="rate2" value="5"/>         <label for="rate2-star5" title="Awesome">5</label>          <input class="rate2-star4" type="radio" name="rate2" value="4"/>         <label for="rate2-star4" title="Very good">4</label>         ....     </fieldset> </div> 

Here what I want the result to look like :

Is Android Mobile generated barcode with random number legally protected?

I am making an app which provides generation of a barcode with any random number and also user can print them in A4 size pdf and use it on their products.

Is there any law or anything else which I will aware of. Can anybody point of the bad impact of doing this thing? Or should I warn my users to use them on their own risk?

Any help will be appreciated.

Dephi: faster way to convert a “dirty” string to a number

How can I make this code faster? the string can contain characters such as “, .?#” and possibly others.

Const Nums = ['0'..'9'];  function CleanNumber(s: String): Int64; Var z: Cardinal; begin   for z := length(s) downto 1 do    if not (s[z] in Nums) then Delete(s,z,1);   if s = '' then     Result := 0 else     Result := StrToInt64(s); end; 

Calculate the nth Fibonacci number, mod m

I was trying to output F(n) mod m to find the remainder of Fibonacci number, where F(n) could be a very big number:

# Uses python3 n, m =  [int(x) for x in input().split()]  def fib(n):     a = [0, 1]     if (n <=1):         return n     else:         for i in range(1, n):             a.append((a[-1] + a[-2])%m)         return a[i+1] print (fib(n)) 

As I typed in 239 1000, it returns 161 as the remainder, which is correct. But with bigger inputs eg. 2816213588 239, it seems to exceed time limits, what can I do to improve the code?

AppleScript : separating number from text in variable

I have a script which calculate the timeframe between date and return the result in days or month or years.

For exemple, given myResult = “6 Days” How can I separate the number from the text ?

I managed to get the number only using this :

set myResultNumberOnly to number of myResult 

but I can’t manage to do the same from the text :

set myResultTextOnly to text of myResult 

I also tried

set myResultTextOnly to word of myResult 

Maybe I can go with text delimiting? I can’t tell the length of the number using this :

set theLength to (get length of (myResultTextNumberOnly as text)) 

Or should I go with if statement?

How would be the best way to do it?