Skip to content

Instantly share code, notes, and snippets.

View pavelgordon's full-sized avatar
🍻

Pavel Gordon pavelgordon

🍻
View GitHub Profile
AndroidWeather
public class Event
{
/**
* Event id
*/
public String i;
/**
* Event parent
init_cell = (row_number, col_number, prop) ->
if row_number == undefined || col_number == undefined
return
day_number = col_number + 1
row = table_data.get_row_by_index row_number
if row == undefined
return
day = row.get_day day_number
cellProperties = {}
# if col_number is last column( with total hours)
#
# Main file.
# Contains entry point
#
# @nodoc
previously_selected = undefined
@pavelgordon
pavelgordon / ConfigParser.js
Created September 16, 2016 15:49
what the fuck
Ext.namespace('Custom.config');
/**
* The Configparser is responsible for:
*
* 1. loading the json-config-file into the application
* 2. parsing the json-file into a javascript object
* (while already transforming values for tileSize, extent and layer-attributes into
* their respective objects)
* 3. rendering the application:
@pavelgordon
pavelgordon / OldFileCleaner.java
Created March 15, 2018 14:34
Cleaner for file which name contains date older than 90 days. Task from upwork
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author Pavel Gordon
*/
if property_definition is not None:
print("property_definition.Name", property_definition.Name)
props = {}
if property_definition.is_a("isExternal") or property_definition.is_a("LoadBearing") or property_definition.is_a("FireRating"):
print("has isExternal or LoadBearing or FireRating")
for q in property_definition.Quantities:
print("property_definition.Quantities: ", q)
import ifcopenshell
f = ifcopenshell.open("Stratumsedijk_AC17_08-04-2015.ifc")
windows = f.by_type("ifcWindow")
print(windows)
print(len(windows)) # when i have the zero in brakets after f.by_type _ i get the number of elements in brackets for the first element
# print(windows.is_a())# in this case this commands in working and shows that its ifcWindows.
# when i have no 0 in brakets, the command len gives the number of windows in the file . and command windows.is_a does not work
@pavelgordon
pavelgordon / gist.py
Last active March 25, 2020 19:31
calculate top 20 most frequent words on 57235 * 30 excel sheet
import pandas as pd
import numpy
df= pd.read_excel('dwfef.xlsx')
arr = df.to_numpy().flatten() #convert 2dimentional dataframe to 1dimentional list
arr = arr[~pd.isnull(arr)] # remove 'nan' - empty strings
striper = lambda t: str(t.strip())
arr = np.array([striper(xi) for xi in arr]).astype(str) # remove whitespaces before and after each word
unique_elements, counts_elements = np.unique(arr, return_counts=True)
shadowJar {
baseName = 'object-randomizer'
classifier = null
version = null
}