This file contains 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.Web; | |
using System.Web.Mvc; | |
using System.IO; | |
using System.Text; | |
namespace DummyMvc.Helpers | |
{ |
This file contains 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
ko.bindingHandlers.modal = { | |
update: function (element, valueAccessor) { | |
$(element).click(function () { | |
$.fancybox({ content: $('<div/>').addClass('list-widget').html($('.content', $(element).parent()).html()) }); | |
}); | |
} | |
}; |
This file contains 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 List<List<Coordinate>> ToGoogleMapsPolygon(this DbGeography dbGeo) | |
{ | |
// contains all geo data for one postal code / admin area code | |
// conversion to SqlGeography because DbGeography does not offer properties to determine rings within geometries. we need those ring information to display areas with holes | |
var sqlGeo = (SqlGeography) dbGeo.ProviderValue; | |
var numberOfGeometries = sqlGeo.STNumGeometries(); | |
var result = new List<List<Coordinate>>((int) numberOfGeometries); |
This file contains 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
// ProxyRequest proxies a request to a JSON-based API | |
// to avoid the cross origin request issue. | |
// It assumes the API supports POST. | |
// JsonResult is an ASP.NET MVC construct. | |
private JsonResult ProxyRequest(string url, string data) | |
{ | |
HttpWebRequest wr = (HttpWebRequest)HttpWebRequest.Create(url); | |
wr.Method = "POST"; | |
wr.ContentType = "application/json"; |
This file contains 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.Collections.Generic; | |
namespace System.Threading | |
{ | |
public class PollingWorker : IPollingWorker,IDisposable | |
{ | |
private class TickAction | |
{ | |
public string Name { get; set; } | |
public Action Work { get; set; } |
This file contains 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.Collections.Generic; | |
namespace System.Threading | |
{ | |
public class PollingWorker : IPollingWorker,IDisposable | |
{ | |
private class TickAction | |
{ | |
public string Name { get; set; } | |
public Action Work { get; set; } |
This file contains 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 AsyncMediatorPipeline<TRequest, TResponse> : IAsyncRequestHandler<TRequest, TResponse> where TRequest : IAsyncRequest<TResponse> | |
{ | |
private readonly IAsyncRequestHandler<TRequest, TResponse> inner; | |
private readonly IAsyncPreRequestHandler<TRequest>[] preRequestHandlers; | |
private readonly IAsyncPostRequestHandler<TRequest, TResponse>[] postRequestHandlers; | |
public AsyncMediatorPipeline(IAsyncRequestHandler<TRequest, TResponse> inner, IAsyncPreRequestHandler<TRequest>[] preRequestHandlers, IAsyncPostRequestHandler<TRequest, TResponse>[] postRequestHandlers) | |
{ | |
this.inner = inner; |
This file contains 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 MediatRInstaller : IWindsorInstaller | |
{ | |
public void Install(IWindsorContainer container, IConfigurationStore store) { | |
container.Register(Classes.FromAssemblyContaining<IMediator>().Pick().WithServiceAllInterfaces()); | |
container.Kernel.AddHandlersFilter(new ContravariantFilter()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (IRequestHandler<,>)).WithService.AllInterfaces().LifestyleTransient()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (IPreRequestHandler<>)).WithService.AllInterfaces().LifestyleTransient()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (IPostRequestHandler<,>)).WithService.AllInterfaces().LifestyleTransient()); | |
container.Register(Classes.FromThisAssembly().BasedOn(typeof (INotificationHandler<>)).WithService.AllInterfaces().LifestyleTransient()); |
This file contains 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
математика | |
курсы | |
Математика и Python для анализа данных | |
https://www.coursera.org/learn/mathematics-and-python | |
Введение в машинное обучение - Higher School of Economics | Coursera | |
https://www.coursera.org/learn/vvedenie-mashinnoe-obuchenie | |
Лекции | |
[Школа анализа данных. Яндекс] Дискретный анализ и теория вероятностей. | |
http://rutracker.org/forum/viewtopic.php?t=4640811 | |
Дискретная математика (видеозапись лекций WEBRip) |
This file contains 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 React from "react"; | |
import { render } from "react-dom"; | |
const ParentComponent = React.createClass({ | |
getDefaultProps: function() { | |
console.log("ParentComponent - getDefaultProps"); | |
}, | |
getInitialState: function() { | |
console.log("ParentComponent - getInitialState"); | |
return { text: "" }; |
OlderNewer