17 May 2012

В Diablo III можно поиграть и бесплатно! [Diablo 3 free]

Inline image 1

Если вы не успели поиграть в DIABLO III во время народного теста (link) — не отчаивайтесь. Бесплатно поиграться можно будет уже с 15 мая! Благодаря специальной версии игры Diablo III Starter Edition.

В течение 30 дней после начала продаж игры стартовая версия Diablo III будет доступна по гостевому пропуску (Guest Pass). Эти специальные ключи входят в состав всех коробочных изданий Diablo III. 

На пользователей, играющих на стартовой версии, накладываются следующие ограничения:
  • Доступен только I акт вплоть до Короля скелетов
  • Развитие ограничено 13 уровнем
  • Подбор игроков возможен только среди игроков со стартовой версией
  • Нет доступа к денежному аукциону

Read more: Habrahabr.ru
Read more: Battle.net
QR: Inline image 2
17 May 2012

Информационная анархия, или как победить торренты и легализовать копирайт

Часто можно услышать такие вопросы: «Как победить пиратство?», «Можно ли легализовать файлообмен?», «Как реформировать копирайт?»
Я думаю, адекватно ответить на эти отдельные вопросы невозможно, если не видеть большую картину, не понимать что происходит с информационным бизнесом в целом, и с его продуктами, с книгами, с периодикой — газетами, журналами, с музыкой, фотографиями, фильмами, играми, дизайном, софтом (далее в тексте — инфо-продукты).

Информационная революция
Мы являемся свидетелями двух революционных процессов:

1. Цифровые медиа: стремление к качеству и к охвату все большей аудитории привело к смене медиа (носителей) для информационных продуктов, от аналоговых медиа мы перешли к цифровым. Это дало изначальный рост доходов производителей (авторов, издательств, студий) в условиях старой бизнес-модели
2. Цифоровые каналы распространения: развитие телекоммуникаций, персональных гаджетов привело к тому, что старая бизнес-модель в распространении инфо-продуктов была убита феноменом интернета, точнее сочетанием цифровых медиа и цифровых каналов распространения.

Интернет убил старую бизнес-модель так быстро, что сейчас существует вакуум для современной бизнес-модели и в этой пустоте процветает анархия. То что мы видим — это анархия. Анархия — это распыление доходов, дисбалансы, падение производства и, потенциально, смерть бизнеса.

Информационная анархия

Инфо-продукты обладают уникальными базовыми свойствами: копирование (легкость получения копии товара высочайшего качества) и тиражирование (любая копия товара сама становится источником других копий).
Под действием этих свойств законные владельцы информационных продуктов не контролируют дальнейшую судьбу своих продуктов. В результате копирования и тиражирования создается два потока инфо-продуктов:

— первый поток условно-платных копий, который контролируется автором (это может быть не только абсолютная платность каждой копии, но и условно-платные бизнес-решения — shareware, freemium, микро-платежи, различные лицензии, закрепляющие право автора получать оплату за коммерческое использование продукта, право на бренд и рекламу, и многие другие формы относительной платности и полной бесплатности под контролем автора и/или владельца прав),

— второй поток условно-платных копий, который не контролируется автором (это все виды облачных хранений копий с общественным доступом и без общественного доступа, все торренты, все локальные копии файлов, созданные для личного пользования после официальной покупки и другие), при этом такие «левые»; копии также могут приносить доход своим новым владельцам (но не авторам), с помощью рекламы, или прямых продаж (смс за скачивание, копирование на физические носители, оплата подписки), или оказания каких-либо услуг с использованием инфо-продуктов (беслатное использование софта, видео-прокат и тд).

Информационную анархию создает именно второй поток, свободное распространение продуктов без ведома и без воли авторов и владельцев.

Read more: Habrahabr.ru
QR: Inline image 1
17 May 2012

TellYouLater

What kind of service is it?
This service lets you encrypt text messages so that they cannot be decrypted and read before a predefined date.

How secure is this kind of protection?
We use the encryption algorithms 1024-bit RSA and 128-bit AES, which are considered secure enough in most cases.

