$ flake8 --version
4.0.1 (flake8-bonk: 0.1.0, mccabe: 0.6.1, pycodestyle: 2.8.0, pyflakes: 2.4.0) CPython 3.10.2 on Darwin
$ flake8 -vv ./bonk.py
...
flake8.main.application MainProcess 152 INFO Finished running
flake8.main.application MainProcess 152 INFO Reporting errors
flake8.style_guide MainProcess 152 DEBUG Deciding if "BONK001" should be reported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A = arrayfun(@(x){randi([1 3],1,randi([1 5]))},1:500); | |
t1 = timeit(@()test1(A)); | |
t1a = timeit(@()test1_nocf(A)); | |
t2 = timeit(@()test2(A)); | |
t2a = timeit(@()test2_nocf(A)); | |
t3 = timeit(@()test3(A)); | |
t3a = timeit(@()test3_nocf(A)); | |
tmp = ver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdf = myobject(); | |
asdf.compute; | |
asdf.draw; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testcode | |
C = repmat({'adpo' 2134 []; 0 [] 'daesad'; 'xxxxx' 'dp' 'dpdpd'}, 20); | |
querystr = 'dp'; | |
t1 = timeit(@()trial1(C, querystr)); | |
t2 = timeit(@()trial2(C, querystr)); | |
t3 = timeit(@()trial3(C, querystr)); | |
t4 = timeit(@()trial4(C, querystr)); | |
t5 = timeit(@()trial5(C, querystr)); | |
t6 = timeit(@()trial6(C, querystr)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testcode() | |
A = rand(1, 999999); | |
B = rand(1, 424242); | |
C = rand(1, 101325); | |
t1 = timeit(@()naivetrim_delete(A, B, C)); | |
t2 = timeit(@()naivetrim_copy(A, B, C)); | |
t3 = timeit(@()naivetrim_cellfun(A, B, C)); | |
tmp = ver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testcode | |
handles.f = figure; | |
handles.ledit = uicontrol('Style', 'edit', 'String', '', 'Units', 'Normalized', 'Position', [0.1 0.1 0.2 0.1]); | |
handles.redit = uicontrol('Style', 'edit', 'String', '', 'Units', 'Normalized', 'Position', [0.4 0.1 0.2 0.1]); | |
com.mathworks.mwswing.MJUtilities.initJIDE; | |
% Put calendar to my figure | |
handles.jPanel = com.jidesoft.combobox.DateChooserPanel; | |
[handles.hPanel,handles.hContainer] = javacomponent(handles.jPanel,[100,100,200,200], handles.f); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trialcode | |
ENGSPD_1 = rand(1812890, 1); | |
Eng_Spd = rand(125000, 1); | |
Speed = rand(412730, 1); | |
TIME = rand(412730, 1); | |
Time = rand(125000, 1); | |
engine_speed_2 = rand(14060, 1); | |
time_1 = rand(1812890, 1); | |
time_2 = rand(14060, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img = imread('ngc6543a.jpg'); | |
corners = rand(20, 3); | |
corners(:,1) = uint8(size(img, 1) * corners(:,1)); | |
corners(:,2) = uint8(size(img, 2) * corners(:,2)); | |
figure(); hold on; | |
imshow(img, []); | |
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]); | |
for i = 1:size(corners, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testcode | |
x = rand(10^7,1); | |
t1 = timeit(@()sumtest(x)); | |
t2 = timeit(@()nnztest(x)); | |
t3 = timeit(@()findtest(x)); | |
tmp = ver; | |
fprintf(['Timing Comparison %s\n' ... | |
'n_Elements: %u\n\n' ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testcode | |
C = repmat({1, 2, 'string', 4}, 100, 100); | |
t1 = timeit(@()loopmethod(C)) | |
t2 = timeit(@()cellfunmethod(C)) | |
end | |
function C = loopmethod(C) | |
for n = 1:numel(C) | |
if isnumeric(C{n}) |
NewerOlder