Snippets Collections
///////////////***** SCOPES IN JS *************/////////////

let a = 200
if(true){
    let a = 100
    console.log("inner a is  ",a);// 100 (BLOCK SCOPE)
}
console.log("outer a is  ",a); // 200 (GLOBAL SCOPE)

/*

BLOCK SCOPE 
The space inside the curly braces is called a block space.
variable assigned in block scope only accessable in block scope not in global scope.


Global SCOPE 
The space outside the curly braces is called a Global space.
variable assigned in global scope  accessable in both block scope and  global scope.

*/
///////////////****** FUNCTIONS IN JS  ********////////////////////


/// Basic function 
function NAME(){
    console.log("i");
    console.log("love");
    console.log("you");
}
NAME() /// calling the function 

// function of adding two number 
function add2number(number1 , number2){ // number1 , number2 are called parameters
    console.log(number1 + number2);
}
add2number(20,30)  // here what we pass are called arguments , here 20 ,30.




// function of adding two number (SECOND METHOD )
function addtwonumber(number1 , number2){ 
    let result = number1 + number2
    return result
    console.log("om"); /// this will not execute because it is after return function
}

const result = addtwonumber(3,5)
console.log("result is equal to", result); ///8 


/// function of adding two number (THIRD METHOD )

function addtwonumbers(number1 , number2){ 
   return number1 + number2
    
}

const result2 = addtwonumbers(7,5)
console.log("result is equal to", result2); ///12

//////// basic confusion in terms of return function 

function login(username="sammy"){
    if(username === undefined){
        console.log("please enter your name ");
        return
    }
    return `${username} just logged in `
    
}
console.log(login("TANISHQ DHINGRA" )); //TANISHQ DHINGRA just logged in 
console.log(login()); //sammy just logged in 
///////////////****** OBJECTS IN JS (PART 3) ********////////////////////


/// de structuring data 
const course ={
    coursename:"udemy js ",
    price: "999",
    courseIntructor: "hitesh"
    
}

const {courseIntructor: Inst} = course  // getting value of courseInstructor from course and refreing it from Inst key
console.log(Inst); // hitesh


///////////////////////////**** JSON API *******////////////////
  
/// this is Json 
/*{ 
    "name": "om",
    "coursename": "js",
    "price": "free"
}*/

// this Json array
[
    {},
    {},
    {}
]
////////////////**************OBJECTS part 2  IN JS **********////////////////////

////////// singleton objects 

//const tinderuser = new Object()

const tinderUser ={} // assingning a function 

tinderUser.id = "123abc" // putting value in function
tinderUser.name = "sammy " // putting value in function
tinderUser.isloggedin = false // putting value in function

console.log(tinderUser); // { id: '123abc', name: 'sammy ', isloggedin: false }
console.log(tinderUser.name); // sammy



/// nested functions 
const regularuser ={
    email: "some@gmail.com",
    fullname: {
        userfullname: {
            firstname: "hitesh",
            lastname: "sharma"
        }
    }
    
}

//console.log(regularuser);
console.log(regularuser.fullname.userfullname.firstname);/// hitesh


//// combining 2 objects together into a single object 

const obj1 = { 1: "a" , 2: "b" }
const obj2 = { 3: "a" , 4: "b" }
const obj4 = { 5: "a" , 6: "b" }

//// assingnuing function 
////const obj3 = Object.assign({}, obj1 , obj2 , obj4)
// syntax {} means target amd obj1 obj2 obj4 all three are source 

/// drop function
//const obj5 = {...obj1, ...obj2, ...obj4};
//console.log(obj5);

/// methods inside arrays 
const users = [
    {
        id: 1, 
        name: "tanishq dhingra "
    },
    {
        id: 1, 
        name: "tanishq dhingra "
    },
    {
        id: 1, 
        name: "tanishq dhingra "
    }
    ]
    console.log(users[1].id);
    
// function for getting the keys present in objects 
console.log(Object.keys(tinderUser)); 

// function for getting the values present in objects 
console.log(Object.values(tinderUser)); 

// function for getting the entries present in objects 
console.log(Object.entries(tinderUser));

// function for checking properties present in objects  and it will give answer in boolean 
console.log(tinderUser.hasOwnProperty('isLoggedIn'));
activity main.xml
****
  <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="LIFE CYCLE"
        android:textSize="18sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintVertical_bias="0.5"
        app:layout_constraintHorizontal_bias="0.5"
        tools:ignore="MissingConstraints" />

</androidx.constraintlayout.widget.ConstraintLayout>
*******
     main activity.kt
*****
       package com.example.myapplication



import android.os.Bundle
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        WindowCompat.setDecorFitsSystemWindows(window, false) // Enables edge-to-edge
        setContentView(R.layout.activity_main)
        Toast.makeText(applicationContext, "onCreate() called", Toast.LENGTH_SHORT).show()
    }

    override fun onStart() {
        super.onStart()
        Toast.makeText(applicationContext, "onStart() called", Toast.LENGTH_SHORT).show()
    }

    override fun onResume() {
        super.onResume()
        Toast.makeText(applicationContext, "onResume() called", Toast.LENGTH_SHORT).show()
    }

    override fun onPause() {
        super.onPause()
        Toast.makeText(applicationContext, "onPause() called", Toast.LENGTH_SHORT).show()
    }

    override fun onStop() {
        super.onStop()
        Toast.makeText(applicationContext, "onStop() called", Toast.LENGTH_SHORT).show()
    }

    override fun onDestroy() {
        super.onDestroy()
        Toast.makeText(applicationContext, "onDestroy() called", Toast.LENGTH_SHORT).show()
    }
}
******
//main activity.kt

  



import android.os.Bundle
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent

import androidx.compose.foundation.layout.*
import androidx.compose.material3.Button
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import com.example.myapplication.ui.theme.User
import com.example.myapplication.ui.theme.UserDatabase
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            val database = UserDatabase.getInstance(this)
            InsertRecord(database)
        }
    }
}

@Composable
fun InsertRecord(database: UserDatabase) {
    val context = LocalContext.current
    val userDao = database.userDao()

    var name by remember { mutableStateOf("") }
    var phone by remember { mutableStateOf("") }

    val scope = rememberCoroutineScope()

    Column(modifier = Modifier.fillMaxSize().padding(16.dp)) {
        Text(text = "Enter your details here")
        Spacer(modifier = Modifier.height(25.dp))

        OutlinedTextField(
            value = name,
            onValueChange = { name = it },
            label = { Text(text = "Enter your name") },
            modifier = Modifier.fillMaxWidth()
        )
        Spacer(modifier = Modifier.height(25.dp))

        OutlinedTextField(
            value = phone,
            onValueChange = { phone = it },
            label = { Text(text = "Enter your phone number") },
            modifier = Modifier.fillMaxWidth()
        )
        Spacer(modifier = Modifier.height(25.dp))

        Button(onClick = {
            scope.launch(Dispatchers.IO) {
                userDao.insert(User(username = name, phone = phone))
            }
            Toast.makeText(context, "Record Inserted Successfully", Toast.LENGTH_LONG).show()
        }) {
            Text(text = "Insert Now")
        }
    }
}

@Preview(showBackground = true)
@Composable
fun PreviewInsertRecord() {
    val mockDatabase = UserDatabase.getInstance(context = LocalContext.current) // Use a mock database for preview
    InsertRecord(mockDatabase)
}

//  user.kt(create data class file)

  



import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity(tableName = "users")
data class User(
    @PrimaryKey(autoGenerate = true) val uid: Int? = null,
    val username: String,
    val phone: String
)
{
}

//  userdao.kt(create interface)

  package com.example.myapplication.ui.theme



import androidx.room.Dao
import androidx.room.Insert

@Dao
interface UserDAO {
    @Insert
    suspend fun insert(user: User)
}

//  userdatabase.kt(create class file)

  

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase

@Database(entities = [User::class], version = 1)
abstract class UserDatabase : RoomDatabase() {
    abstract fun userDao(): UserDAO

    companion object {
        @Volatile
        private var INSTANCE: UserDatabase? = null

        fun getInstance(context: Context): UserDatabase {
            return INSTANCE ?: synchronized(this) {
                val instance = Room.databaseBuilder(
                    context.applicationContext,
                    UserDatabase::class.java,
                    "user_database"
                ).build()
                INSTANCE = instance
                instance
            }
        }
    }
}
//plugins{
//  kotlin("kapt")
//}
//dependendcies{
 // val room_version="2.6.1"
   // implementation("androidx.room:room-runtime:$room_version")
  //  kapt("androidx.room:room-compiler:$room_version") // for annotation processing
   // implementation("androidx.room:room-ktx:$room_version")
//}
*********
package com.example.myapplication



import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.*
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable

// Base Dwelling Class
open class Dwelling(val residents: Int) {
    open val buildingMaterial: String = "Generic material"
    open val capacity: Int = 0

    fun hasRoom(): Boolean {
        return residents < capacity
    }

    open fun description(): String {
        return "This dwelling is made of $buildingMaterial and has space for $capacity people."
    }
}

// Round Hut Class
class RoundHut(residents: Int) : Dwelling(residents) {
    override val buildingMaterial: String = "Straw"
    override val capacity: Int = 4

    fun floorArea(radius: Double): Double {
        return Math.PI * radius * radius
    }

    override fun description(): String {
        return "This is a round hut made of $buildingMaterial with space for $capacity people."
    }
}