How does it work?
   We use asymmetric encryption. It means that the data is encrypted using a public key, and can be decrypted only if you have the corresponding secret key. For each hour in the next few years, our system has a pair of keys, a public one and a secret one. While all public keys are openly available, the secret keys are posted only when the time comes. Select a moment in time; a respective open key will be retrieved from our web site, and your message will be encrypted. To decrypt your message, a secret key will have to be obtained from our server. If that key hasn't been published yet, the decryption of the message will be impossible.

Read more: TellYouLater.com
QR: Inline image 1
17 May 2012

Fluent Interfaces

What is a Fluent Interface?

When developing software, it is important that the code that you write is easy to understand in order that it can be maintained at a later date. There are many ways in which you can structure your classes in order to achieve this and various guidelines, such as the five SOLID principles. One way to achieve improved readability for your source code is to develop libraries with fluent interfaces.

Fluent interfaces allow code to be created that appears similar to natural language, when the symbols that decorate methods are ignored. This involves choosing member names that can be combined in ways that mirror words in a language such as English. The words are then combined using method chaining, where each method returns a result that can be acted upon by the next call in the sequence. However, fluent interfaces are not designed for method chaining alone.

To understand the difference between a fluent and non-fluent interface, let's look at an example. The code below uses method chaining but if the member names are read out loud, the meaning is not perfectly clear. The code calculates the date and time one week from the current date at 9:30am.

DateTime time = DateTime.Now.AddDays(7).Date.AddHours(9).AddMinutes(30);

This simple example is reasonably easy to understand for a developer but as the complexity grows it could become more difficult. If we convert the code to use a more fluent syntax, we can make its purpose clearer. The code below, read aloud, is "One week hence at 9:30".

DateTime time = 1.Week().Hence().At(9, 30);

Fluent interfaces are used widely in frameworks and library code. Two common examples that have been examined in earlier articles are Language-Integrated Query (LINQ) and Moq. You can create your own fluent interfaces by adding suitably named methods to your classes. You can also take advantage of C# 3.0's extension methods to add fluent-style methods to existing classes, including .NET framework types. We'll use this technique in the following sections to create a small fluent interface for date and time processing that supports the code example above.

Integer Extensions

In the fluent example code above, the first method used is "Week". This is an extension method of the integer type that creates a TimeSpan value representing the specified number of weeks. The code below shows how the method is created, as well as several other integer extension methods that create TimeSpans for days, hours and minutes.

public static class FluentTimeExtensions
{
    public static TimeSpan Days(this int number)
    {
        return new TimeSpan(number, 0, 0, 0);
    }
 
    public static TimeSpan Hours(this int number)
    {
        return new TimeSpan(number, 0, 0);
    }

Read more: BlackWasp
QR: Inline image 1
17 May 2012

The Task: Events, Asynchronous Calls, Async and Await

Almost any software application today will likely contain a long-running process. “Long-running” may be a relative term but in the Windows Runtime it is specifically anything that could take longer than 50ms to execute. That’s a fairly small window, and it means those operations will need to run concurrently to the main application thread. Concurrency is important in both client applications (to keep from blocking the UI) and server applications (to accommodate multiple simultaneous requests).

The new technology referred to as Visual Studio Asynchronous Programming provides a streamlined language syntax for asynchronous development. It does this by providing two new keywords: async and await. While these keywords may simplify asynchronous development, they can still be confusing to developers. There are a lot of materials out there but I thought it might help to take a very simple example and explore just what these keywords are and how they operate. In this post I’ll focus specifically on the .NET Framework 4.5 support. While they are also supported for Metro-style applications, the implementation is slightly different.

The Main Event

In the movie Mission Impossible II, the short-lived protagonist Dr. Nekhorvich says:

“…every search for a hero must begin with something every hero needs, a villain. So in a search for our hero, Bellerophon, we have created a more effective monster: Chimera.”

In the search for an elegant solution to asynchronous programming we must start with some of the rougher implementations that have plagued developers in the past.

The event-based pattern is probably one of the most well-known asynchronous patterns to .NET developers as it is prevalent throughout the base library. Let’s assume I have a method that multiplies two numbers and for some crazy reason (maybe I’m sending it over a 300 baud modem to my Commodore 64 to process the result on the 6502 chip … you know, using a bunch of ROR operations) it takes a bit longer to process than I’d like, so I want to make sure it executes asynchronously. The first thing I’ll do is create an event argument payload for the result:

public class MultiplyEventArgs : EventArgs 
{
    public int Result
    {
        get;
        private set; 
    }

