Tuesday, February 27, 2018

Distributions and how to plot them with SciPy



Intro

To make the plotting is simple (not that painful), in that post I will make few plots with different distributions.

First importing the libraries. I will use the matplotlib for plotting the data. SciPy one of the core libraries for data science calculations:

import numpy as np # we will use it for generation the arrays
from scipy.stats import bernoulli, binom, poisson, norm, uniform, beta
import matplotlib.pyplot as plt

To make printing comfortable a made the printing function for Mean, Variance, Skew, Kurt:
def print_mvsk(*args):
    t = args[0]
    mean, var, skew, kurt, = float(t[0]),float(t[1]),float(t[2]),float(t[3])
    sd = np.sqrt(var)
    print(f'mean:{mean:.4f}\tvar:{var:.4f}\tskew:{skew:.4f}\nsd:{sd:.4f}\tkurt:{kurt:.4f}')

Thursday, February 15, 2018

Performing Accurate Decimal Operations

In python the decimal calculations using the IEEE 754 algorithm.
>>> a = 4.1
>>> b = 2.2
>>> a + b
6.300000000000001

that means that
>>> (a + b) == 6.3 
False
Because python's float type stores data using the native representations.

If you want more accuracy Decimal class from decimal module can help you with that.

>>> from decimal import Decimal
>>> a = Decimal('4.1')
>>> b = Decimal('2.2')
>>> a + b
Decimal('6.3')
>>> (a + b) == Decimal('6.3')
True

Tuesday, February 06, 2018

Skype Admin

To get list of devices where you skype in used now just 
- open chat with anyone from your contact list
- type /showplaces and hit Enter

that command will show the list of "places" where you are signed it.

This what I get:


GL

Saturday, February 03, 2018

10 useful linux commands

As part of the Galvanize Data Science Immersive program we have task to create the 10 linux command post. :)

Dask is a great tool to do stuff.'

but when you install it - can produce problems:

c:\ProgramData\Anaconda3\Lib\site-packages>py.test dask
============================= test session starts =============================
platform win32 -- Python 3.6.1, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
rootdir: c:\ProgramData\Anaconda3\Lib\site-packages, inifile:
collected 3230 items / 1 errors / 5 skipped