// Square Cabin Class
class SquareCabin(residents: Int) : Dwelling(residents) {
    override val buildingMaterial: String = "Wood"
    override val capacity: Int = 6

    fun floorArea(length: Double): Double {
        return length * length
    }

    override fun description(): String {
        return "This is a square cabin made of $buildingMaterial with space for $capacity people."
    }
}

// Round Tower Class
class RoundTower(residents: Int, val floors: Int) : Dwelling(residents) {
    override val capacity: Int
        get() = 4 * floors

    fun floorArea(radius: Double): Double {
        return Math.PI * radius * radius * floors
    }

    override fun description(): String {
        return "This is a round tower with $floors floors, made of $buildingMaterial and has space for $capacity people."
    }
}

// Main Activity
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            DwellingsTheme {
                Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
                    DwellingApp()
                }
            }
        }
    }

    @Composable
    fun DwellingApp() {
        val roundHut = RoundHut(3)
        val squareCabin = SquareCabin(2)
        val roundTower = RoundTower(4, 3)

        Column(modifier = Modifier.fillMaxSize().padding(16.dp)) {
            Text(text = roundHut.description(), style = MaterialTheme.typography.bodyMedium)
            Spacer(modifier = Modifier.height(8.dp))
            Text(text = "Floor Area: ${roundHut.floorArea(4.5)} m²", style = MaterialTheme.typography.bodyMedium)

            Spacer(modifier = Modifier.height(16.dp))

            Text(text = squareCabin.description(), style = MaterialTheme.typography.bodyMedium)
            Spacer(modifier = Modifier.height(8.dp))
            Text(text = "Floor Area: ${squareCabin.floorArea(5.0)} m²", style = MaterialTheme.typography.bodyMedium)

            Spacer(modifier = Modifier.height(16.dp))

            Text(text = roundTower.description(), style = MaterialTheme.typography.bodyMedium)
            Spacer(modifier = Modifier.height(8.dp))
            Text(text = "Floor Area: ${roundTower.floorArea(4.0)} m²", style = MaterialTheme.typography.bodyMedium)
        }
    }

    @Preview(showBackground = true)
    @Composable
    fun DwellingAppPreview() {
        DwellingApp()
    }
}

// Theme
@Composable
fun DwellingsTheme(content: @Composable () -> Unit) {
    val colorScheme = lightColorScheme(
        primary = androidx.compose.ui.graphics.Color(0xFF6200EE),
        onPrimary = androidx.compose.ui.graphics.Color.White,
        secondary = androidx.compose.ui.graphics.Color(0xFF03DAC6),
        onSecondary = androidx.compose.ui.graphics.Color.Black,
    )
    MaterialTheme(
        colorScheme = colorScheme,
        typography = MaterialTheme.typography,
        content = content
    )
}
MainActivity.kt

package com.example.intent

import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.intent.ui.theme.IntentTheme

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        val b1:Button=findViewById(R.id.Bt1)
        b1.setOnClickListener {
            val intent = Intent(this,details::class.java)
            Toast.makeText(this,"Hello-Konichiwa",Toast.LENGTH_LONG).show()
            startActivity(intent)


        }

    }
}








details.kt

package com.example.intent

import android.os.Bundle
import android.widget.Button
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.enableEdgeToEdge

class  details: ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main2)
        val b2: Button = findViewById<Button>(R.id.Bt2)
        b2.setOnClickListener {
            Toast.makeText(this,"hi", Toast.LENGTH_LONG).show()
        }
    }
}




activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/Bt1"
        android:layout_width="match_parent"
        android:layout_height="98dp"
        android:text="Go to Second Activity"
        android:textColor="@color/black"
        android:textSize="25dp" />


</LinearLayout>






activity_main2.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/Bt2"
        android:layout_width="match_parent"
        android:layout_height="98dp"
        android:text="Go to Second Activity"
        android:textColor="@color/black"
        android:textSize="25dp" />


</LinearLayout>



*****manifest******
<activity android:name=".details" />
manifests
fun greet(name:String,msg:String="Hello"){
    println(" $msg   $name")
}
fun main() {
    
    greet("cse","welcome")
    greet("mad")
}
import kotlin.random.Random
fun main() {
    
    var guess:Int?
    var targetNum=Random.nextInt(1,100)
    var attempts=0
    do{
        guess=readLine()?.toIntOrNull();
        attempts++
        if(guess==null){
            println("Enter valid number")
            
        }
        else{
        when{
            guess < targetNum -> println("Too low")
            guess > targetNum -> println("To high")
            else->println("Your have guess the nummber in $attempts attempts")
        }
        }
        
    }
    while(guess!=targetNum && guess != null)
    
}
//Tip Calculator

package com.example.tip

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.tip.ui.theme.TipTheme
import androidx.compose.runtime.remember
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
import androidx.compose.ui.unit.dp
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.fillMaxWidth


class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            TipCalculator()
        }
    }
}

@Composable
fun TipCalculator(){
    var amount by remember { mutableStateOf("") }
    var tipPercentage by remember { mutableStateOf("") }
    var tipAmount by remember { mutableStateOf(0) }

    Column(
        modifier = Modifier.fillMaxSize()
                    .padding(16.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    )
    {
        TextField(value = amount,
            onValueChange = {newAmount -> amount = newAmount},
            modifier = Modifier.fillMaxWidth(),
            label = {Text("Enter your total Bill:")})


        Spacer(modifier = Modifier.height(16.dp))


        TextField(value = tipPercentage,
            onValueChange = {newTipPercentage -> tipPercentage = newTipPercentage},
            modifier = Modifier.fillMaxWidth(),
            label = {Text("Enter tip percentage:")})

        Spacer(modifier = Modifier.height(16.dp))

        Button(
            modifier = Modifier.fillMaxWidth(),
            onClick ={
            val billAmount = amount.toIntOrNull() ?: 0
            val tip = tipPercentage.toIntOrNull() ?: 0

            tipAmount = (tip * billAmount)/100 })
        {
            Text(text = "Calculate Tip")
        }

        Spacer(modifier = Modifier.height(16.dp))

        Text(text = "Your tip amount is: $tipAmount")
    }
}
package com.example.dice

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.dice.ui.theme.DiceTheme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            DiceRoller()
        }
    }
}

@Composable
fun DiceRoller(modifier: Modifier = Modifier){
    var result by remember { mutableStateOf(1) }

    val imageResource = when(result){
        1 -> R.drawable.dice_1
        2 -> R.drawable.dice_2
        3 -> R.drawable.dice_3
        4 -> R.drawable.dice_4
        5 -> R.drawable.dice_5
        else -> R.drawable.dice_6
    }

    Column(
        modifier = modifier.fillMaxSize(),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    ){
        Image(painter = painterResource(imageResource), contentDescription = result.toString())
        Spacer(modifier = Modifier.height(16.dp))
        Button(onClick = {result = (1..6).random()}){
            Text(text = "Roll  Dice"+result)

        }
        Text(text = "Number"+result)
    }
}
////Then extract it
//Now come to android studio
//In Android Studio, click View > Tool Windows > Resource Manager.
//Click + > Import Drawables to open a file browser.
//Click Next.
//Click Import to confirm that you want to import the six images
package com.example.calculator

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.calculator.ui.theme.CalculatorTheme
import java.text.NumberFormat

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
         Surface (modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background){
             TipCalculator()

         }

            }
        }
    }

@Composable
fun TipCalculator(){
    var billAmount by remember{ mutableStateOf(TextFieldValue(" ")) }
    var tipPercentage by remember{ mutableStateOf(TextFieldValue(" ")) }
    var calculatedTip by remember{ mutableStateOf(0.0) }
    var totalAmount by remember{ mutableStateOf(0.0) }

    Column (modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp))
  {
        Text(text = "Tip Calculator", style = MaterialTheme.typography.headlineLarge)

        OutlinedTextField(value = billAmount, onValueChange ={billAmount = it},
            label = { Text(text = "Enter bill amount")}, modifier = Modifier.fillMaxWidth() )

        OutlinedTextField(value = tipPercentage, onValueChange = {tipPercentage = it},
            label = { Text(text = "Enter tip percentage")}, modifier = Modifier.fillMaxWidth())

        Button(onClick = {
            val bill = billAmount.text.toDoubleOrNull()?:0.0
            val tip = tipPercentage.text.toDoubleOrNull()?:0.0

            calculatedTip = (bill * tip ) / 100
            totalAmount = bill+calculatedTip

       				 },
          modifier = Modifier.fillMaxWidth()) {
            Text(text = "Calculate")

       			 }

        if (calculatedTip > 0)
        {
            Text(text = "Tip : ${NumberFormat.getCurrencyInstance().format(calculatedTip)}")
            Text(text = "Total: ${NumberFormat.getCurrencyInstance().format(totalAmount)}")
        }
    }
}

@Preview(showBackground = true)
@Composable
fun TipCalculatorPreview(){
    TipCalculator()
}


//Dependencies
dependencies {
    implementation "androidx.compose.ui:ui:1.3.0"
    implementation "androidx.compose.material3:material3:1.0.0"
    implementation "androidx.navigation:navigation-compose:2.5.3"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
    
}
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.NavController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.example.prog2.ui.theme.Prog2Theme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            val nav_Controller = rememberNavController()
            NavHost(navController = nav_Controller, startDestination = "fragment1")
          			{
                composable("fragment1") 
                      {
                    Fragment1(nav_Controller)
               			 }
                composable("fragment2") {
                    Fragment2(nav_Controller)
                }
            }
        }
    }
}


