Skip to content

Instantly share code, notes, and snippets.

@hoangtuan151
hoangtuan151 / test_gosip.go
Last active June 13, 2024 13:27
Testing inbound call with sample audio
package main
import (
"bytes"
"log"
"math/rand"
"net"
"os"
"path/filepath"
"time"
class Student:
def __init__(self, name) -> None:
self.Name = name
def __str__(self) -> str:
return f"Student({self.Name})"
def change_student(s: Student):
s.Name = "AAA"
s = Student("New name")
type Student struct {
Name string
}
func (s Student) Display(prefix string) {
fmt.Printf("[%s] I'm %s\n", prefix, s.Name)
}
func ChangeStudentV3(s *Student) {
// s.Name = "Kane"
//
// package vn.com.ntqs.demo.ioc2.business
//
public class CustomerManagement {
private ConsoleLogger logger;
public CustomerManagement(ConsoleLogger logger) {
this.logger = logger; // dependency injection thông qua constructor
}
//
// package vn.com.ntqs.demo.ioc2.business
//
public class CustomerManagement {
private ConsoleLogger logger;
public CustomerManagement() {
this.logger = new ConsoleLogger(); // đoạn code quản lý (khởi tạo) đối tượng dependency
this.logger.setColorful(true); // đoạn code quản lý (config) đối tượng dependency
//
// Generic part
//
public abstract class SimpleCalculator {
private static PrintStream log = System.out;
private static Scanner cs = new Scanner(System.in);
protected int num1, num2;
protected int result;
package vn.com.ntqs.demo;
import java.io.PrintStream;
import java.util.Scanner;
public class Main {
private static PrintStream log = System.out;
private static Scanner cs = new Scanner(System.in);
import {localeMixin} from '@/utils/locale-mixin'
export default {
mixins: [localeMixin]
}
import {localeMixin} from '@/utils/locale-mixin'
export default {
mixins: [localeMixin],
computed: {
currentLocale () {
return this.$i18n.locale.toUpperCase()
}
},
methods: {
import i18n from '@/locale/i18n'
import {mapState} from 'vuex'
export var localeMixin = {
computed: {
...mapState(['app_locale'])
},
watch: {
app_locale (newValue) {
this.$i18n.locale = newValue