=================================== ERRORS ====================================
__________ ERROR collecting dask/diagnostics/tests/test_profiler.py ___________
dask\diagnostics\tests\test_profiler.py:148: in
    pytest.param(lambda: ResourceProfiler(dt=0.01),
E   AttributeError: module 'pytest' has no attribute 'param'
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
===================== 5 skipped, 1 error in 24.40 seconds =====================

to fix that problem run:

pip install -U "pytest>=3.1.0"

ls - list files and directory in the folder
  ls -ahl
htop - shows the processes

mkdir - make a directiry

cd - change current directory

rmdir - remove directory

touch - make a file

find - search for file or directory

rm - remove file

stat - get file info

grep - find text in file
  grep --color -n -i "soap" *.csv
get the list of open ports
netstat -lntu

  • l = only services which are listening on some port
  • n = show port number, don't try to resolve the service name
  • t = tcp ports
  • u = udp ports
  • p = name of the program

Wednesday, December 20, 2017

Batch tricks

1. How to compress files in folder

FOR %i IN (*.log) DO 7z.exe a "%~ni.7z" "%i"

Sunday, November 12, 2017

Huge Memmory Working Set 18 Exabyte

Huge working set in 

Interesting what that would mean?

Process Explorer:


Task Manager shows:

Homemade Seabuckthorn Probiotic Drink

This post is about a kind of drink with which I share a long history: fermented drinks. They were a staple of my childhood diet and so I received their benefit all throughout my formative and adolescent years. Among the best fruit bases someone could use for this purpose is Sea Buckthorn, a fruit long renowned for its nutritional and medicinal virtues.< Read more on Body Bazaar Blog

Remove old drivers

Remove Old Drivers

To remove old and unused drivers from your Windows computer, first open Start Menu and right-click on Computer and select Properties. From the left side panel, click on Advanced system settings and click on Environment Variables. Alternatively, simply open Control Panel and type Environment Variables.
Now under the User variables box, click on New and type
devmgr_show_nonpresent_devices
remove old drivers
in the Variable Name text box & 1 in the Variable Value  box. This will set a flag to allow you to now view unused devices.


You can also use this method to show non-present drivers.
Now type devmgmt.msc in start search and hit Enter to open the Device Manager.


Original: http://www.thewindowsclub.com/how-to-remove-old-unused-device-drivers-in-windows-7

Wednesday, October 25, 2017

CSS Learning Materials

Good report with new Features in CSS
"Always read drafts"
https://www.youtube.com/watch?v=VoA-aQu75Xk

Wednesday, June 21, 2017

На Всяки

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxLZXlGaWxlPg0KCTxNZXRhPg0KCQk8VmVyc2lvbj4xLjAwPC9WZXJzaW9uPg0KCTwvTWV0YT4NCgk8S2V5Pg0KCQk8RGF0YT4vWUxYc05RVU5Qb25ZdmVEV3hYdUNmUkRsajM4bFM3M3R3UFkyakNkMElBPTwvRGF0YT4NCgk8L0tleT4NCjwvS2V5RmlsZT4NCg==

Saturday, January 14, 2017

Как узнать ёмкость батареи на notebook'е (windows)

Работает для windows


  1. запускаем cmd под правами администратора
  2. набираем powercfg /energy
    ждем пока программа отработает
  3. в этом же окне набираем energy-report.html


в открывшемся окне браузера ищем строки

Battery Information
вот что выдает программа о моем новом аккумуляторе (картинка)
2017 Jan 14

Старый Аккумулятор которому было уже за 4 года показывал значение Last Full Charge ~2500. Этого заряда хватало на 2 минутки.

Update 1

2018 Feb 22

потеря 13% ёмкости.

Список литературы:

Monday, April 18, 2016

Windows RPC Commands

Полезные toolzы для общения с сервером.

Общие Требования 

Нужен доступ к удленному серверу - windows account.
доменная ShmalexNET\Admin
или запись на самом сервере
192.168.24.24\Admin
.\192.168.24.24

Tasklist

tasklist /S 192.168.24.24 /u ShmalexNet\Admin /p 1234

Выдает список задача на сервере 192.168.24.24 и логиниться под пользователем Admin домена ShmalexNet с паролем 1234

Shutdown

shutdown /r /f /t 10 /m \\192.168.24.24

Перезагружаем /r удаленный сервер 192.168.24.24 принудительно /f с паузой в 10 секунд /t 10

iisreset

iisreset 192.168.24.24

Перезапускает серсив IIS на указанном сервере 192.168.24.24

Monday, March 14, 2016

Стих - наступает весна.

Весна наступает в аммерике
Кися гуляет по берегу
Кися держит за ручку кота
Вместе гуляют - он и она.

Friday, March 11, 2016

Рубка Дров

Увлекательный процесс я вам скажу, просто рубишь и складываешь. Придумываешь как бы это сделать быстро, эффективно и в соответсвии с ожиданием конечного потребителя - печки.

Чтобы и размер подошел и были щепки на растопку и чтобы не сильно мелко и т.п.

Но как показывается практика:

Раз - пила, два – топор: дров и щепок полон двор

и такие вещи как опилки и мелкие дровишки появляются в любом случай, как ты не целься.

Magento Suport - TheBodyBazaar.com


Magento - это весело

просто списпок комманд и настроек чтобы поддержать Продуктив в состоянии uptime.

Работа с архивами


Compressing folders
zip -r foldername.zip foldername
Example:
zip -r newfolder.zip newfolder

Директории-ссылки добавляются как файлы
zip --symlinks -r prod.zip html

TAR Decompressing folders using tar -xzvf

tar -xzvf foldername.tar.gz

TAR compress folder

tar -czvf name.tar.gz sourcefolder

unzip files

unzip help.zip -d html

untar

tar -xvf 2016-03-04-17-05.updated.tar.gz

Delete files or folders

NEVER RUN

rm -fr /*

Я сделал это на Prod сервере и это оказалась классическая "шутка". >_<
Суть "шутки" в том что когда вы выполняете
dir \.
в WIndows - то \. обозначает текущую директорию

а в Linux  /. обозначает root т.е. корневую директорию.

соотв ожидаемые результат противоположен!
Wellcome to linux world.
 На самом деле, DIR \. дает листик ресурсво с начало каталога. век живи век учись

You can Run

rm -r cache/

-- 
pwd - текущая директория

ls -alh


Create link

ln -sfn 2016-02-17-13-20 html

-s make symbolic links instead of hard links
-f remove existing destination files
-n treat destination that is a symlink to a directory as if it were a normal file


download files

wget http://kmplzt:17123@bodyb.kt-team.de/2016-02-18-22-50.tar.gz

https://docs.nexcess.net/article/how-to-change-magento-base-urls.html



PWD - Show current directory;

Monday, September 07, 2015

Stress Bolt

Когда мягкого уже не достаточно.


Делаю ремонт дома, в строительном магазине заметил этого красавца. всего вышло 1$  (19 лей). Выглядит красиво и в рука ощущается приятная тяжесть.

Сижу за компом и иногда отвлекаюсь гоняя шайбы с лева на право и обратно, пытливая выискивая ответы на новые вопросы. Хватит его на долго.

Friday, August 07, 2015

Open Position Senior .Net analyst programmer




SA Monsato, работающее в Молдове с 1997 года, ищет двух опытных программистов, готовых работать по Agile для постоянного американского клиента.
Предлагаем fulltime job position, полный соцпакет, хороший коллектив, тимбилдинги за границей, возможность командировок в США, интересную работу и почти американскую зарплату.
Senior .Net analyst programmer
Experience is required in the Microsoft development platforms, specifically the .NET Framework. The position requires 4 or more years of programming experience and a working knowledge of database programming.
Responsibilities:
• Develop software in compliance with the business and technical requirements.
• Maintain documentation of code.
• Software code and testing
• Working with multinational teamsц
Requirements:
• Technical programming and problem solving skills
• Experience in developing web/internet based applications.
Applicants must be well versed and have proven experience in the following skill sets:
• Object Orientated Programming in C# 4+ and Visual Studio 2013+.
• Web development, specifically HTML, CSS, ASP.NET, MVC.
• Relational database management systems and Microsoft SQL Server 2008 or higher.
• Creating relational databases, including SQL Server Data Tools.
• MCPD (Microsoft Certified Professional Developer) certificate (or the ability to obtain that on short notice).
Optional requirements:
• Cloud (Amazon, DropBox)
• Windows Services
• Experience in using the ReSharper tool
• Experience in using Jira.
To book an interview please email your CV to ilatii@monsato.md or for more information contact Yuriy at 888195.

E-mail: developer@kompass.mdPhone: 022 888195.

Wednesday, July 22, 2015

Традиции через время



Total Commander - всем знакомый файл мэнаджер. сбросил настройки меню (а может они и так там были) увидел префикс Gray к коомандам. 


Сразсу вспомнилась "ламповая клавиатура":


... особенно звук!