@Composable
fun Fragment1(navController: NavController){
    Column {
        Button(onClick={ navController.navigate("fragment2")}) {
            Text(text = "Navigate to fragment2 ")
        }
    }
}


@Composable
fun Fragment2(navController: NavController) {
    Row(horizontalArrangement = Arrangement.SpaceEvenly){
        
        Button(onClick = { navController.navigateUp() }) {
            Text(text = "Back to Fragment 1")
        }
    }
}
dependencies {
    implementation "androidx.compose.ui:ui:1.3.0"
    implementation "androidx.compose.material3:material3:1.0.0"
    implementation "androidx.navigation:navigation-compose:2.5.3"
    // Other dependencies...
}
//activity_main.xml(file 1)
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Demonstration of Activity LIFE CYCLE Methods"
        android:textColor="@color/design_default_color_error"
        android:textSize="18sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintVertical_bias="0.5"
        app:layout_constraintHorizontal_bias="0.5"/>
</androidx.constraintlayout.widget.ConstraintLayout>

//MainActivity.ktfile(file 2)
import android.os.Bundle
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        Toast.makeText(applicationContext,"ONCREATE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStart()
    {
        super.onStart()
        Toast.makeText(applicationContext,"ONSTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onRestart()
    {
        super.onRestart()
        Toast.makeText(applicationContext,"ONRESTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onResume()
    {
        super.onResume()
        Toast.makeText(applicationContext,"ONRESUME() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onPause()
    {
        super.onPause()
        Toast.makeText(applicationContext,"ONPAUSE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStop()
    {
        super.onStop()
        Toast.makeText(applicationContext,"ONSTOP() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onDestroy()
    {
        super.onDestroy()
        Toast.makeText(applicationContext,"ONDESTROY() CALLED",Toast.LENGTH_SHORT).show()
    }

}
//Empty Activity

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import com.example.myapplication.ui.theme.MyApplicationTheme
 
 
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            Surface(modifier = Modifier.fillMaxSize(),
                color = Color.White
 
            ) {
                Box(
                    contentAlignment = Alignment.Center,
                    modifier = Modifier.fillMaxSize()
                ){
                    Text(text = "Hello World",
                        color = Color.Red,
                        fontSize = 32.sp
                    )
 
                }
 
            }
        }
 
    }
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Demonstration of Activity LIFE CYCLE Methods"
        android:textColor="@color/design_default_color_error"
        android:textSize="18sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintVertical_bias="0.5"
        app:layout_constraintHorizontal_bias="0.5"/>
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.ktfile
import android.os.Bundle
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        Toast.makeText(applicationContext,"ONCREATE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStart()
    {
        super.onStart()
        Toast.makeText(applicationContext,"ONSTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onRestart()
    {
        super.onRestart()
        Toast.makeText(applicationContext,"ONRESTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onResume()
    {
        super.onResume()
        Toast.makeText(applicationContext,"ONRESUME() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onPause()
    {
        super.onPause()
        Toast.makeText(applicationContext,"ONPAUSE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStop()
    {
        super.onStop()
        Toast.makeText(applicationContext,"ONSTOP() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onDestroy()
    {
        super.onDestroy()
        Toast.makeText(applicationContext,"ONDESTROY() CALLED",Toast.LENGTH_SHORT).show()
    }

}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Demonstration of Activity LIFE CYCLE Methods"
        android:textColor="@color/design_default_color_error"
        android:textSize="18sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintVertical_bias="0.5"
        app:layout_constraintHorizontal_bias="0.5"/>
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.ktfile
import android.os.Bundle
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        Toast.makeText(applicationContext,"ONCREATE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStart()
    {
        super.onStart()
        Toast.makeText(applicationContext,"ONSTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onRestart()
    {
        super.onRestart()
        Toast.makeText(applicationContext,"ONRESTART() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onResume()
    {
        super.onResume()
        Toast.makeText(applicationContext,"ONRESUME() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onPause()
    {
        super.onPause()
        Toast.makeText(applicationContext,"ONPAUSE() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onStop()
    {
        super.onStop()
        Toast.makeText(applicationContext,"ONSTOP() CALLED",Toast.LENGTH_SHORT).show()
    }
    override fun onDestroy()
    {
        super.onDestroy()
        Toast.makeText(applicationContext,"ONDESTROY() CALLED",Toast.LENGTH_SHORT).show()
    }

}
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import com.example.myapplication.ui.theme.MyApplicationTheme


class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            Surface(modifier = Modifier.fillMaxSize(),
                color = Color.White

            ) {
                Box(
                    contentAlignment = Alignment.Center,
                    modifier = Modifier.fillMaxSize()
                ){
                    Text(text = "Hello World",
                        color = Color.Red,
                        fontSize = 32.sp
                    )

                }

            }
        }

    }
}
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import com.example.myapplication.ui.theme.MyApplicationTheme


class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            Surface(modifier = Modifier.fillMaxSize(),
                color = Color.White

            ) {
                Box(
                    contentAlignment = Alignment.Center,
                    modifier = Modifier.fillMaxSize()
                ){
                    Text(text = "Hello World",
                        color = Color.Red,
                        fontSize = 32.sp
                    )

                }

            }
        }

    }
}
package com.example.myapplication

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.myapplication.ui.theme.MyApplicationTheme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            hello()
        }
    }
}
@Composable
fun hello(){
    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        Text(text = "Hello World", color = Color.Red, fontSize = 50.sp, fontWeight = FontWeight.Bold)
    }
}
#include <iostream>
using namespace std;

void countSort(int arr[], int n, int exponent) 
{
    int output[n];       //output array
    int count[10] = {0}; //count array to store count of occurrences of digits

    //store count of occurrences of digits
    for (int i = 0; i < n; i++)
        count[(arr[i] / exponent) % 10]++;

    //change count[i] so that count[i] contains the actual position of this digit in output[]
    for (int i = 1; i < 10; i++)
        count[i] += count[i - 1];

    //building output array
    for (int i = n - 1; i >= 0; i--) 
    {
        output[count[(arr[i] / exponent) % 10] - 1] = arr[i];
        count[(arr[i] / exponent) % 10]--;
    }

    //copy output array to arr[], so that arr[] now contains sorted numbers according to current digit
    for (int i = 0; i < n; i++)
        arr[i] = output[i];
}

void radixSort(int arr[], int n) 
{
    //find maximum number to know number of digits
    int max = arr[0];
    for (int i = 1; i < n; i++)
        if (arr[i] > max)
            max = arr[i];

    //do counting sort for every digit
    for (int exponent = 1; max / exponent > 0; exponent *= 10)
        countSort(arr, n, exponent);
}

void processRadixSort(int arr[], int n) 
{
    if (n > 1)
        radixSort(arr, n);
}

void displayArray(int arr[], int n) {
    for (int i = 0; i < n; i++) {
        cout << arr[i] << " ";
    }
    cout << endl;
}

// Function to dynamically allocate an array and fill it with random values.
void fillDynamicArrayWithRandomValues(int** arr, int* n) {
    cout << "Enter the size of the array: ";
    cin >> *n;
    *arr = new int[*n];
    srand(time(0)); // Seed for random number generation
    for (int i = 0; i < *n; i++) {
        (*arr)[i] = rand() % 1000; // Fill with random numbers between 0 and 999
    }
}

int main() {
    int* arr;
    int n;
    fillDynamicArrayWithRandomValues(&arr, &n);
    cout << "Unsorted array: ";
    displayArray(arr, n);
    processRadixSort(arr, n);
    cout << "Sorted array: ";
    displayArray(arr, n);
    delete[] arr; // Deallocate dynamically allocated memory
    return 0;
}
#include "L298N_MotorDriver.h"

// Make a motor object 
// Arduino Pin 3 ( pin must have PWM capability), 
//   is connected to the driver board pin EN (enable)
// Arduino Pin 2, is connected to the driver board pin IN1 (H-bridge path 1)
// Arduino Pin 4, is connected to the driver board pin IN2 (H-bridge path 2)
// Set the pins for one motor which uses this dual driver board.
L298N_MotorDriver motor(3,2,4);

// Define the Pin on which the potentiometer is connected
int potiPin = A0;

void setup() {
  
  pinMode(potiPin, INPUT);
  
  motor.setDirection(false);   // Sets the direction ( depending on the wiring ) 
  motor.enable();              // Turns the motor on
}

void loop() {

	// Read the voltage value of the potentiometer
	int potiValue = analogRead(potiPin);
	
	// We need to scale the potiValue down, so we are in a valid speed range
	byte speed = map(potiValue, 0, 1024, 0, 255);
	
	// Sets the speed for the motor. 0 - 255
	motor.setSpeed(speed);      

	
	delay(20);
}
#include <iostream>
using namespace std;

int partition(int arr[], int low, int high) 
{
    int pivot = arr[high]; //pivot element
    int i = (low - 1); //index of smaller element

    for (int j = low; j <= high - 1; j++) 
    {
        if (arr[j] <= pivot) 
        {
            i++; //increment index of smaller element
            swap(arr[i], arr[j]);
        }
    }
    
    swap(arr[i + 1], arr[high]);
    return (i + 1);
}

void quickSort(int arr[], int low, int high) 
{
    if (low < high) 
    {
        //partition the array
        int pi = partition(arr, low, high);

        //recursively sort elements before and after partition
        quickSort(arr, low, pi - 1);
        quickSort(arr, pi + 1, high);
    }
}

void processQuickSort(int arr[], int n) 
{
    if (n > 1) 
        quickSort(arr, 0, n - 1);
}


void displayArray(int arr[], int n) {
    for (int i = 0; i < n; i++) {
        cout << arr[i] << " ";
    }
    cout << endl;
}

// Function to dynamically allocate an array and fill it with random values.
void fillDynamicArrayWithRandomValues(int** arr, int* n) {
    cout << "Enter the size of the array: ";
    cin >> *n;
    *arr = new int[*n];
    srand(time(0)); // Seed for random number generation
    for (int i = 0; i < *n; i++) {
        (*arr)[i] = rand() % 1000; // Fill with random numbers between 0 and 999
    }
}

int main() {
    int* arr;
    int n;
    fillDynamicArrayWithRandomValues(&arr, &n);
    cout << "Unsorted array: ";
    displayArray(arr, n);
    processQuickSort(arr, n);
    cout << "Sorted array: ";
    displayArray(arr, n);
    delete[] arr; // Deallocate dynamically allocated memory
    return 0;
}
////////////////**************OBJECTS IN JS **********////////////////////


//// singleton  (all constructors are singleton)


// object literals  are not singleton

const mySym = Symbol("key1")
 
const jsUser ={
    name: "hitesh", "full name": "Hitesh chaudhary",
    age: 18 ,
    [mySym] : "mykey1",
    location: "jaipur ",
    email: "den@gmail.com",
    isLoggedIn: false,
    lastLoginDays: ["monday","saturday"]
}

console.log(jsUser.email); //den@gmail.com
console.log(jsUser["email"]);//den@gmail.com
console.log(jsUser["full name"]);//Hitesh chaudhary
console.log(jsUser[mySym]);// mykey1


jsUser.email = "chatgpt@gmail.com " /// editing by just overriding it 
console.log(jsUser.email); //chatgpt@gmail.com 

// Object.freeze(jsUser); // it will lock all the value assinged 

 // function in js 
 jsUser.greeting = function() {
     console.log("hello js user");
 }
 
 console.log(jsUser.greeting()); // hello js user   
  console.log(jsUser.greeting); // [Function (anonymous)]
  
  
 jsUser.greeting2 = function() {
     console.log(`hello js user ${this.name}`);
 }
  console.log(jsUser.greeting2()); // hello js user hitesh
  console.log(jsUser.greeting2); // [Function (anonymous)]
Route::get('/test', function() {
    return response()->json([
        'message' => 'مرحباً بك في API التجريبي',
        'status' => 'success',
        'timestamp' => now(),
        'data' => [
            'items' => [
                ['id' => 1, 'name' => 'عنصر 1'],
                ['id' => 2, 'name' => 'عنصر 2'],
                ['id' => 3, 'name' => 'عنصر 3']
            ]
        ]
    ]);
});

Route::post('/test', function(Request $request) {
    return response()->json([
        'message' => 'تم استلام البيانات بنجاح',
        'received_data' => $request->all(),
        'timestamp' => now()
    ], 201);
});
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " :sunny::sunflower: What's on this week! :sunflower::sunny:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Let's make this week a great one :yellow_heart:! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-29: Tuesday, 29th October",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from *HotBlack Coffee*\n:pancakes: *Breakfast*: Provided by *Goat Coffee Co.* at *9:00 am* \n:learning-result: *Machine Learning Talk Series* hosted by *Leah* @ *12:00 pm*, treats would be provided! "
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Thursday, 31st October",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from *HotBlack Coffee*\n:coffee-ok: *HotBlack Free Event*: *Pour-over* (one of the coffee brewing methods) demonstration with KOGU. This is a great opportunity to *try the equipments and also taste different types of coffee/tea side by side*.\n :lunch: *Lunch*: Provided by *Pukka* at *12 pm* in the Kitchen \n:pumpkin:*Monthly Social*: Pumpkin Carving @ *3:30pm*, please accept the calendar invite if you would be attending."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Get ready to Boost your workdays!\n\nLove,\nWX :wx:"
			}
		}
	]
}
// Online Java Compiler
// Use this editor to write, compile and run your Java code online

class HelloWorld {
    public static void main(String[] args) {
        int n=4;
        for (int i=1; i<=n; i++){
            for(int j=i; j<=n; j++){
                System.out.print(" ");
            }
            for(int j=1; j<i; j++){
                System.out.print("*");
            }
            for(int j=1; j<=i; j++){
                System.out.print("*");
            }
            System.out.println(" ");
            
        }
                for(int i=1; i<=n; i++){
            for(int j=1; j<=i; j++){
                System.out.print(" ");
            }
            for(int j=i; j<n; j++ ){
                System.out.print("*");
            }
            for(int j=i; j<=n; j++ ){
                System.out.print("*");
            }
            System.out.println();
        }
       
}
}
package com.example.helloworld

import android.graphics.Color
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import com.example.helloworld.ui.theme.HelloworldTheme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            HelloWorld()
        }
    }
}

@Composable
fun HelloWorld(){
    Box(
        modifier = Modifier.fillMaxSize(),
        contentAlignment = Alignment.Center
    ) {
        Text(text = "Hello World", fontWeight = FontWeight.Bold, color = androidx.compose.ui.graphics.Color.Red)
    }
}
Data entity methods in d365fo



mapEntityToDataSource
// This method is hitting while updating and inserting
// we can assign datasource1 recid values to child data source.
// 
public void mapEntityToDataSource(DataEntityRuntimeContext _entityCtx, 
                                DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
if (_entityCtx.getDatabaseOperation() == DataEntityDatabaseOperation::Insert 
    || _entityCtx.getDatabaseOperation() == DataEntityDatabaseOperation::Update)
{
    if (_dataSourceCtx.name() == dataEntityDataSourceStr(MyEntity, MyDataSource))
    {

        TestCustomer     testCustomer = _entityCtx.getRuntimeContextByName(
                                            dataEntityDataSourceStr(MyEntity,
                                                        TestCustomer)).getBuffer();

        this.CustomerRecid = testCustomer.recid;
    }
}
    super(_entityCtx, _dataSourceCtx);
}
-------------------------------------------------------------------------------------------------------------

postGetStagingData 
// After inserting into staging this method will trigger
// Ref: LedgerJournalEntity
public static void postGetStagingData(DMFDefinitionGroupExecution 
                                _dmfDefinitionGroupExecution) 
{
MyStaging     staging;

ttsbegin;

while select forupdate staging
    where staging.DefinitionGroup == _dmfDefinitionGroupExecution.DefinitionGroup
        && staging.ExecutionId == _dmfDefinitionGroupExecution.ExecutionId
        && staging.TransferStatus == DMFTransferStatus::NotStarted
{
    staging.Field1  = staging.Field2 + '-' + staging.Field3;
    staging.Field4  = staging.Field5;
    staging.update();
} 

    /*update_recordset staging
        setting OperationalEntityId   = curExt()
        where staging.DefinitionGroup   == _dmfDefinitionGroupExecution.DefinitionGroup
           && staging.ExecutionId       == _dmfDefinitionGroupExecution.ExecutionId
           && staging.TransferStatus    == DMFTransferStatus::NotStarted;*/


ttscommit;
}
-------------------------------------------------------------------------------------------------------------

postTargetProcess 
//  Executes the logic once after processing the target data.

public static void postTargetProcess(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution)
{

    if (_dmfDefinitionGroupExecution.StagingStatus == DMFBatchJobStatus::Finished)
    {
       MyStaging     staging;

       ttsbegin;

       while select forupdate staging
            where staging.DefinitionGroup == _dmfDefinitionGroupExecution.DefinitionGroup
            && staging.ExecutionId == _dmfDefinitionGroupExecution.ExecutionId
            && staging.TransferStatus == DMFTransferStatus::Completed
    {
        staging.Field1  = staging.Field2 + '-' + staging.Field3;
        staging.Field4  = staging.Field5;
        staging.update();
    } 


    /*update_recordset staging
        setting OperationalEntityId   = curExt()
        where staging.DefinitionGroup   == _dmfDefinitionGroupExecution.DefinitionGroup
           && staging.ExecutionId       == _dmfDefinitionGroupExecution.ExecutionId
           && staging.TransferStatus    == DMFTransferStatus::Completed;*/


    ttscommit;
}

---------------------------------------------------------------------------------

validateWrite
// Validate the each line.
// LedgerJournalEntity
public boolean validateWrite()
{
boolean isValid = super();

// Your logic

return isValid;
}
-------------------------------------------------------------------------------------------------------------

validateDelete 
// Validate the each line.
// LedgerJournalEntity
public boolean validateDelete()
{
boolean isValid = super();

// Your logic

return isValid;
}
-------------------------------------------------------------------------------------------------------------

persistEntity 
//Skip validate field code written in this method
//Reference : LogisticsPostalAddressElectronicContactV2Entity
public void persistEntity(DataEntityRuntimeContext _entityCtx)
{
_entityCtx.getEntityRecord().skipDataSourceValidateField(
                fieldNum(ElectronicContactsEntity, Location), true);
    
super(_entityCtx);
}
-------------------------------------------------------------------------------------------------------------

initValue 
// Assign default values
// WE can assign number sequence also.
// SMMContactPersonV2Entity
public void initValue()
{
if (!this.skipNumberSequenceCheck())
{
    NumberSeqRecordFieldHandler::enableNumberSequenceControlForField(
        this, fieldNum(PIDInvestigatorContactPersonEntity, ContactPersonId), 
                                    ContactPerson::numRefContactPersonId());
}

this.ContactForParty = Parameters::find().ContactForParty;

super();
}
-------------------------------------------------------------------------------------------------------------

  initializeEntityDataSource
// Assign values to some fields based on some field values.
//Reference : LogisticsPostalAddressElectronicContactV2Entity
public void initializeEntityDataSource(DataEntityRuntimeContext _entityCtx, 
                                    DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
    
if (_dataSourceCtx.name() == dataEntityDataSourceStr(MyEntity, MyDataSource))
{
    ContactPerson       contactPerson = ContactPerson::find(this.contactPersonId);

    if (this.LocationId == '')
    {
        DirPartyLocation    dirPartyLocation = DirPartyLocation::findOrCreate(
                                                contactPerson.party, false);
        LogisticsLocation   logisticsLocation = LogisticsLocation::find(
                                                    dirPartyLocation.Location);
        
        this.LocationId = logisticsLocation.LocationId;
        this.Location   = logisticsLocation.RecId;
        this.Party      = contactPerson.party;

        _dataSourceCtx.setBuffer(logisticsLocation);//set buffer
    }
}
if (_dataSourceCtx.name() == dataEntityDataSourceStr(MyEntity, MyDataSource1))
{
    DirPartyLocation    dirPartyLocationNew = 
        DirPartyLocation::findByPartyLocation(this.Party, this.Location);

    _dataSourceCtx.setBuffer(dirPartyLocationNew);
}
    
super(_entityCtx, _dataSourceCtx);
}
-------------------------------------------------------------------------------------------------------------

insertEntityDataSource 
// While inserting into target
//Reference :InventOperationalSiteV2Entity
public boolean insertEntityDataSource(DataEntityRuntimeContext _entityCtx, 
                        DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
    boolean ret;
    
    if (_dataSourceCtx.name() == 
            dataEntityDataSourceStr(InventOperationalSiteV2Entity, ReqSitePolicy))
    {
        _dataSourceCtx.setDatabaseOperation(DataEntityDatabaseOperation::Insert);

    }
    
    ret = super(_entityCtx, _dataSourceCtx);

    return ret;

}
-------------------------------------------------------------------------------------------------------------

    updateEntityDataSource:
// While updating into target
//Reference :InventOperationalSiteV2Entity
public boolean updateEntityDataSource(DataEntityRuntimeContext _entityCtx, 
                        DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
    boolean ret;

    ret = super(_entityCtx, _dataSourceCtx);

    return ret;
}
//First download images from this url: "https://github.com/google-developer-training/basic-android-kotlin-compose-training-dice-roller/raw/main/dice_images.zip"
//Then extract it
//Now come to android studio
//In Android Studio, click View > Tool Windows > Resource Manager.
//Click + > Import Drawables to open a file browser.
//Click Next.
//Click Import to confirm that you want to import the six images.


package com.example.diceroller

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.diceroller.ui.theme.DicerollerTheme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            DiceRoller()
        }
    }
}

@Composable
fun DiceRoller(modifier: Modifier = Modifier){
    var result by remember { mutableStateOf(1) }

    val imageResource = when(result){
        1 -> R.drawable.dice_1
        2 -> R.drawable.dice_2
        3 -> R.drawable.dice_3
        4 -> R.drawable.dice_4
        5 -> R.drawable.dice_5
        else -> R.drawable.dice_6
    }

    Column(
        modifier = modifier.fillMaxSize(),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    ){
        Image(painter = painterResource(imageResource), contentDescription = result.toString())
        Spacer(modifier = Modifier.height(16.dp))
        Button(onClick = {result = (1..6).random()}){
            Text(text = "Roll  Dice")
        }
    }
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Xero Boost Days What's on! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Milton Keynes! \n\n We're excited to kickstart another great week in the office with our new Boost Day Program! :zap: \n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-29: Tuesday, 29th October",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café-style beverages with *Out Of Office Coffee*, (Please bring your Xero ID to claim your free coffee)\n:Curry: *Lunch*: Thai Curry Bar provided by *I Love Catering* from *12:00PM - 1:00PM* in the 5th floor Kitchen.\n:Fitness:*Wellbeing*: Body Tone class, please reach out directly to Zoe Houston for more details! "
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Wednesday, 30th October",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café-style beverages with *Out Of Office Coffee* (Please bring your Xero ID to claim your free coffee)\n:Bagel: *Breakfast*: Breakfast bagels and fruit Provided by *I Love Catering* from *8:30AM - 9:30AM* in the 5th floor Kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*ALSO THIS WEEK:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Wednesday, 30th October*\n :blob-party: *Social +*:beers:*Join the Oktoberfest fun at 4pm!*:beers: Get ready to raise your steins and celebrate Oktoberfest with us! :tada: From the epic Pretzel Toss :pretzel: to testing your knowledge with Oktoberfest Trivia :brain: and even guessing the weight of the giant sausage :hotdog: - we’ve got it all! Bring your A-game because prizes are up for grabs! :gift: :beer:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
import { Injectable, Logger, HttpException, HttpStatus } from '@nestjs/common';
import { Cron, CronExpression } from '@nestjs/schedule';
import axios from 'axios';
import { ConfigService } from '@nestjs/config';
import { OrderService } from './order.service';
import { CreateOrderDto } from 'src/dto/create-order.dto';

@Injectable()
export class OrderPollingService {
  private readonly spotwareApiUrl: string;
  private readonly apiToken: string;
  private readonly logger = new Logger(OrderPollingService.name);

  constructor(
    private readonly configService: ConfigService,
    private readonly orderService: OrderService,
  ) {
    this.spotwareApiUrl = `${this.configService.get<string>('SPOTWARE_API_URL')}`;
    this.apiToken = this.configService.get<string>('SPOTWARE_API_TOKEN');
  }

  @Cron(CronExpression.EVERY_MINUTE)
  async pollPositions() {
    this.logger.log('Polling for open and closed positions...');
    try {
      const openPositions = await this.fetchOpenPositions();
      const closedPositions = await this.fetchClosedPositions();

      await this.updateXanoWithPositions(openPositions, closedPositions);
    } catch (error) {
      this.logger.error(`Error polling positions: ${error.message}`);
    }
  }

  private async fetchOpenPositions() {
    try {
      const response = await axios.get(`${this.spotwareApiUrl}/v2/webserv/openPositions`, {
        headers: { Authorization: `Bearer ${this.apiToken}` },
        params: { token: this.apiToken },
      });
      this.logger.log('Fetched open positions from Spotware');
      console.log('Open Positions Data:', response.data);
      return this.parseCsvData(response.data);
    } catch (error) {
      this.logger.error(`Failed to fetch open positions: ${error.message}`);
      throw new HttpException('Failed to fetch open positions', HttpStatus.FORBIDDEN);
    }
  }

  private async fetchClosedPositions() {
    const now = new Date();
    const to = now.toISOString();
    const from = new Date(now.getTime() - 2 * 24 * 60 * 60 * 1000).toISOString(); // 2-day range

    try {
      const response = await axios.get(`${this.spotwareApiUrl}/v2/webserv/closedPositions`, {
        headers: { Authorization: `Bearer ${this.apiToken}` },
        params: { from, to, token: this.apiToken },
      });
      this.logger.log('Fetched closed positions from Spotware');
      console.log('Closed Positions Data:', response.data);
      return this.parseCsvData(response.data);
    } catch (error) {
      this.logger.error(`Failed to fetch closed positions: ${error.message}`);
      throw new HttpException('Failed to fetch closed positions', HttpStatus.FORBIDDEN);
    }
  }

  private parseCsvData(csvData: string): any[] {
    const rows = csvData.split('\n').slice(1); // Skip header row
    return rows
      .filter((row) => row.trim())
      .map((row) => {
        const columns = row.split(',');
        return {
          login: columns[0],
          positionId: columns[1],
          openTimestamp: columns[2],
          entryPrice: columns[3],
          direction: columns[4],
          volume: columns[5],
          symbol: columns[6],
          commission: columns[7],
          swap: columns[8],
          bookType: columns[9],
          stake: columns[10],
          spreadBetting: columns[11],
          usedMargin: columns[12],
        };
      });
  }

  private async updateXanoWithPositions(openPositions: any[], closedPositions: any[]) {
    for (const pos of openPositions) {
      const openOrderData: CreateOrderDto = this.mapOpenPositionToOrderDto(pos);
      try {
        // Only create if the order does not exist
        const existingOrder = await this.orderService.findOrderByTicketId(openOrderData.ticket_id);
        if (!existingOrder) {
          await this.orderService.createOrder(openOrderData);
          this.logger.log(`New open order created in Xano: ${JSON.stringify(openOrderData)}`);
        }
      } catch (error) {
        this.logger.error(`Failed to create open position in Xano: ${error.message}`);
      }
    }

    for (const pos of closedPositions) {
      const closedOrderData: CreateOrderDto = this.mapClosedPositionToOrderDto(pos);
      try {
        // Only update close details if order exists
        const existingOrder = await this.orderService.findOrderByTicketId(closedOrderData.ticket_id);
        if (existingOrder) {
          await this.orderService.updateOrderWithCloseData(closedOrderData);
          this.logger.log(`Closed order updated in Xano: ${JSON.stringify(closedOrderData)}`);
        }
      } catch (error) {
        this.logger.error(`Failed to update closed position in Xano: ${error.message}`);
      }
    }
  }

  private mapOpenPositionToOrderDto(position: any): CreateOrderDto {
    return {
      key: position.positionId.toString(),
      ticket_id: Number(position.positionId),
      account: Number(position.login),
      type: position.direction,
      symbol: position.symbol,
      volume: parseFloat(position.volume),
      entry_price: parseFloat(position.entryPrice),
      entry_date: position.openTimestamp,
      broker: 'Spotware',
      open_reason: position.bookType || 'AUTO',
    };
  }

  private mapClosedPositionToOrderDto(position: any): CreateOrderDto {
    return {
      key: position.positionId.toString(),
      ticket_id: Number(position.positionId),
      account: Number(position.login),
      type: position.direction,
      symbol: position.symbol,
      volume: parseFloat(position.volume),
      entry_price: parseFloat(position.entryPrice),
      entry_date: position.openTimestamp,
      close_price: parseFloat(position.closePrice),
      close_date: position.closeTimestamp,
      profit: parseFloat(position.pnl),
      broker: 'Spotware',
      open_reason: position.bookType || 'AUTO',
      close_reason: 'AUTO',
    };
  }
}
import numpy as np
from typing import Tuple


def find_baseline(mask: np.ndarray) -> Tuple[
                Tuple[int, int], Tuple[int, int]]:
    """Funkcja wyznacza punkty baseline na podstawie carti i bony roof.
    Algorytm znajduje najbardziej wysunięty na prawo punkt carti roof i na
    jego współrzędnej x +1 definiuje początek prawego punktu. Współrzędna y
    prawego punktu to współrzędna y bony roof na górnym obrysie na podanej
    współrzędnej x. Jeżeli dochodzi do wypadku gdzie carti roof jest dłuższe
    w poziomie od bony roof, to jako prawy punkt ustalany jest najbardziej
    wysunięty punkt górnego obrysu bony roof. Następnie szukana jest linia,
    posiadająca największe pokrycie z górnym obrysem bony roof. Do obliczania
    pokrycia pomijany jest górny obrys znajdujący się po prawo od wyznaczonego
    prawego punktu. Jako lewy punkt funkcja obiera ostatni punkt linii
    z największym pokryciem znajdujący się na górnym obrysie.

    Args:
        mask (np.ndarray): maska w formacie png

    Returns:
        Tuple[Tuple[int, int], Tuple[int, int]]: współrzędne prawego i lewego
                                                                punktu baseline
    """
    height, width = mask.shape
    label_upper_contour_bony = 5  # bony roof
    label_upper_contour_carti = 4  # cartilagineous roof

    binary_mask_bony = (mask == label_upper_contour_bony).astype(np.uint8)
    binary_mask_carti = (mask == label_upper_contour_carti).astype(np.uint8)

    upper_contour_bony = [
        (x, np.where(binary_mask_bony[:, x])[0][0]) for x in range(width)
        if np.any(binary_mask_bony[:, x])
    ]

    x_max_carti = max((x for x in range(width) if np.any(
        binary_mask_carti[:, x])), default=-1
        )
    if x_max_carti == -1:
        return (None, None), (None, None)

    # Ustalanie prawego punktu na podstawie przesunięcia
    rightmost_point_x = x_max_carti + 1
    if rightmost_point_x >= width or not upper_contour_bony:
        return (None, None), (None, None)

    bony_point_y = next(
        (y for x, y in upper_contour_bony if x == rightmost_point_x), None
    )
    if bony_point_y is None:
        rightmost_point_x, bony_point_y = upper_contour_bony[-1]

    # Wstępny punkt prawy przed przesunięciem
    original_rightmost_point = (rightmost_point_x, bony_point_y)

    best_line = []
    max_overlap = 0
    best_shift = 0  # Dodanie zmiennej do śledzenia najlepszego przesunięcia

    # Przechodzi przez każde przesunięcie od -10 do +5 pikseli
    for y0 in range(bony_point_y - 10, bony_point_y + 5):
        if not (0 <= y0 < height):
            continue
        current_shift = y0 - bony_point_y

        for angle in range(360):
            angle_rad = np.radians(angle)
            sin_angle = np.sin(angle_rad)
            cos_angle = np.cos(angle_rad)

            n = np.arange(2 * (width + height))
            x = rightmost_point_x + n * cos_angle
            y = y0 - n * sin_angle

            x_rounded = np.round(x).astype(int)
            y_rounded = np.round(y).astype(int)
            valid_mask = (x_rounded >= 0) & (x_rounded < width) & \
                         (y_rounded >= 0) & (y_rounded < height)

            line_points = list(
                zip(x_rounded[valid_mask], y_rounded[valid_mask])
                )

            overlap = len(
                set(line_points) &
                set(p for p in upper_contour_bony if p[0] <= rightmost_point_x)
            )

            if overlap > max_overlap:
                max_overlap = overlap
                best_line = line_points
                best_shift = current_shift

    adjusted_rightmost_point = (
        original_rightmost_point[0], original_rightmost_point[1] + best_shift
        )

    leftmost_point = None
    if best_line:
        for point in best_line:
            x, y = point
            if mask[y, x] == label_upper_contour_bony:
                if leftmost_point is None or x < leftmost_point[0]:
                    leftmost_point = (x, y)

    if leftmost_point is None:
        leftmost_point = (None, None)

    return adjusted_rightmost_point, leftmost_point
import { Injectable, HttpException, HttpStatus } from '@nestjs/common';
import axios from 'axios';
import { ConfigService } from '@nestjs/config';
import { CreateOrderDto } from 'src/dto/create-order.dto';
import { IOrder } from 'src/services/Interfaces/IOrder.interface';

@Injectable()
export class OrderService {
  private readonly xanoApiUrl: string;

  constructor(private readonly configService: ConfigService) {
    this.xanoApiUrl = `${this.configService.get<string>('XANO_API_URL')}`;
  }

  async createOrUpdateOrder(createOrderDto: CreateOrderDto): Promise<IOrder> {
    console.log('Sending to Xano:', createOrderDto);  // Log data before sending
    try {
      const response = await axios.post(this.xanoApiUrl, createOrderDto, {
        headers: {
          Authorization: `Bearer ${this.configService.get<string>('XANO_API_TOKEN')}`,
        },
      });
      console.log('Xano Response:', response.data); // Log Xano response
      return response.data;
    } catch (error) {
      console.error('Xano Error:', error.response?.data || error.message);
      throw new HttpException(
        `Failed to create or update order in Xano: ${error.message}`,
        HttpStatus.INTERNAL_SERVER_ERROR,
      );
    }
  }
  

  async getAllOrders(): Promise<IOrder[]> {
    try {
      const response = await axios.get(this.xanoApiUrl);
      return response.data;
    } catch (error) {
      throw new HttpException('Failed to retrieve orders from Xano', HttpStatus.INTERNAL_SERVER_ERROR);
    }
  }
}
import { Injectable, Logger, HttpException, HttpStatus } from '@nestjs/common';
import { Cron, CronExpression } from '@nestjs/schedule';
import axios from 'axios';
import { ConfigService } from '@nestjs/config';
import { OrderService } from './order.service';
import { CreateOrderDto } from 'src/dto/create-order.dto';

@Injectable()
export class OrderPollingService {
  private readonly spotwareApiUrl: string;
  private readonly apiToken: string;
  private readonly logger = new Logger(OrderPollingService.name);

  constructor(
    private readonly configService: ConfigService,
    private readonly orderService: OrderService,
  ) {
    this.spotwareApiUrl = `${this.configService.get<string>('SPOTWARE_API_URL')}`;
    this.apiToken = this.configService.get<string>('SPOTWARE_API_TOKEN');
  }

  // Poll Spotware API every minute
  @Cron(CronExpression.EVERY_MINUTE)
  async pollPositions() {
    this.logger.log('Polling for open and closed positions...');
    try {
      const openPositions = await this.fetchOpenPositions();
      const closedPositions = await this.fetchClosedPositions();

      // Process and push positions data to Xano
      await this.updateXanoWithPositions(openPositions, closedPositions);
    } catch (error) {
      this.logger.error(`Error polling positions: ${error.message}`);
    }
  }

  private async fetchOpenPositions() {
    try {
      const response = await axios.get(`${this.spotwareApiUrl}/v2/webserv/openPositions`, {
        headers: { Authorization: `Bearer ${this.apiToken}` },
        params: { token: this.apiToken },
      });
      this.logger.log('Fetched open positions from Spotware');
      console.log('Open Positions Data:', response.data);
      return this.parseCsvData(response.data);
    } catch (error) {
      this.logger.error(`Failed to fetch open positions: ${error.message}`);
      throw new HttpException('Failed to fetch open positions', HttpStatus.FORBIDDEN);
    }
  }

  private async fetchClosedPositions() {
    const now = new Date();
    const to = now.toISOString();
    const from = new Date(now.getTime() - 2 * 24 * 60 * 60 * 1000).toISOString(); // 2-day range

    try {
      const response = await axios.get(`${this.spotwareApiUrl}/v2/webserv/closedPositions`, {
        headers: { Authorization: `Bearer ${this.apiToken}` },
        params: { from, to, token: this.apiToken },
      });
      this.logger.log('Fetched closed positions from Spotware');
      console.log('Closed Positions Data:', response.data);
      return this.parseCsvData(response.data);
    } catch (error) {
      this.logger.error(`Failed to fetch closed positions: ${error.message}`);
      throw new HttpException('Failed to fetch closed positions', HttpStatus.FORBIDDEN);
    }
  }

  // Parse CSV data from Spotware response
  private parseCsvData(csvData: string): any[] {
    const rows = csvData.split('\n').slice(1); // Skip header row
    return rows
      .filter((row) => row.trim())
      .map((row) => {
        const columns = row.split(',');
        return {
          login: columns[0],
          positionId: columns[1],
          openTimestamp: columns[2],
          entryPrice: columns[3],
          direction: columns[4],
          volume: columns[5],
          symbol: columns[6],
          commission: columns[7],
          swap: columns[8],
          bookType: columns[9],
          stake: columns[10],
          spreadBetting: columns[11],
          usedMargin: columns[12],
        };
      });
  }

  private async updateXanoWithPositions(openPositions: any[], closedPositions: any[]) {
    // Process each open position
    for (const pos of openPositions) {
      const openOrderData: CreateOrderDto = this.mapOpenPositionToOrderDto(pos);
      try {
        // Log the payload for inspection
        console.log('Open Position Payload for Xano:', openOrderData);
        await this.orderService.createOrUpdateOrder(openOrderData);
        this.logger.log(`Open Position sent to Xano: ${JSON.stringify(openOrderData)}`);
      } catch (error) {
        this.logger.error(`Failed to send open position to Xano: ${error.message}`);
      }
    }

    // Process each closed position
    for (const pos of closedPositions) {
      const closedOrderData: CreateOrderDto = this.mapClosedPositionToOrderDto(pos);
      try {
        // Log the payload for inspection
        console.log('Closed Position Payload for Xano:', closedOrderData);
        await this.orderService.createOrUpdateOrder(closedOrderData);
        this.logger.log(`Closed Position sent to Xano: ${JSON.stringify(closedOrderData)}`);
      } catch (error) {
        this.logger.error(`Failed to send closed position to Xano: ${error.message}`);
      }
    }
  }

  private mapOpenPositionToOrderDto(position: any): CreateOrderDto {
    return {
      key: position.positionId.toString(),
      ticket_id: Number(position.positionId),
      account: Number(position.login),
      type: position.direction,
      symbol: position.symbol,
      volume: parseFloat(position.volume),  // Ensure volume is a number
      entry_price: parseFloat(position.entryPrice),
      entry_date: position.openTimestamp,
      broker: 'Spotware',
      open_reason: position.bookType || 'AUTO',
    };
  }
  
  private mapClosedPositionToOrderDto(position: any): CreateOrderDto {
    return {
      key: position.positionId.toString(),
      ticket_id: Number(position.positionId),
      account: Number(position.login),
      type: position.direction,
      symbol: position.symbol,
      volume: parseFloat(position.volume),
      entry_price: parseFloat(position.entryPrice),
      entry_date: position.openTimestamp,
      close_price: parseFloat(position.closePrice),
      close_date: position.closeTimestamp,
      profit: parseFloat(position.pnl),
      broker: 'Spotware',
      open_reason: position.bookType || 'AUTO',
      close_reason: 'AUTO',
    };
  }
  
  

}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Xero Boost Days- What's on! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Manchester! \n\n We're excited to kickstart another great week in the office with our new Boost Day Program! :zap: \n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-29: Tuesday, 29th October",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café-style beverages with *Ditto Coffee*, located at 61, Oxford Street, M1 6EQ and now also at Union, Albert Square, M2 6LW. (Please show your Xero ID to claim your free coffee)\n:breakfast: *Breakfast*: Provided by *Balance Kitchen* from *8:30AM* in the kitchen area. \n:man_in_lotus_position: *Reflexology*: From *2:30pm* in the Wellbeing room. Please book here to reserve your slot-<https://docs.google.com/document/d/1Q6y9U-XSPMnzbtTuDUDuxUJMET-GeIyT/edit>."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Wednesday, 30th October",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café-style beverages with *Ditto Coffee*, located at 61 Oxford Street, M1 6EQ and now also at Union, Albert Square, M2 6LW. (Please bring your Xero ID to claim your free coffee)\n:cake: *Afternoon Tea*: Provided by *Balance Kitchen* from *2:30PM* in the kitchen area."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Wednesday, 30th October",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":blob-party:* Social+*:beers: *Join the Oktoberfest fun at 4pm!*:beers:\nGet ready to raise your steins and celebrate Oktoberfest with us! :tada:\nFrom the epic Pretzel Toss :pretzel: to testing your knowledge with Oktoberfest Trivia :brain: and even guessing the weight of the giant sausage :hotdog: - we’ve got it all! Bring your A-game because prizes are up for grabs! :gift: :beer: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Comms will be via this slack channel, get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
internal final class TI_TestProcu
{
    /// <summary>
    /// Class entry point. The system will call this method when a designated menu 
    /// is selected or when execution starts and this class is set as the startup class.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
      // 1st part is working fine
        AgreementLine   AgreementLine;
        select AgreementLine where AgreementLine.RecId == 5637407089;
        
        LedgerDimensionAccount LedgerDimensionAccount = LedgerDimensionFacade::serviceCreateLedgerDimension(
            LedgerDefaultAccountHelper::getDefaultAccountFromMainAccountRecId(
            MainAccount::findByMainAccountId('210106'/*'610101'*/).RecId),
            AgreementLine.DefaultDimension);
        LedgerJournalTrans  LedgerJournalTrans;
        select forupdate LedgerJournalTrans where LedgerJournalTrans.Voucher == 'GEN-005903';
        LedgerJournalTrans.LedgerDimension = LedgerDimensionAccount;
        ttsbegin;
        LedgerJournalTrans.update();
        ttscommit;
///---------------------------

        int hcount, hidx;
        RecId   dimAttrId_mainAcc;
        LedgerRecId ledgerRecId;
        MainAccount MainAccount;
        RefRecId    recValue;
        DimensionAttribute      DimensionAttribute;
        DimensionAttributeValue DimensionAttributeValue;
        DimensionSetSegmentName DimensionSetSegmentName;
        DimensionStorage        DimensionStorage;
        LedgerAccountContract   LedgerAccountContract = new LedgerAccountContract();
        DimensionAttributeValueContract DimensionAttributeValueContract;
        List valueContracts = new List(Types::Class);
        DimensionAttributeValueCombination  combina;

        MainAccount =  MainAccount::findByMainAccountId('210106');
        recValue = DimensionHierarchy::getAccountStructure(MainAccount.RecId, Ledger::current());
        hcount = DimensionHierarchy::getLevelCount(recValue);
        DimensionSetSegmentName = DimensionHierarchyLevel::getDimensionHierarchyLevelNames(recValue);
        info(strFmt("%1", hcount));
        str value;
        DimensionAttributeValueSetStorage dimStorage;
        dimStorage = DimensionAttributeValueSetStorage::find(AgreementLine.DefaultDimension);
        for(hidx=1; hidx<=hcount; hidx++)
        {
            DimensionAttribute = DimensionAttribute::findByLocalizedName(DimensionSetSegmentName[hidx]);
            value = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName(DimensionAttribute.Name).RecId);

            //if(DimensionAttribute)
            //{
            //    DimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(
            //        DimensionAttribute,
            //        conPeek(

            //}
        }
        //AgreementLine   AgreementLine;
        //select AgreementLine where AgreementLine.RecId == 5637407089;
        //DimensionAttributeValueSetStorage dimStorage;
        //dimStorage = DimensionAttributeValueSetStorage::find(AgreementLine.DefaultDimension);
        //str budget = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName('BudgetCode').RecId);
        //str Department = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName('Department').RecId);
        //str General = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName('General').RecId);
        //str Vendor = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName('Vendor').RecId);
        //str Worker = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName('Worker').RecId);
        //info(strFmt("%1 %2 %3 %4 %5", budget, Department, General, Vendor, Worker));

        //MainAccount =  MainAccount::findByMainAccountId('610101');
        //recValue = DimensionHierarchy::getAccountStructure(MainAccount.RecId, Ledger::current());
        //hcount = DimensionHierarchy::getLevelCount(recValue);
        //DimensionSetSegmentName = DimensionHierarchyLevel::getDimensionHierarchyLevelNames(recValue);
        //info(strFmt("%1", hcount));

        //for(hidx=1; hidx<=hcount; hidx++)
        //{
        //    DimensionAttribute = DimensionAttribute::findByLocalizedName(DimensionSetSegmentName[hidx]);
        //    info(DimensionAttribute.Name);
        //}
    }

}
a45dcf4d522de183cc9943a83bd7882b44de76b4
a45dcf4d522de183cc9943a83bd7882b44de76b4
////////*********** ARRAY PART 2 IN JS  ******//////////////////

 const marvel_hero = ["thor","Ironman","Spiderman"]
 const dc_hero =["superman","flash", "batman"]
  
//******************PUSH FUNCTION//////////////////////

//marvel_hero.push(dc_hero)
//console.log(marvel_hero); 
// OUTPUT = [ 'thor', 'Ironman', 'Spiderman', [ 'superman', 'flash', 'batman' ] ]
//console.log(marvel_hero[3][2]); // OUTPUT = batman 


//////////////////////CONACTINATIONN FUNCTION /////////////

//const all_heros = marvel_hero.concat(dc_hero) /// it will add both the array and give single array 
//console.log(all_heros); 
///OUTPUT = [ 'thor', 'Ironman', 'Spiderman', 'superman', 'flash', 'batman' ]


//////////////////////DROP FUNCTION ///////////////////////
const all_new_heroes = [...marvel_hero , ...dc_hero]
console.log(all_new_heroes); ///  drop function 
///OUTPUT = [ 'thor', 'Ironman', 'Spiderman', 'superman', 'flash', 'batman' ]

/////////////////////////FLAT FUNCTION ///////////////////////

const an_array = [1,2,3,[2,3],3,[4,5,[3,42]]]
const and_array = an_array.flat(Infinity); //function which flat all nested array in single array
console.log(and_array);



////////////////////////////OTHER FUNCTION of ARRAY ///////////////////////

console.log(Array.isArray('Hitesh')); /// ASKING WHETER IT IS OR NOT 
//// OUTPUT = FALSE 

console.log(Array.from('Hitesh'));///// CONVERTING INTO ARRAY 
//// OUTPUT = [ 'H', 'i', 't', 'e', 's', 'h' ]

console.log(Array.from({name:"hitesh"}))/// complex
//// OUTPUT = []

////////////////converting array from elements using Array.of function////////////

let score1 = 100
let score2 = 200
let score3 = 1300
console.log(Array.of(score1, score2 , score3));
/// OUTPUT = [ 100, 200, 1300 ]
  Args          salesArgs = new Args();  
   SalesInvoiceContract  salesInvoiceContract;  
   SalesInvoiceController controller;  
   SrsReportRunImpl    srsReportRunImpl;  
   str fileName;  
   CustInvoiceJour     custInvoiceJour;// = _args.record();  
     select custInvoiceJour where custInvoiceJour.InvoiceId=="INV_00000009";  
   salesArgs.record(custInvoiceJour);  
   controller       = new SrsReportRunController();  
   salesInvoiceContract  = new SalesInvoiceContract();  
   controller.parmReportName(ssrsReportStr(SalesInvoice,Report));  
   controller.parmShowDialog(false);  
   controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::Printer);  
   // controller.parmReportContract().parmPrintSettings().printerName(@"\\espprn03\Follow Me - MFP");  
   salesInvoiceContract.parmRecordId(custInvoiceJour.RecId); // Record id must be passed otherwise the report will be empty  
   salesInvoiceContract.parmCountryRegionISOCode(SysCountryRegionCode::countryInfo()); // comment this code if tested in pre release  
   controller.parmReportContract().parmRdpContract(salesInvoiceContract);  
   controller.startOperation();  
/////////////////*********ARRAYS IN JS*********///////////////
const arr =[0,1,2,3,4,5]
const heros = ["srk","sk", "akki"]

console.log(arr[1]);

const arr2 = new Array(1,2,3,4,5,5)
console.log(arr2[1]);

////////// array methodss/////////////////////


arr.push(6) /// adding elements in array 
arr.push(7)
console.log(arr); 

arr.pop()/// remove last element in array
console.log(arr);

arr.unshift(9) //// adding at first 
console.log(arr);

arr.shift() //// removed 9
console.log(arr);

console.log(arr.includes(9));/// boolean outcomes 
console.log(arr.indexOf(2));/// index at prsented elemensted

const newArr = arr.join()
console.log(newArr);/// prints without square braces  
console.log(typeof newArr); /// changes number into string beacuse we used join() method


//////// slice  method
console.log("a" , arr);

const myn1 = arr.slice(1,3) // 1 and 2 will be printed 
console.log("after slicing ",myn1);
console.log("original copy will be same as a " , arr); 
 

///////splice method
const myn2 = arr.splice(1,3) // 1 , 2 and 3  will be printed 
console.log("after splicing ",myn2);
console.log("splice elements will be deleted " , arr); ///it will deleted the splice part 

//// inportant for interview question !!!!!!!!!!!

/* the difference bw slicing and splicing 
slicing - will print 1 less than the final index and not effect the orginal copy..
spkicing - will print all the elements and delete all spliced elements from the original array*/
npm install three @types/three @react-three/fiber
//////////************ DATE AND TIME ****************///////////////


let myDate = new Date()
console.log(myDate);///2024-10-27T15:14:36.998Z
console.log(myDate.toString());///Sun Oct 27 2024 15:14:36 GMT+0000 (Coordinated Universal Time)
console.log(myDate.toDateString());////Sun Oct 27 2024
console.log(myDate.toISOString());////2024-10-27T15:14:36.998Z
console.log(myDate.toLocaleString());///10/27/2024, 3:14:36 PM 
console.log(myDate.toLocaleTimeString());////3:14:36 PM
console.log(typeof myDate); /// object


console.log(  "           new date       "   );
let myCreatedDate = new Date(2023 , 0, 23) //// in js months starts from 0 means 0=january 
console.log(myCreatedDate.toDateString()); ////Mon Jan 23 2023

let myCreatedDate2 = new Date(2023-01-23) //// in ddmmyy 1 = january in months 
console.log(myCreatedDate2.toDateString());

let myCreatedDate3 = new Date(01-41-2023) //// in mmddyy 1 = january in months 
console.log(myCreatedDate3.toDateString());

let myTimeStamp = Date.now()
console.log(myTimeStamp); 
console.log(myCreatedDate.getTime()); /// at time i started
console.log(Math.floor(Date.now()/1000));// converting in seconds and floor for gettting a acute time 


let newDate = new Date();
console.log(newDate.getMonth()+1);
console.log(newDate.getDay());


newDate.toLocaleString('default',{ //// for setting something as default setting
    weekday: "long"
    timeZone: ' '
})
star

Tue Oct 29 2024 21:05:18 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Tue Oct 29 2024 18:50:37 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Tue Oct 29 2024 18:17:43 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Tue Oct 29 2024 17:55:40 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Tue Oct 29 2024 17:18:04 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 17:09:30 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 16:52:27 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 16:39:17 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 15:29:40 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 15:21:05 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 13:35:36 GMT+0000 (Coordinated Universal Time)

@signup_returns #kotlin

star

Tue Oct 29 2024 13:03:33 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 12:38:30 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 12:28:26 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 12:12:22 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Oct 29 2024 09:40:12 GMT+0000 (Coordinated Universal Time)

@login123

star

Tue Oct 29 2024 09:14:55 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Tue Oct 29 2024 09:12:42 GMT+0000 (Coordinated Universal Time)

@kotlin

star

Tue Oct 29 2024 05:24:03 GMT+0000 (Coordinated Universal Time)

@Rohan@99

star

Tue Oct 29 2024 05:09:06 GMT+0000 (Coordinated Universal Time) https://www.coolmathgames.com/0-stack-game/play

@harshmanjhi12

star

Tue Oct 29 2024 05:07:24 GMT+0000 (Coordinated Universal Time) https://www.coolmathgames.com/0-stack-game

@harshmanjhi12

star

Tue Oct 29 2024 04:56:57 GMT+0000 (Coordinated Universal Time) https://github.com/KROIA/L298N_MotorDriver/tree/main

@shawngibson #arduino #motor

star

Tue Oct 29 2024 04:26:26 GMT+0000 (Coordinated Universal Time)

@Rohan@99

star

Mon Oct 28 2024 21:07:29 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Mon Oct 28 2024 20:54:02 GMT+0000 (Coordinated Universal Time)

@mebean #laravel #api #test #route #api.php

star

Mon Oct 28 2024 20:23:48 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Mon Oct 28 2024 17:23:57 GMT+0000 (Coordinated Universal Time)

@kervinandy123 #java

star

Mon Oct 28 2024 16:18:05 GMT+0000 (Coordinated Universal Time)

@signup_returns #kotlin

star

Mon Oct 28 2024 15:51:59 GMT+0000 (Coordinated Universal Time) https://kishoredynamics11.blogspot.com/2022/02/data-entity-methods-in-d365fo.html

@Manjunath

star

Mon Oct 28 2024 14:21:49 GMT+0000 (Coordinated Universal Time)

@signup_returns #kotlin

star

Mon Oct 28 2024 11:26:09 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Mon Oct 28 2024 10:12:40 GMT+0000 (Coordinated Universal Time)

@saurabhp643

star

Mon Oct 28 2024 10:02:44 GMT+0000 (Coordinated Universal Time)

@mateusz021202

star

Mon Oct 28 2024 08:37:20 GMT+0000 (Coordinated Universal Time)

@saurabhp643

star

Mon Oct 28 2024 08:36:41 GMT+0000 (Coordinated Universal Time)

@saurabhp643

star

Mon Oct 28 2024 08:13:54 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Mon Oct 28 2024 07:29:51 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Mon Oct 28 2024 00:04:59 GMT+0000 (Coordinated Universal Time) https://linkati.win/member/tools/api

@jamile46

star

Mon Oct 28 2024 00:04:26 GMT+0000 (Coordinated Universal Time) https://linkati.win/member/tools/quick

@jamile46

star

Sun Oct 27 2024 20:16:14 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Sun Oct 27 2024 18:44:25 GMT+0000 (Coordinated Universal Time) https://community.dynamics.com/forums/thread/details/?threadid

@pavankkm

star

Sun Oct 27 2024 18:29:23 GMT+0000 (Coordinated Universal Time) https://community.dynamics.com/blogs/post/?postid

@pavankkm

star

Sun Oct 27 2024 18:14:05 GMT+0000 (Coordinated Universal Time) https://microsoftdynamics365foroperation.blogspot.com/2018/10/dynamics-365fo-send-email-to-user-with.html

@pavankkm

star

Sun Oct 27 2024 17:32:37 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Sun Oct 27 2024 17:30:12 GMT+0000 (Coordinated Universal Time) https://github.com/pmndrs/react-three-fiber

@luccas

star

Sun Oct 27 2024 17:06:33 GMT+0000 (Coordinated Universal Time)

@jwhitlow5

star

Sun Oct 27 2024 16:57:41 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension