Skip to content

Instantly share code, notes, and snippets.

@Foadsf
Foadsf / cell1.css
Last active December 20, 2018 22:19
%%html
<style>
body {
position: relative;
min-height: 90vh;
}
.content-wrap {
padding-bottom: 2.5rem;
}
@Foadsf
Foadsf / FmS.sci
Last active February 22, 2019 13:35
An energy/model based controller to minimize overshoot and respoonse time of a mass spring system
function F=FmS(x, xy, v)
K = Fmax * abs(xy - x) + k * (xy^2 - x^2) / 2;
if abs(xy - x) < 1e-6 then
F = k * x;
else
if K > 0 then
vm = sqrt(2 * K / m);
F = Fmax * sign(vm - v);
else
F = Fmax * sign(x - xy);
@Foadsf
Foadsf / test.md
Last active March 13, 2019 19:19
test collapsible markdown

/*

This is the markdown text

used for documentation

Click to see the source code
@Foadsf
Foadsf / a.md
Created March 13, 2019 23:16
testing the markdon include olution from here https://stackoverflow.com/a/55152538/4999991
<iframe src="b.md" seamless></iframe>
@Foadsf
Foadsf / a.md
Created March 14, 2019 01:20
test iframe for include markdown files
<iframe src="b.md" seamless></iframe>

This is the asciidoc text

used for documentation

Click to see the source code

@Foadsf
Foadsf / coomend.md
Last active March 25, 2019 08:48
updating the positon of an image in a scilab figure when resizing the figure -->http://bugzilla.scilab.org/show_bug.cgi?id=16016

OK, I'm going to write here because Scilab bugzilla is awfull. I wrote comments twice and it just shows the first couple of lines of my text!!!!

http://bugzilla.scilab.org/show_bug.cgi?id=16016

I wish Scilab decision makers would just move the entire codebase to modern platforms Github or GitLab. This is not good at all. so much headach for users and contributors.

about the bug, I don't think moving the resizefcnfunction solves the problem. The ex002.sce proves that. There are 3 issues

  1. The resizefcn shouldn't be triggered upon creating the figure. this is a bad behaviour in my opinion.
  2. the findobj function should at least drop a warning when not finding an object.
@Foadsf
Foadsf / uititle.sci
Last active March 27, 2019 22:13
The famous uititle from Enrico Segre (emeritus Scilab contributor) reborn
function t = uititle(h, text, relpos)
pos = h.Position;
select relpos
case "r"
pos(3) = 2 * pos(3);
lay_opt = createLayoutOptions("grid", [1,2]);
case "t"
pos(4) = 2 * pos(4);
lay_opt = createLayoutOptions("grid", [2,1]);
case "l"

check the html block diagram

@Foadsf
Foadsf / test.md
Last active March 28, 2019 22:42
<style type="text/css"> .tg {border-collapse:collapse;border-spacing:0;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;} .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;} .tg .tg-cmwg{background-color:#ffccc9;text-align:center;vertical-align:top} .tg .tg-baqh{text-align:center;vertical-align:top} .tg .tg-uys7{border-color:inherit;text-align:center} </style>