Skip to content

Instantly share code, notes, and snippets.

View baonq-me's full-sized avatar
🏠
Working from home

quocbao baonq-me

🏠
Working from home
  • Zalo
  • Ho Chi Minh city, Vietnam
View GitHub Profile
@baonq-me
baonq-me / ReflectionUtils.java
Last active October 19, 2018 03:01
java.lang.NoSuchMethodException: cs.service.core.utils.ReflectionUtils.notNull()
package cs.service.core.utils;
/**
* Created by baonq5 on 18/10/2018 16:59
*/
import vn.cs123.lib.entity.Identifiable;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
@baonq-me
baonq-me / BT3_2_thay_Huy.c
Created October 25, 2018 10:46
BT3_2_thay_Huy
#include <stdio.h>
#include <stdlib.h>
int tinhSoNut(int bangSo)
{
int soNut = 0;
while (bangSo != 0)
{
soNut = soNut + bangSo % 10;
bangSo = bangSo / 10;
@baonq-me
baonq-me / main.c
Last active November 10, 2018 04:25
Ví dụ 1 về con trỏ
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a = 5;
int* p = &a;
(*p)++; // Tương đương với *p = *p + 1
@baonq-me
baonq-me / main.c
Created November 10, 2018 04:25
Ví dụ 2 về con trỏ
#include <stdio.h>
int main()
{
// Macro
// http://nadeausoftware.com/articles/2012/02/c_c_tip_how_detect_processor_type_using_compiler_predefined_macros#x86andx8664
#if defined(__x86_64__) || defined(_M_X64)
printf("May dang chay tren kien truc 64bit\n");
#elif defined(__i386) || defined(_M_IX86)
printf("May dang chay tren kien truc 32bit\n");
@baonq-me
baonq-me / main.c
Created November 15, 2018 07:14
Chèn chuỗi s1 vào giữa s2
#include <stdio.h> // Sử dụng các hàm printf(), scanf()
#include <stdlib.h> // Sử dụng malloc()
#include <string.h> // Sử dụng strlen(), strncpy
// Copy n kí tự từ s2 và chèn vào sau s1
void stringCopy(char* s1, char* s2, int n)
{
// Ngắt nếu input không hợp lệ
if (s1 == NULL || s2 == NULL || n == 0)
{
@baonq-me
baonq-me / texteditor.c
Created December 8, 2018 04:47
Simple Text Editor
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main()
{
char inputFile[100];
char output[100] = {};
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan">
<context name="public">
<extension name="Route to extension 101 that picked up the call recently">
<condition expression="^(02836221443)$" field="destination_number">
<action application="set" data="call_timeout=20"/>
<action application="set" data="continue_on_fail=NO_ANSWER,UNALLOCATED_NUMBER,NO_ROUTE_TRANSIT_NET,CALL_REJECTED,NETWORK_OUT_OF_ORDER,DESTINATION_OUT_OF_ORDER,NORMAL_CIRCUIT_CONGESTION,NORMAL_TEMPORARY_FAILURE,SWITCH_CONGESTION,NO_USER_RESPONSE,USER_BUSY"/>
<action application="answer"/>
<action application="sleep" data="1000"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="configuration">
<configuration description="IVR menu 5c9201dbfbab1900bae19a97" name="ivr.conf">
<menus>
<menu confirm-attempts="3" confirm-key="" confirm-marco="" digit-len="1" exec-on-max-failures="execute_extension hangup inline" exec-on-max-timeouts="execute_extension hangup inline" greet-long="/vcs/acd/5c9201a3a69e9e00b9818eb9/Greeting.wav" greet-short="/vcs/acd/5c9201a3a69e9e00b9818eb9/Greeting.wav" invalid-sound="/vcs/acd/5c9201a3a69e9e00b9818eb9/key_press_invalid_endcall.wav" max-failures="1" max-timeouts="10" name="5c9201dbfbab1900bae19a97" timeout="10000">
<entry action="menu-exec-app" digits="0" param="execute_extension playback:/vcs/acd/5c9201a3a69e9e00b9818eb9/press_1.wav,set:call_timeout=200,export:'sip_contact_user=02871088883',export:'[email protected]',export:'sip_h_X-CID=${sip_call_id}',export:'sip_invit
N30fSesvQzMEXrXOB33NbbBrRW9j83SX
#include "aws.h"
#include <switch.h>
#include <switch_utils.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
/**
* Create the AWS S3 signature
* @param signature buffer to store the signature
* @param signature_length length of signature buffer