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
| import keras | |
| from keras.models import Sequential | |
| from keras.layers.core import Dense, Activation, Dropout, TimeDistributedDense | |
| from keras.layers.recurrent import LSTM, SimpleRNN | |
| def build_model(num_layers=2, num_units=256, maxlen_rnn=50, dim_label=50): | |
| ''' | |
| num_layers: in [2, 3] | |
| num_units: in [256, 512, 1024] |
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 DeliminatorSeparatedPropertyNamesContractResolver : DefaultContractResolver | |
| { | |
| private readonly string _separator; | |
| protected DeliminatorSeparatedPropertyNamesContractResolver(char separator) : base(true) | |
| { | |
| _separator = separator.ToString(); | |
| } | |
| protected override string ResolvePropertyName(string propertyName) |
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
| // Visit https://spotifycharts.com/regional and run the following in console | |
| var ts = ''; | |
| $('div[data-type=country] ul li').each(function(i,val) { | |
| ts += 'new Market("' + $(val).text() + '","' + $(val).attr("data-value").toUpperCase() + '"),' + " "; | |
| }); | |
| console.log(ts); |
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 static Bitmap LinearGradient(Image source, Color leftColor, Color rightColor) | |
| { | |
| // Create the gradient | |
| //using (var grad = new ) | |
| // Mutate the source | |
| using (Graphics graphics = Graphics.FromImage(source)) | |
| { | |
| Rectangle bounds = new Rectangle(0, 0, source.Width, source.Height); |
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
| // srcColor:Color, destColor:Color | |
| // We're converting everything to doubles [0,1.0], then performing multiply | |
| // then converting back to byte | |
| // These conversions are slow | |
| var sr = Convert.ToDouble(srcColor.R) / 255.0; | |
| var sg = Convert.ToDouble(srcColor.G) / 255.0; | |
| var sb = Convert.ToDouble(srcColor.B) / 255.0; |
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 OverlayWithLinearGradient : IGraphicsProcessor | |
| { | |
| public OverlayWithLinearGradient() | |
| { | |
| this.DynamicParameter = Tuple.Create(Color.PaleVioletRed, Color.CornflowerBlue); | |
| this.Settings = new Dictionary<string, string>(); | |
| } | |
| public dynamic DynamicParameter |
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 debounce(fn, debounceDuration){ | |
| // summary: | |
| // Returns a debounced function that will make sure the given | |
| // function is not triggered too much. | |
| // fn: Function | |
| // Function to debounce. | |
| // debounceDuration: Number | |
| // OPTIONAL. The amount of time in milliseconds for which we | |
| // will debounce the function. (defaults to 100ms) |
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
| var scores = []; | |
| $('.kluster-fields').find('.numeric').each(function() { | |
| var r = $(this); | |
| var name = r.find('span:first').text().replace(":",""); | |
| var val = parseFloat(r.find('strong').text()); | |
| //console.log(name + ' ' + val); | |
| var s = {name:name,score:val}; | |
| scores.push(s); | |
| }); |
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
| import UIKit | |
| struct Person { | |
| let name: String | |
| let city: String | |
| } | |
| let people = [ | |
| Person(name: "Chris", city: "Berlin"), | |
| Person(name: "Natasha", city: "Tokyo"), |
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
| var text = ''; | |
| $('.itc-tester-view tbody tr').each(function(index, el) { | |
| var email = el.querySelector('td:nth-child(2) span:first-child').innerText; | |
| var name = el.querySelector('.sorted > span').innerText.split(' '); | |
| text = text + name[0] + ', ' + name[1] + ', ' + email+'\n'; | |
| }); | |
| var a = document.createElement("a"); | |
| var file = new Blob([text], {type: 'text/csv'}); | |
| a.href = URL.createObjectURL(file); |