Posts

Showing posts from 2023

Smart cast operator in kotlin | "is" operator in kotlin | #shorts

Image

Typecast difference in java and kotlin | Automatic casting in java

Image

Capitalize the sentence in kotlin | replaceFirstChar() instead of capitalize

Image

Remove duplicate words from the sentence using LinkedHashSet in kotlin

Image

replaceBefore() function in kotlin

Image

replaceFirst() method in kotlin | #shorts #beginners #kotlin

Image

Replace char in kotlin | #shorts #beginners #kotlin

Image

Replace the digit to character using RegEx | #shorts #beginners #kotlin

Image

Replace substring in sentence using ignorecase | kotlin replace | #short...

Image

Ascending and Descending order in Kotlin | Sort in Kotlin | #shorts #beg...

Image

Switch case in kotlin

Mutable vs Immutable list in kotlin | #shorts @androidmani #kotlin #begi...

Image

forEach vs forEachIndex vs WithIndex in Kotlin | #shorts #beginners #kotlin

Image

NULL check in kotlin using let function | Scope function in kotlin #shor...

Image

Smart casting operator "is" and "!is" in kotlin

  fun main (args: Array<String>) { /* Smart Cast for nullable types is - !is - operator */ val obj: Any = 10 if (obj !is Long) { println ( "Obj is not string" ) } else { println ( "Obj is Long ${ obj } " ) } }

Type cast operator "as" in kotlin

  fun main (args: Array<String>) { /* Type casting in kotlin unsafe vs safe cast operator as - as? */ val obj: Any? = null val name: String? = obj as? String println (name) }

Type conversion in Kotlin vs Java

Type conversion in Kotlin vs Java In Java, The data type is automatically converted to another data type but In Kotlin we need to explicitly convert the data type like toInt(), toLong(), toString() More Type cast methods in Kotlin toChar() - To convert a data tye to Char type toInt() - To convert a data type to Int type toLong() - To convert a data type to Long type toFloat() - To convert a data type to Float type toDouble() - To convert a data type to Double type toByte() - To convert a data type to Byte type toShort() - To convert a data type to Short type Example in Java Int is automatically converted to a Long data type as long is larger than int. public class Demo { // Type casting Java public static void main (String[] args) { int a = 10 ; long b = a; System. out .println(a); System. out .println(b); } } In Kotlin the conversion is not automatic, we need to explicitly do the type conversion. Example in Kotlin fun main (args: Array<

Capitalize the each words in sentence of kotlin (Capitalize method getting deprecated)

 

Capitalize Sentence with replaceFirstChar method (Capitalize getting deprecated)

 

Remove duplicate word from sentence using LinkedHashSet in Kotlin

Kotlin replace function in String class

Normal vs Lambda expression or Highorder function

Lambda definition: Kotlin has concise (short) syntax for defining lambda functions, which makes it easier to work with functional programming constructs. Lambda Expression syntax in Kotlin: { argument -> businessloginwith_return } { a, b -> a+b } Lambda 

Mutable and Immutable List in Kotlin

Immutable List can't be editable like add, edit or delete but we can retrieve the data Mutable List can be editable by add, edit, or delete

Fibonacci Sequence using Swap in Kotlin

Image

Fibonacci Sequence using Recursive in Kotlin | #shorts #kotlin

Image

Typescript | Basics of typescript #typescript

Image

Topics of Angular development

  Angular topics Installation Components Module Data Binding Parent-child communication (@Input, @Output) String interpolation {{}} One-Way Binding - Custom, Property Binding Two Way Binding [(ngModel)] Directives Component directive <app-root></app-root> Attribute directive ngClass, ngStyle, ngModel Structural directive ngIf, ngFor, ngSwitch LifeCycle Hooks Host Binding & Attribute Directives Custom Directives Structural Directives Pipes Dependency Injection (DI) Services Routers Router Guard HTTP client Forms Template Driven Reactive FormRouters @ViewChild @ViewChildren Ng-content @ContentChild @ContentChildren Ng-template Ng-container Pipe RxJs Stream Observables Subscription Unit Testing Karma Jasmin Angular Material Animation Progressive Web Apps (PWA) REST API with NestJS and mongoDB Firebase, Firestore and AngularFire

Creating Orphan branches in Bitbucket

How we can create an empty branch in bitbucket using git command? git checkout --orphan <orphan-branch-name> git rm -rf . git commit --allow-empty -m “Empty branch” git push origin <orphan-branch-name>

Promise vs Observables

 https://stackblitz.com/edit/angular-fkwnmh?embed=1&file=src/main.ts import sdk from '@stackblitz/sdk' sdk.embedProjectId(   'elementOrId',   'angular-fkwnmh',   {     forceEmbedLayout: true,     openFile: 'src/main.ts',   } );

Jenkins installation and integration in mac book

Image
  Jenkins installation and integration in mac book Install the latest LTS version:  brew install jenkins-lts Install a specific LTS version:  brew install jenkins-lts@YOUR_VERSION Uninstall a Jenkins brew uninstall jenkins-lts Start the Jenkins service:  brew services start jenkins-lts Restart the Jenkins service:  brew services restart jenkins-lts Stop the Jenkins service:  brew services stop jenkins-lts Update the Jenkins version:  brew upgrade jenkins-lts Reference: https://www.jenkins.io/doc/book/installing/macos/

Janus vulnerability fix for android application

Image
  Janus vulnerability android     Step 1: Take debug Build from the android studio:   Step 2: Make it an unsigned apk with debug.apk using zip align   C:\Users\ -- \AppData\Local\Android\Sdk\build-tools\32.0.0\zipalign -v -p 4 app- debug.apk my-app-unsigned- aligned.apk             Step 3: Make it a signed apk using the release keystore with unsigned apk   C:\Users\ -- \AppData\Local\Android\Sdk\build-tools\32.0.0\apksigner.bat sign -- ks sample.jks --out my-app- release.apk my-app-unsigned- aligned.apk         Step 4:  Now, We can see that v1, v2, and v3 have verified status   C:\Users\hello\AppData\Local\Android\Sdk\build-tools\32.0.0\apksigner.bat verify --verbose my-app- release.apk             Step 5: Make a v4 Signature using the below comment   C:\Users\hello\AppData\Local\Android\Sdk\build-tools\32.0.0\apksigner.bat verify -v -v4-signature-file my-app- release.apk.idsig my-app- release.apk               NOTE: Make sure to use the latest JDK   Reference:   https://andro