Windows 7 – Blokada reklamy Windows 10
Disable Windows 10 Popup
Disable Windows 10 Popup
Skrypt dla Greasemonkey podmieniający Youtubową playerkę na stronie naekranie.pl na oryginalną YT. Działa również w chromowym Temperedmonkey – ale nie pozwala na full screena (Work in progress)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
// ==UserScript== // @name NaEkranie.pl // @description Youtube without commercials for naekranie.pl // @namespace https://kszyh.kisim.eu.org // @include http://naekranie.pl/* // @version 1.0 // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.js // ==/UserScript== $(document).ready(function() { $("iframe").each(function() { var src= $(this).attr('src'); if(src.indexOf("youtube") > -1){ var index = src.indexOf('?'); src = src.substring(0, index); src = src.replace('embed', 'v'); $(this).closest('.media-browser').replaceWith("<embed allowfullscreen='true' width='100%' height='400' src='"+src+"&vq=hd1080'>"); } }); }); |
Download: ver. 1.0
Iron Python:
|
1 |
ipy -X:TabCompletion |
Python: Do .pythonrc
|
1 2 |
import rlcompleter, readline readline.parse_and_bind('tab:complete') |
export PYTHONSTARTUP=~/.pythonrc lub: echo „export PYTHONSTARTUP=~/.pythonrc” >> ~/.bashrc
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/bash # prune include files one at a time, recompile, and put them back if it doesn't compile # arguments are list of files to check removeinclude() { file=$1 header=$2 perl -i -p -e 's+([ \t]*#include[ \t][ \t]*[\"\<]'$2'[\"\>])+//REMOVEINCLUDE $1+' $1 } replaceinclude() { file=$1 perl -i -p -e 's+//REMOVEINCLUDE ++' $1 } for file in $* do #echo $file includes=`grep "^[ \t]*#include" $file | awk '{print $2;}' | sed 's/[\"\<\>]//g'` echo $includes for i in $includes do touch $file # just to be sure it recompiles removeinclude $file $i if make -j10 >/dev/null 2>&1; then grep -v REMOVEINCLUDE $file > tmp && mv tmp $file echo removed $i from $file else replaceinclude $file echo $i was needed in $file fi done done |
Skrypt usuwa kolejne #include a następnie rekompiluje kod by sprawdzić czy nadal działa. Jako argument skrypt przyjmuje katalog z plikami do sprawdzenia.
ReAttach
Otwieranie nowej zakładki ConEmu z Windows Command Prompt (cmd) w aktualnie wyświetlonym katalog w Total Commanderze:
|
1 |
"C:\Program Files\ConEmu\ConEmu64.exe" -single -cmd cmd /K "cd %p" |
lub
|
1 |
"C:\Program Files\ConEmu\ConEmu64.exe" -single -cmd "{Shells::cmd}" /K "cd %p" |
|
1 2 3 |
void testFunction() __attribute__((optimize(0))) { //code } |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
try: paraview.simple except: from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() points = { 1:[0,0,2], 10:[2.103215,2.103215,2], 11:[-7.55E-08,1.728084,2] [...] } cm = [ [1,2,9], [2,3,10], [3,4,11], [...] ] for key, value in points.iteritems(): Sphere4 = Sphere() Sphere4.Radius = 0.15 Sphere4.Center = value Sphere4.PhiResolution = 20 Sphere4.ThetaResolution = 20 RenderView1 = GetRenderView() DataRepresentation4 = Show() DataRepresentation4.EdgeColor = [0.0, 0.0, 0.5000076295109483] DataRepresentation4.SelectionPointFieldDataArrayName = 'Normals' DataRepresentation4.AmbientColor = [0.0, 0.0, 0.0] DataRepresentation4.CubeAxesColor = [0.0, 0.0, 0.0] DataRepresentation4.ScaleFactor = 0.1 RenderView1.CameraPosition = [0.12249341845958465, 1.6783114555009098, -2.82751287919202] RenderView1.CameraClippingRange = [1.8715334193481947, 5.084339235287565] DataRepresentation4.DiffuseColor = [1.0, 0.0, 0.0] Render() for value in cm: for i in range(1, len(value)): Line2 = Line() # toggle the 3D widget visibility. active_objects.source.SMProxy.InvokeEvent('UserEvent', 'ShowWidget') RenderView1 = GetRenderView() RenderView1.CameraClippingRange = [0.04313226219643915, 43.13226219643914] fromi = value[0] toi = value[i] frompt = points[fromi] topt = points[toi] Line2.Point1 = frompt Line2.Point2 = topt DataRepresentation2 = Show() DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483] DataRepresentation2.SelectionPointFieldDataArrayName = 'Texture Coordinates' DataRepresentation2.AmbientColor = [0.0, 0.0, 0.0] DataRepresentation2.CubeAxesColor = [0.0, 0.0, 0.0] DataRepresentation2.ScaleFactor = 0.10752979516983033 DataRepresentation2.Representation = 'Wireframe' DataRepresentation2.LineWidth = 2.0 Render() |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
#!/bin/bash if [ $# -eq 0 ] then echo "No arguments supplied" exit 0 fi inputs=() for f in *.pts; do inputs+=($f) done echo ${inputs[@]} arrSize=${#inputs[@]} echo $arrSize div=$(($1-1)) ile=$(($arrSize / $div)) for i in $(eval echo {0..$div}); do echo "Thread/Screen: $i" inp=${inputs[$i]} ff=`echo $inp | sed 's/_//' | sed 's/\.//' | sed 's/pts//'` ff=project$ff screen -md -S "calc$i" fin=$(($div+1)) command="for c in " for j in $(eval echo {$i..$arrSize..$fin}); do command+="$name " name=${inputs[$j]} done command+="; do module load deal.ii/8.2pre-gcc482 &&./Femaft \$c; done " echo $command screen -S "calc$i" -p 0 -X stuff "$command $(printf \\r) " done |
Zadanie: uruchomić w screenie n instancji programu z różnymi plikami wejściowymi. Każdy plik wejściowy ma nazwę pokroju {num}_{num}.pts
|
1 2 3 4 5 6 7 8 |
#!/bin/bash for f in *.pts; do ff=`echo $f | sed 's/_//' | sed 's/\.//' | sed 's/pts//'` ff=project$ff screen -md -S $ff screen -S $ff -p 0 -X stuff "module load deal.ii/8.2pre-gcc482 && ./Femaft $f$(printf \\r) " echo "Starting $ff calculations..."; done |
Pętla po wszystkich plikach z rozszerzeniem *.pts, pobranie ich nazwy i usuniecie extra znaków, tak by zostały tylko dwie liczby, ustalenie nazwy screena na project{numer}, indywidualna nazwa – 'project’ jest potrzebna… Continue reading