Posts

Showing posts from May, 2003

\arccos(1/2) Arccos(1/2) Products

Answer : Note that tan ⁡ ( x ) = 2 sin ⁡ ( x )    ⟺    sin ⁡ ( x ) cos ⁡ ( x ) = 2 sin ⁡ ( x )    ⟺    sin ⁡ ( x ) = 0 ∨ cos ⁡ ( x ) = 1 2 . \begin{align}\tan(x)=2\sin(x)&\iff\frac{\sin(x)}{\cos(x)}=2\sin(x)\\&\iff\sin(x)=0\vee\cos(x)=\frac12.\end{align} tan ( x ) = 2 sin ( x ) ​ ⟺ cos ( x ) sin ( x ) ​ = 2 sin ( x ) ⟺ sin ( x ) = 0 ∨ cos ( x ) = 2 1 ​ . ​ ​ And cos ⁡ ( x ) = 1 2    ⟺    x = π 3 + 2 n π ∨ x = − π 3 + 2 n π , \cos(x)=\frac12\iff x=\frac\pi3+2n\pi\vee x=-\frac\pi3+2n\pi, cos ( x ) = 2 1 ​ ⟺ x = 3 π ​ + 2 nπ ∨ x = − 3 π ​ + 2 nπ , with n ∈ Z n\in\Bbb Z n ∈ Z . In particular, although arccos ⁡ ( 1 2 ) ( = π 3 ) \arccos\left(\frac12\right)\left(=\frac\pi3\right) arccos ( 2 1 ​ ) ( = 3 π ​ ) is indeed a solution of the equation cos ⁡ ( x ) = 1 2 \cos(x)=\frac12 cos ( x ) = 2 1 ​ , it is not the only one. Let x ∈ [ − π 3 , π 3 ] x\in[-\frac{\pi}{3},\frac{\pi}{3}] x ∈ [ − 3 π ​ , 3 π ​ ] . tan ⁡ ( x ) = 2 sin ⁡ ( x )    ⟺    \tan(x)=2\sin(x) \iff tan ( x ) = 2

Angular: Conditional Class With *ngClass

Answer : Angular version 2+ provides several ways to add classes conditionally: type one [class.my-class]="step === 'step1'" type two [ngClass]="{'my-class': step === 'step1'}" and multiple option: [ngClass]="{'my-class': step === 'step1', 'my-class2':step === 'step2' }" type three [ngClass]="{1:'my-class1',2:'my-class2',3:'my-class4'}[step]" type four [ngClass]="(step=='step1')?'my-class1':'my-class2'" [ngClass]=... instead of *ngClass . * is only for the shorthand syntax for structural directives where you can for example use <div *ngFor="let item of items">{{item}}</div> instead of the longer equivalent version <template ngFor let-item [ngForOf]="items"> <div>{{item}}</div> </template> See also https://angular.io/docs/ts/latest/api/common/index/NgCl

Bootstrap Input Textbox Code Example

Example 1: input with bootstrap <form> <div class= "form-group" > <label for= "exampleInputEmail1" >Email address</label> <input type= "email" class= "form-control" > <small id= "emailHelp" class= "form-text text-muted" >Hello , World</small> </div> </form> Example 2: bootstrap input tagsinput <select multiple data-role= "tagsinput" > <option value= "Amsterdam" >Amsterdam</option> <option value= "Washington" >Washington</option> <option value= "Sydney" >Sydney</option> <option value= "Beijing" >Beijing</option> <option value= "Cairo" >Cairo</option> </select> Example 3: bootsrap textbox <form> <div class= "form-group" > <label for= "exampleFormControlInput1" >Emai

Build An EBCDIC Converter Using NAND Logic Gates

