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
public class XmlStripper | |
{ | |
public XmlNode RemoveAllNamespaces(XmlNode documentElement) | |
{ | |
var xmlnsPattern = "\\s+xmlns\\s*(:\\w)?\\s*=\\s*\\\"(?<url>[^\\\"]*)\\\""; | |
var outerXml = documentElement.OuterXml; | |
var matchCol = Regex.Matches(outerXml, xmlnsPattern); | |
foreach (var match in matchCol) | |
outerXml = outerXml.Replace(match.ToString(), ""); |
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
;; Mac の Dictionary.app を、 Emacs の popwin.el から使う | |
;; dict.py is from http://sakito.jp/mac/dictionary.html | |
(defun dictionary () | |
"dictionary.app" | |
(interactive) | |
(let ((word (if (and transient-mark-mode mark-active) | |
(buffer-substring-no-properties (region-beginning) (region-end)) | |
(read-string "Dictionary: "))) | |
(cur-buffer (current-buffer)) | |
(tmpbuf " * dict-process *")) |
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
/// <summary> | |
/// Utilties for reflection | |
/// </summary> | |
public static class ReflectionUtils | |
{ | |
/// <summary> | |
/// Get all the fields of a class | |
/// </summary> | |
/// <param name="type">Type object of that class</param> | |
/// <returns></returns> |
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
tag | originalLink | resolvedLink | |
---|---|---|---|
c++ | C++ | http://en.wikipedia.org/wiki/C++ | |
scala | Scala_(programming_language) | http://en.wikipedia.org/wiki/Scala_(programming_language) | |
c# | C_Sharp_(programming_language) | http://en.wikipedia.org/wiki/C_Sharp_(programming_language) | |
c# | C_Sharp_4.0 | http://en.wikipedia.org/wiki/C_Sharp_4.0 | |
c | C_(programming_language) | http://en.wikipedia.org/wiki/C_(programming_language) | |
c | Procedural_programming | http://en.wikipedia.org/wiki/Procedural_programming | |
c | Bell_Labs | http://en.wikipedia.org/wiki/Bell_Labs | |
c | UNIX | http://en.wikipedia.org/wiki/Unix | |
python | Python_(programming_language) | http://en.wikipedia.org/wiki/Python_(programming_language) |
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
% Filters the signal using coefficients obtained by the butter filter | |
% design | |
x_filtered = filter(b,a,y); | |
% Plots the filtered signal | |
figure(4) | |
plot(t,x_filtered,'r') | |
hold on | |
plot(t,y0,'k','LineWidth',2) | |
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
%% Filter Design | |
% Designs a second order filter using a butterworth design guidelines | |
[b a] = butter(2,0.2,'high'); | |
% Plot the frequency response (normalized frequency) | |
figure(3) | |
H = freqz(b,a,floor(num_bins/2)); | |
plot(0:1/(num_bins/2 -1):1, abs(H), 'r'); | |
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
function stupid_tricks | |
% I made some functional tools for MATLAB. | |
assert(reduce_(@(x, y) x + y, [1, 2, 3, 4]) == 10) | |
% They got a little out of hand. | |
join = @(sep, args) ... | |
if_(ischar(sep), @() ... % Input check | |
reduce_(@(x, y) [x sep y], ... % Reduce to string | |
map_(@num2str, args))); % Convert args to string. |
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
t = 0:0.001:1000; | |
x = cos(t); | |
y = sin(t); | |
fig = figure(); | |
ax = axes(); | |
hold on | |
dot1 = plot(x(1), y(1)); | |
dot2 = plot(1.5 * x(1), 1.5 * y(2)); | |
hold off |
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
%% Matlab-Skript zur Vorlesung Informationsuebertragung am 14.11.2014 | |
% Autor: Valentin Burger, Michael Seufert, Steffen Gebert | |
clear all; %set(0, 'defaultlinelinewidth', 1); | |
figure(1);clf;box on; | |
A=5; % Amplitude | |
w=4; % Frequenz | |
phi=pi/2; % Phasenverschiebung | |
x=(0:0.001:2)*pi; | |
y=A*sin(x*w+phi); |
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 lda takes in a list of Words and documents and generates the | |
%probability matrices for LDA | |
% INPUTS: | |
% W -list of words | |
% D -list of documents assigned to each word | |
% nTopics - number of topics to use for LDA | |
% maxIter - maximum iterations to run LDA | |
% nVocab - (optional) number of unique words | |
% | |
% Outputs: |