Tuesday, April 17, 2018

How to make Jupyter Notebook full screen

Problem:

The Jupyter Notebook has 900 pixels in width and don't use all the "potential" of your screen.
Especialy when you try to make a presentation of the big screen and you have to Zoom It. (CTRL + MOUSE_SCROLL-UP)

That is exactly where you need the "Full Potential" of you screen.

You play with styles in the Browser's Developer Tool, but this effort is not reusable.

Solution:
Use the Stylebot Extention for Chrome

This extension will save your css and apply it to site when you visit it.



Steps to use
1. Install it
2. Navigate Jupyter Notebook page
3. Open the Stylebot
4. At the bottom of the panel click "Edit CSS"
5. Copy Paste this:
#notebook-container {
    padding: 0px;
}
.prompt {
    min-width: 10ex;
}
div.container {
    width: 95%;
}

so it should look like this:


If you have trouble on "pasting" - just retype this css ;-)


DONE! now it looks way batter - enjoy your presentation!




FYI - the Jupyter Notebook page handles most of the keyboard shortcuts so it's could be tricky to work with Stylebot on JN page.
I recommend to adjust your styles in the Developer Tools and the copy&paste the result into Stylebot.

GL feel free to ask any questions.



Tuesday, March 06, 2018

WinDBG + VS + DevExpress

.loadby sos clr
.load E:\Diagnostics\sosex.dll
>>  run !bhi
.sympath srv*c:\mss*http://msdl.microsoft.com/download/symbols
.sympath+ E:\WebsiteCode\Live\Platform\Velocity_DigitalHandler\NEWHANDLER\bin

.symfix
.reload /f /i
!sym noisy


!dlk (dead locks)
!dlk
!EEStack -- clr stack

Saturday, March 03, 2018

Sampling Distribution


Sampling distribution

Imagine you have some data and you and you would like to know it's properties, like - mean, or average or something else - a Point Estimate. But you don't have a way to work with full data set (it's to large, or it's not fully available to you). But you have access to some portion of it.

To have an good aproximate value of that data you can make the Sampling Distribution.

The sampling distribution represents the distribution of the point estimates based on samples of a fixed size from a certain population.

 It is useful to think of a particular point estimate as being drawn from such a distribution.

To make that point more visible I made the set of tests to show that it really works - the sample size is our variable that experiment.


import mysql.connector
import pandas as pd
import numpy as np
from scipy.stats import bernoulli, binom, poisson, norm, uniform, beta
import matplotlib.pyplot as plt

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;