    public MultiplyEventArgs(int result)
    {
        Result = result;
    }
}

Next, I’ll define an interface:

public interface IMultiplierEvent
{
    event EventHandler<MultiplyEventArgs> MultiplyCompleted;
    void MultiplyAsync(int a, int b); 
}

Finally, I’ll implement the class that executes the operation asynchronous and fires the completed event when done.

public class MultiplierEvent : IMultiplierEvent
{

    public event EventHandler<MultiplyEventArgs> MultiplyCompleted;

    private void RaiseCompleted(int result)
    {
          
        var handler = MultiplyCompleted;
        if (handler != null)
        {
            handler(this, new MultiplyEventArgs(result));
        }
    }

    public void MultiplyAsync(int a, int b)
    {
        Task.Run(() => RaiseCompleted(a * b));
    }
}

Read more: C#:IMage
QR: Inline image 1
17 May 2012

Simplify Syntax with Extension Methods

Extension methods were first introduced with LINQ in C#3.0. They are just a syntactic construct, but as we’ll see in this post they can make a huge difference. What’s easier to read of these two?

string[] wishList1 =
    Enumerable.ToArray(
    Enumerable.Select(Enumerable.Where(Animals, a =&gt; a.StartsWith("A")),
    a =&gt; string.Format("I want a {0}.", a)));
 
string[] wishList2 = Animals.Where(a =&gt; a.StartsWith("A"))
    .Select(a =&gt; string.Format("I want a {0}.", a)).ToArray();

To me, the second alternative has several advantages:

Get rid of the name of the helper class declaring the method. Writing out the Enumerable class name doesn’t add any relevant information. On the contrary, it forces the reader to actively think of it to find out that it is irrelevant.
Left-to-right reading order instead of inside-out when following the evaluation order.
The method name and the parameters are written together. In the first example Select and the relevant code is splitted by the call to Enumerable.Where.
Extension methods creates a syntactic possibility to do two important things that are not allowed by the language.

Add methods to existing classes.
Add methods to interfaces.

Add Methods to Existing Classes

Sometimes it would be beneficial to extend existing classes with own methods. An example would be to add an IsEmail() method to the string class. The checking will be done using a regular expression, but using the name IsEmail makes the intent much more clear.

foreach (string s in strings)
{
    if (s.IsEmail())
    {
        Debug.WriteLine("{0} is a valid email address", (object)s);
    }
    else
    {
        Debug.WriteLine("{0} is not a valid email address", (object)s);
    }
}

Read more: Passion for Coding
QR: Inline image 1
17 May 2012

Интегрируем TortoiseSVN в Total Commander

Inline image 1
Преамбула:

Имеем в наличии TortoiseSVN и Total Commander, и активно их используем в работе. 
Практически все действия в Total Commander'e успешно совершаются одной только клавиатурой, без использования мышки, какими-либо горячими клавишами. Главное их найти/знать/привыкнуть, и работа становится в разы проще и быстрее.
TortoiseSVN же из коробки предоставляет нам только пункты в контекстном меню, до которого можно добраться двумя способами:
  • Мышкой. При активной работе, тянуться каждый раз до мышки, реально начинает напрягать уже через пару дней/часов/минут работы (зависит от крепости нервов разработчика) и времени занимает это довольно много.
  • Через клавишу контекстного меню + стрелок. Этот вариант конечно чем-то проще и быстрее (ибо не надо тянуться за мышкой), но всё так же не удобен и всё такой же медленный.

Хочется все действия с TortoiseSVN выполнять так же быстро, как и действия в самом Total Commander'e. 
Т.е. через горячие клавиши, в одно нажатие.

Облазив просторы интернета, не смог найти ни одной инструкции, как можно по-человечески интегрировать TortoiseSVN в Total Commander и сделать это возможным.
Поэтому решил написать свой небольшой простенький мануал.

Реализация.

По факту, всё достаточно просто.
В комплекте с TortoiseSVN идёт exe'шник, как раз для автоматизации: TortoiseProc.exe 
Он то нам и нужен. Полный список параметров для него доступен на официальном сайте.
В Total Commander'e, в свою очередь, имеется возможность создавать кастомные команды. 
Сделать это можно несколькими способами:
Через меню настроек: Инструменты -> Список команд ТС…

Read more: Habrahabr.ru
QR: Inline image 2
17 May 2012

Sandbox OS

Welcome to Sandbox OS, A Brand new COSMOS OS Made by Marblestech

Read more: Codeplex
QR: Inline image 1
17 May 2012

[UPDATE] The story of the Linux kernel 3.x…

The story of the Linux kernel 3.x…

In 2005 everybody was exited about possibility of bypass ASLR on all Linux 2.6 kernels because of the new concept called VDSO (Virtual Dynamic Shared Object). More information about this story can be found at the following link:
 
In short, VDSO was mmap’ed by the kernel in the user space memory always at the same fixed address. Because of that well-known technique ret-to-libc (or as some ppl prefer ROP) was possible and effective to bypass existing security mitigation in the system.
… 6 years later Linus Torvalds announced the release of the new kernel version – 3.x! Now, guess what happened…

pi3-darkstar new # uname -r
3.2.12-gentoo

pi3-darkstar new # cat /proc/sys/kernel/randomize_va_space
2

pi3-darkstar new # cat /proc/self/maps|tail -2
bfa81000-bfaa2000 rw-p 00000000 00:00 0          [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0          [vdso]

pi3-darkstar new # cat /proc/self/maps|tail -2
bfd5e000-bfd7f000 rw-p 00000000 00:00 0          [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0          [vdso]

pi3-darkstar new # ldd /bin/ls|head -1
    linux-gate.so.1 =>  (0xffffe000)

pi3-darkstar new # ldd /bin/ls|head -1
    linux-gate.so.1 =>  (0xffffe000)

pi3-darkstar new #
 
I’m not using

dd if=/proc/self/mem of=linux-gate.dso bs=4096 skip=1048574 count=1

because I’m lame 

pi3-darkstar new # echo "main(){}">dupa.c

pi3-darkstar new # gcc dupa.c -o dupa

pi3-darkstar new # gdb -q ./dupa
Reading symbols from /root/priv/projekty/pro-police/new/dupa...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x80483b7
(gdb) r
Starting program: /root/priv/projekty/pro-police/new/dupa 

Breakpoint 1, 0x080483b7 in main ()
(gdb) dump binary memory test_dump.bin 0xffffe000 0xfffff000
(gdb) quit
A debugging session is active.

    Inferior 1 [process 20117] will be killed.

Quit anyway? (y or n) y

pi3-darkstar new # file test_dump.bin
test_dump.bin: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

Read more: pi3 blog
QR: Inline image 1
16 May 2012

Windows 8 Camp in a Box download (Windows 8 CP) - C#/Js Resources, HOL's, Samples and Presentations from the Windows 8 Dev Camps

Inline image 2

Version: 1.0 
Date published: 5/11/2012

Language: English

Windows8CampInABoxCS.exe, 299.5 MB 
Windows8CampInABoxJS.exe, 303.8 MB

This download includes the hands-on-labs, presentations, samples and resources from the Windows 8 camps. The Windows 8 camps are free training events for developers ramping up on Metro style app development.

To sign-up for a Windows camp, please visit http://devcamps.ms/windows.

Supported operating systems: Windows 8 Consumer Preview

Windows 8 Consumer Preview + Microsoft Visual Studio 11 Beta (any SKU, including Express)
We have two packages available. Both packages include the same content and resources; the hands-on-labs are different.

Windows 8CampinaBoxJS includes the hands-on labs for those using HTML + Javascript.
Windows8CampinaBoxCS includes the hands-on-labs that use XAML + C#.
Here's what's in it (at least the C# version), some install and post install snaps.

QR: Inline image 1