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
| %acessing and slicing | |
| a=[1 2;3 4] | |
| %{ | |
| a = | |
| 1 2 | |
| 3 4 | |
| %} |
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='123';b='456123'; | |
| s1=[a ',' b '.'] | |
| n=num2str(15.5) | |
| s2=['I am ' n ' years old.'] | |
| b = strcmpi('s', 'S'); %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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace Assignment2 | |
| { | |
| public static class PermutationExtensions | |
| { |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| public static class LinqExtensions | |
| { | |
| public static string AggregateToString<T>(this IEnumerable<T> input, string seperator) | |
| { |
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
| using System; | |
| using System.Collections; | |
| using System.IO; | |
| using System.Reflection; | |
| using System.Text; | |
| using IDictionary=System.Collections.IDictionary; | |
| #region Class: ObjectDumper | |
| /// <summary> |
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
| %https://www.mathworks.com/matlabcentral/newsreader/view_thread/243177 | |
| clear all | |
| clc | |
| figure(1);clf | |
| %y=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]; % spike train | |
| SPIKE_TRAIN_LENGTH = 100; | |
| y=double(logical(rand(SPIKE_TRAIN_LENGTH,1)<0.5)); | |
| plot(y) | |
| hold on |
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
| xlim([1,5]); | |
| hold('on'); | |
| h1a = plot(1:5, 11:15, '.-', 'LineWidth',10, 'DisplayName',' 0.5'); | |
| h1b = plot(1.5:5.5, 11:15, '.-', 'LineWidth',10, 'DisplayName',' 1.0', 'Color',h1a.Color); % 100% opaque | |
| h1a.Color(4) = 0.5; % 50% transparent | |
| h2a = plot(3:7, 15:-1:11, '.-r', 'LineWidth',8, 'DisplayName',' 0.3'); h2a.Color(4)=0.3; % 70% transparent | |
| h2b = plot(2:6, 15:-1:11, '.-r', 'LineWidth',8, 'DisplayName',' 0.7'); h2b.Color(4)=0.7; % 30% transparent | |
| h2c = plot(1:5, 15:-1:11, '.-r', 'LineWidth',8, 'DisplayName',' 1.0'); % 100% opaque = 0% transparent | |
| legend('show','Location','west') |
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
| # Windows image file caches | |
| Thumbs.db | |
| ehthumbs.db | |
| # Folder config file | |
| Desktop.ini | |
| # Recycle Bin used on file shares | |
| $RECYCLE.BIN/ |
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
| using System; | |
| using System.IO; | |
| using System.Text.RegularExpressions; | |
| namespace WallpaperFromRSS | |
| { | |
| public static class PathValidation | |
| { | |
| private static readonly string pathValidatorExpression = "^[^" + string.Join("", Array.ConvertAll(Path.GetInvalidPathChars(), x => Regex.Escape(x.ToString()))) + "]+$"; | |
| private static readonly Regex pathValidator = new Regex(pathValidatorExpression, RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.CultureInvariant); |
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
| SEED = intmax; | |
| rng('default'); | |
| rng(SEED); | |
| randn(3,3) | |
| rng(SEED); | |
| randn(3,3) |