AnjLab Blog
В этом разделе транслируются сообщения, которые участники команды размещают на своих персональных блогах.
Mechanize и кодировки
Read more [Yury Korolev Blog]
AnjLab.FX Scheduler for ASP.NET
If you need simple yet easy configurable scheduler in your ASP.NET application, AnjLab.FX Scheduler might be your choise.
To use AnjLab.FX Scheduler you need to do 3 simple steps:
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
public class HelloWorldTask : ICommand
{
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(HelloWorldTask));
public void Execute()
{
Log.Info("Hello World!");
}
}
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
...
<section name="triggers" type="AnjLab.FX.Tasks.Scheduling.SchedulerConfigSection, AnjLab.FX"/>
...
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<configuration>
...
<triggers>
<!--
<daily tag='restoreDB' timeOfDay='23:00'/>
<weekly tag='backupDB' timeOfDay='01:30' weekDays='monday,friday'/>
<hourly tag='delTempFiles' minutes='30'/>
<interval tag='dumpLog' interval='00:05:00'/>
<once tag='upgradeDB' dateTime='01/15/2007 23:00'/>
<monthly tag='archiveDB' monthDay='29' timeOfDay='23:00'/>
-->
<interval tag='helloworld-task' interval='00:00:10'/>
</triggers>
...
</configuration>
Here we defined named trigger "helloworld-task" to be triggered every 10 seconds.
To map your task workers you create instance of KeyedFactory and register your tasks. We propose you do this in Global.asax Application_Start method:
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
protected void Application_Start(object sender, EventArgs e)
{
// Map trigger names to task workers
var factory = new KeyedFactory<string, ICommand>();
factory.RegisterType<HelloWorldTask>("helloworld-task");
// Start up scheduler
var scheduler = new Scheduler<ICommand>(factory);
var triggers = (List<ITrigger>)ConfigurationManager.GetSection("triggers");
scheduler.RegisterTriggers(triggers.ToArray());
scheduler.Start();
}
Thats it!
Resources:
P.S.
By the way, you can also use this API to schedule your tasks in Windows.Forms applications as well.
P.P.S.
AnjLab.FX is a framework we built during development of our projects. Its continue evolving and you can use it in your applications without any restrictions.
Read more [Dmitry Gusev Blog]
МОДИФИКАЦИЯ АЛГОРИТМА ТОРБЕНА ДЛЯ ПОИСКА МЕДИАНЫ В БОЛЬШОМ ОДНОМЕРНОМ МАССИВЕ
Выкладываю статью, как и обещал в предыдущем посте.
МОДИФИКАЦИЯ АЛГОРИТМА ТОРБЕНА ДЛЯ ПОИСКА МЕДИАНЫ В БОЛЬШОМ ОДНОМЕРНОМ МАССИВЕ
Гусев Д.И.
Владимирский государственный университет
Аннотация
В статье предлагается алгоритм поиска медианы, основанный на известном алгоритме Торбена. Особенностью обоих алгоритмов является то, что при поиске медианы они не требует изменения исходного массива и позволяют читать весь массив последовательно. Приводятся характеристики предлагаемого алгоритма, которые при определенных параметрах показывают производительность более 40% относительно алгоритма Торбена.
Скачать:
Текст статьи (241 КБ)
Read more [Dmitry Gusev Blog]
C#: RefreshSection method of ConfigurationManager is not refreshing sections under debug mode
RefreshSection method of ConfigurationManager is not refreshing sections when you run application at Visual Studio. Try to run application without VS.
Read more [Nikolay Zhebrun Blog]
