Skip to content

Instantly share code, notes, and snippets.

View cuongdev's full-sized avatar

Cường Tuấn Nguyễn cuongdev

View GitHub Profile
/**
* Tính cosine similarity two vector using UJMP lib
*
* @param m1
* @param m2
* @return
*/
public static double getCosineSimilartiy(double[] m1, double[] m2) {
double aiSum = 0;
double a2Sum = 0;
@cuongdev
cuongdev / node-folder-structure-options.md
Created December 27, 2016 02:10 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@cuongdev
cuongdev / Big number in linked list
Created June 11, 2016 17:43
Big number in linked list C++
#include <iostream>
#include <string.h>
using namespace std;
struct NODE
{
int data;
NODE *pNext, *pPred;
}; typedef struct NODE NODE;
@cuongdev
cuongdev / Remove VietNameseSign using C#
Last active June 9, 2016 19:31
Remove VietNameseSign using C#
public static string VietnameseSigns(string str)
{
str = str.Trim();
var charsToRemove = new string[] { "@", ",", ".", ";", "'", "/", "\\", "\"", "[", "]","#","+" };
foreach (var c in charsToRemove)
{
str = str.Replace(c, string.Empty);
}
const string FindText = "áàảãạâấầẩẫậăắằẳẵặđéèẻẽẹêếềểễệíìỉĩịóòỏõọôốồổỗộơớờởỡợúùủũụưứừửữựýỳỷỹỵÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶĐÉÈẺẼẸÊẾỀỂỄỆÍÌỈĨỊÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢÚÙỦŨỤƯỨỪỬỮỰÝỲỶỸỴ ";
const string ReplText = "aaaaaaaaaaaaaaaaadeeeeeeeeeeeiiiiiooooooooooooooooouuuuuuuuuuuyyyyyAAAAAAAAAAAAAAAAADEEEEEEEEEEEIIIIIOOOOOOOOOOOOOOOOOUUUUUUUUUUUYYYYY-";