Lang: Python
def chuyen_tieng_viet_khong_dau(s):
s = s
s = re.sub(u'[àáạảãâầấậẩẫăằắặẳẵ]', 'a', s)
s = re.sub(u'[ÀÁẠẢÃĂẰẮẶẲẴÂẦẤẬẨẪ]', 'A', s)
s = re.sub(u'[èéẹẻẽêềếệểễ]', 'e', s)
s = re.sub(u'[ÈÉẸẺẼÊỀẾỆỂỄ]', 'E', s)
{ | |
path: '/', | |
component: HomeLayout, | |
children: [ | |
{ | |
path: 'recent', | |
alias: '/', | |
component: () => import(/* webpackChunkName: "recent_page" */ '@/views/RecentPage') | |
}, { | |
path: 'favorite', |
const vuexPersist = new VuexPersist({ | |
key: 'app-store', | |
storage: window.localStorage, | |
reducer: state => ({ | |
app_locale: state.app_locale | |
}) | |
}) | |
export default new Vuex.Store({ | |
plugins: [vuexPersist.plugin], |
import i18n from '@/locale/i18n' | |
import {mapState} from 'vuex' | |
export var localeMixin = { | |
computed: { | |
...mapState(['app_locale']) | |
}, | |
watch: { | |
app_locale (newValue) { | |
this.$i18n.locale = newValue |
import {localeMixin} from '@/utils/locale-mixin' | |
export default { | |
mixins: [localeMixin], | |
computed: { | |
currentLocale () { | |
return this.$i18n.locale.toUpperCase() | |
} | |
}, | |
methods: { |
import {localeMixin} from '@/utils/locale-mixin' | |
export default { | |
mixins: [localeMixin] | |
} |
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); | |
// | |
// 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.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 |