Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

chuongmep

💭
I may be slow to respond.
View GitHub Profile
View vi_no_phonology.cs
//https://www.jetbrains.com/help/resharper/Spell_Checking.html#configuring-respeller-inspections
void ex()
{
string path = @"D:\API\dictionaries\dictionaries\vi\index.dic";
string newpath = @"D:\API\dictionaries\dictionaries\vi\index2.dic";
string text = File.ReadAllText(path);
string newtext = RemoveSign4VietnameseString(text);
string[] lines = newtext.Split(
new[] { "\r\n", "\r", "\n" },
StringSplitOptions.None
View inserttag.py
from itertools import groupby, count
bol = [None, "2018",None,None,None,"2018","2019","2020",None,None]
value = "Data"
def get_bol(a):
index = []
for i in range(len(a)-1):
if isinstance(a[i], str):
index.append(i)
return index
def set_bol(a,intervals,value):
View GetElementConnectedContinuous.cs
public static List<Element> GetElementConnectedContinuous(this Element e)
{
Dictionary<string, Element> OutElements = new Dictionary<string, Element>();
List<Element> collector = Collector(e, OutElements);
return collector;
}
View selectbranchpipe.py
import clr
import math
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
import System
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
View collector.cs
private static List<Element> Collector(Element e, Dictionary<string, Element> OutElements)
{
double count = 0;
List<Element> elements = e.GetElementConnectedWith();
foreach (Element item in elements)
{
if (OutElements.ContainsKey(item.Id.ToString()))
{
count += 1;
}
View DistanceTo.cs
/// <summary>
/// Obtains the distance between two points.
/// </summary>
/// <param name="u">Vector3.</param>
/// <param name="v">Vector3.</param>
/// <returns>Distance.</returns>
public static double Distance(this XYZ u, XYZ v)
{
return u.DistanceTo(v);
}
@chuongmep
chuongmep / data.txt
Last active Jun 13, 2021
Recommender System
View data.txt
1,1,1
1,2,3
1,3,4
1,5,5
2,1,2
2,2,4
2,4,1
3,2,3
3,3,2
3,4,4
View buabaokeo.py
from random import randint
print ("Quy uoc Bao :0")
print ("Quy uoc Bua :1")
print ("Quy uoc Keo :2")
lst = ["Bao","Bua","Keo"]
computer = randint(0,2)
userinput = int (input ("Moi ban nhap: \n"))
print ("Nguoi dung da nhap",lst[userinput])
print ("May nhap",lst[computer])
View ConvertCsvToExcel.cs
void ConvertCsvToExcel()
{
string csvFilePath = @"C:\Users\vcho\Documents\Report.csv";
string excelFilePath =@"C:\Users\vcho\Documents\Report.xlsx";
string worksheetsName = "TEST";
bool firstRowIsHeader = false;
var excelTextFormat = new ExcelTextFormat();
excelTextFormat.Delimiter = ',';
excelTextFormat.EOL = "\r";