Image
Answer : 727 Gates How I did it: turned the code page translation from wikipedia into an appropriately formatted truth table using Excel (15 minutes) minimized the truth table using Espresso (5 minutes, 30 minutes on 1st iteration getting back into the saddle) fed the minimized truth table into a schematic generator (1 minute) iterated on 2&3 until I got a reasonable answer (<1 hour) turned the schematic into an uploadable image (30 min, %$#@! Microsoft) Here's the 100% NAND gate result: If I was actually going to implement this, I'd drop the NAND-centric scoring. Building XOR gates out of NANDs is a big waste of transistors. Then I'd start worrying about UMC, fire up the FPGA design tools, maybe break out the HDL manuals, etc. Whew! I love software. NB, for hobbyists interested in FPGAs, I'll recommend FPGA4fun. #309 NANDs# A really low solution in the number of NANDs, but I can go even lower. One just have to stop somewhere, some time, an

Mp3 Youtube Downloader Online Code Example

Example 1: youtube mp3 converter You can use WebTools , it's an addon that gather the most useful and basic tools such as a synonym dictionary , a dictionary , a translator , a youtube convertor , a speedtest and many others ( there are ten of them ) . You can access them in two clics , without having to open a new tab and without having to search for them ! - Chrome Link : https : //chrome.google.com/webstore/detail/webtools/ejnboneedfadhjddmbckhflmpnlcomge/ Firefox link : https : //addons.mozilla.org/fr/firefox/addon/webtools/ Example 2: youtube to mp3 online This man is doing gods work

Angular Cli Version Check Code Example

Example 1: how to check for angular cli version ng -- version Example 2: check angular version Open the Terminal + view in your project and type ng -- version this will list the versions of several Angular packages that you have installed in your project . Example 3: acheck angular version ng version [ options ]

10th Gen Intel I5 Vs Ryzen 5 4500u Code Example

Example: ryzen 5 vs intel i5 10th gen AMD won by 1 point overall they all are dope

Bootstrap Loading Spinner Overlay Code Example

Example 1: circlular waiting icon bootstrap < div class = " spinner-border " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > Example 2: bootstrap loader < div class = " spinner-border text-primary " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner-border text-secondary " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner-border text-success " role = " status " > < span class = " sr-only " > Loading... </ span > </ div > < div class = " spinner-border text-danger " role = " status " > < span class = " sr-only " > Loading... </ span > </ div >

How To Print Bool Variable In C Code Example

Example: how to print boolean in c printf ( "%s" , x ? "true" : "false" ) ;

Nested Loop C Programming Code Example

Example: how to create a nested for loop in c //Nested for loop in C int main ( ) { for ( int i = 0 ; i < 2 ; i ++ ) { for ( int j = 0 ; j < 4 ; j ++ ) { printf ( "%d, %d\n" , i , j ) ; } } return 0 ; } //Alternative approach to nested for loop int main ( ) { int i , j ; for ( i = 1 , j = 1 ; i < 10 || j < 10 ; i ++ , j ++ ) { printf ( "%d, %d\n" , i , j ) ; } return 0 ; }

Void Meaning In C Code Example

Example 1: what is void in c FUNCTION DECLARATION when void is used as a function return type , it indicates that the function does not return a value . POINTER DECLERATION When void appears in a pointer declaration , it specifies that the pointer is universal . FUNCTION PARAMETER ( IN C ONLY ) When used in a function ' s parameter list , void indicates that the function takes no parameters . Example 2: void c programming FUNCTION DECLARATION when void is used as a function return type , it indicates that the function does not return a value . POINTER DECLERATION When void appears in a pointer declaration , it specifies that the pointer is universal .

Combining Multiple Commits Into One Prior To Push

Answer : For your first question, no, there's nothing wrong with pushing multiple commits at once. Many times, you may want to break your work down into a few small, logical commits, but only push them up once you feel like the whole series is ready. Or you might be making several commits locally while disconnected, and you push them all once you're connected again. There's no reason to limit yourself to one commit per push. I generally find that it's a good idea to keep each commit a single, logical, coherent change, that includes everything it needs to work (so, it does not leave your code in a broken state). If you have a two commits, but they would cause the code to be broken if you only applied the first one, it might be a good idea to squash the second commit into the first. But if you have two commits where each one makes a reasonable change, pushing them as separate commits is fine. If you do want to squash several commits together, you can use git rebase