Python Is Out For IOS
It looks like Python is the way to go if you want to use a scripting language in the mobile world. Python is out for iOS now, although its not free. It looks like it is a bit further along and more polished than the Android version Google has been working on for awhile now. Writing apps in Python over Java or Objective-C would make life much easier. I guess well see how bad the performance hit for using a scripting language in the mobile world is soon.
Read more: Programming mobile
QR: 
10 Illustrated Examples of Visual Studio 2012
Fresh from the 2012 MVP summit with lots of enthusiasm and grand ideas, I thought it would be worthwhile repeating my 25 illustrated examples of Visual Studio 2010 and .NET 4 post with the technologies of today (or should that be tomorrow?) albeit a few weeks later than I had planned. There are some very, very exciting new things in the pipeline which I’d like to share while they’re fresh in my mind and analogous with that post from two and a half years back, I’d like to actually show you what’s happening.
There’s so much great new stuff in Visual Studio 2012 that it deserves its own post! If I can create the time, I’ll also try and get around to covering ASP.NET specifically. Keeping in mind I’m a very web-centric guy, let me show you some of the features which have gotten me a bit excited about what’s coming in the very near future.
1. Its grey (and other UX changes)
Let’s just get this out there right now; the new Visual Studio UX is polarising. Actually, polarising would suggest there are two different views of it. The reality is there is a strong chorus of “Ugh” at the moment. You see it’s all about Metro these days and that means VS 2012 now looks like this when running on Windows 8:

Just in case you need a little reminder of how things used to look, here’s VS 2010 on Win 7:

There are three things I want to call out in VS 2012 as they’re the three which are repeatedly brought up:
The greyness.
The capitals on panel titles.
The colons on the panels.
You can get a better idea of those last two items here:
Read more: DZone
QR: 
picotux — самый маленький компьютер с Linux в мире
Posted by
jasper22
at
10:21
|
Пока во всю идёт месячник Raspberry Pi, самое время рассказать о самом маленьком компьютере с Linux. Встречайте — picotux 100, детище немецкого гения. 


Общие характеристики
Размеры: 36x19x19 мм
Вес: 18 гр
Рабочая температура: -40°C to 85°C
Характеристики
Процессор: 32-bit ARM 7 Netsilicon NS7520, 55 МГц
Оперативная память: 8 Мб SDRAM
Флеш память: 2 Мб (720 Кб занято под ОС), можно расширить по 4-х
Сеть: 10/100 Mbit, HD and FD, auto sensing
Com-порт: есть контакты, скорость до 230.400 bps
Питание: 3.3 В, 250 мА
ОС: uClinux 2.4.27 (Big Endian native)
Shell: Busybox 1.0
Приложения: Webserver, Telnet
Поддерживаемые ФС: CRAMFS, JFFS2, NFS
Разработка с помощью: GCC + binutils + uClibc
Дата выпуска: 18.05.2005
Цена: 99 Евро
Также доступна прокачанная модель — picotux 112:

Read more: Habrahabr.ru
QR: 
ASP.NET Impersonation and Parallel.ForEach Issue
This week I ran into a very strange issue that has some pretty big implications.
The problem is this: if you use ASP.NET with impersonation, and you also use Parallel.ForEach, threads that run on other cores, lose the execution context.
Put another way, threads that run on other cores don’t respect your impersonation settings, and default to the unimpersonated calling context.
How to reproduce:
First, add impersonation to the web.config (within <system.web>) – for example:
<identity impersonate=“true“
userName=“mydomain\MyServiceAccount“
password=“GoodPassword“/>
Now, in code, I run this code synchronously:
protected void Page_Load(object sender, EventArgs e)
{
Debug.WriteLine(“Process starting as “ + WindowsIdentity.GetCurrent().Name);
List<String> items = new List<string>();
items.Add(“Item 1″);
items.Add(“Item 2″);
items.Add(“Item 3″);
items.Add(“Item 4″);
items.Add(“Item 5″);
items.Add(“Item 6″);
items.Add(“Item 7″);
foreach (String item in items)
{
DoWork(item);
}
}
private void DoWork(String itemName)
{
DebuWriteLine(“Executing “ + itemName + ” as “ + WindowsIdentity.GetCurrent().Name);
}
That results in output, like you might think:
Process starting as myDomain\MyServiceAccount
Executing Item 1 as myDomain\MyServiceAccount
Executing Item 2 as myDomain\MyServiceAccount
Executing Item 3 as myDomain\MyServiceAccount
Executing Item 4 as myDomain\MyServiceAccount
Executing Item 5 as myDomain\MyServiceAccount
Executing Item 6 as myDomain\MyServiceAccount
Executing Item 7 as myDomain\MyServiceAccount
Now, if you instead run that code as a Parallel.ForEach:
Parallel.ForEach(items, (item) =>
{
DoWork(item);
});
You will then see very strange results:
Process starting as myDomain\MyServiceAccount
Executing Item 2 as myDomain\rseder
Executing Item 1 as myDomain\MyServiceAccount
Executing Item 3 as myDomain\rseder
Executing Item 4 as myDomain\MyServiceAccount
Executing Item 6 as myDomain\MyServiceAccount
Executing Item 5 as myDomain\rseder
Executing Item 7 as myDomain\MyServiceAccount
What is happening? I’m not exactly sure. I read quite a few message board comments of people guessing. I spent a whole afternoon going to a zillion different pages, sorry I don’t have anything specific to reference here.
Anyhow, this code ran on a single processor, quad-core computer. It seems as though when code runs on the other cores, it loses execution context.
A Solution, not a great one though:
One solution I found (again, sorry, I couldn’t find link to credit the original idea) was to RE-impersonate the impersonated user, within our Parallel.ForEach. That looks something like this:
// Get a handle to the current, impersonated identity
WindowsIdentity identity = WindowsIdentity.GetCurrent();
Parallel.ForEach(items, (item) =>
{
// RE-impersonate the ASP.NET identity, within this separate task
using (WindowsImpersonationContext impersonationContext =
identity.Impersonate())
Read more: Rob Seder's Blog
.Net Framework Tilde Character DoS
Security Research - .Net Framework Tilde Character DoS
Website : http://soroush.secproject.com/blog/
I. BACKGROUND
---------------------
"The .NET Framework is a software framework developed by Microsoft that runs primarily on Microsoft Windows.
It includes a large library and provides language interoperability
across several programming languages." (Wikipedia)
II. DESCRIPTION
---------------------
Vulnerability Research Team discovered a vulnerability
in Microsoft .NET Framework.
The vulnerability is caused by a tilde character "~" in a Get request, which could allow remote attackers
to Deny the functionality of the server.
III. AFFECTED PRODUCTS
---------------------------
.Net Framework 1.0 Windows XP
.Net Framework 1.1 Windows 2003
.Net Framework 2.0 Windows 2003 R2
.Net Framework 3.0 Windows 2008
.Net Framework 3.5 Windows 2008 R2
.Net Framework 4.0 Windows 2008 R2,Windows 7
IV. Binary Analysis & Exploits/PoCs
---------------------------------------
In-depth technical analysis of the vulnerability and a functional exploit
are available through:
V. SOLUTION
----------------
There are still workarounds through Vendor and security vendors.
Read more: Soroush Secproject
Read more: ExploitDb
QR: 
NVIDIA Nsight Tegra — плагин VS для нативной разработки Android приложений
Posted by
jasper22
at
11:11
|
На прошедшем недавно мероприятии Google I|O компания NVIDIA представила интересный плагин к VisualStudio, позволяющий разрабатывать и дебажить приложения непосредственно из этой среды. 

1. Импорт существующих проектов в Visual Studio.
2. Управление нативными андройд проектами как обычными.
3. Сборка нативного кода Android проектов используя vs-android, ndk-build или make-файлы.
4. Параллельная компиляция как для файла так и для проекта.
5. Увеличение производительности нативного (C/C++) Android кода на 20-30%.
6. Улучшенная поддержка NEON.
7. Link-time optimization (LTO).
Read more: Habrahabr.ru
Read more: NVIDIA Nsight Tegra
QR: 
Cancelling Tasks Started with Parallel.Invoke
Posted by
jasper22
at
08:47
|
Cancelling Parallel.Invoke Tasks
Cancellation of tasks started using Parallel.Invoke uses the same cancellation token approach as when cancelling other parallel operations. Before you start the parallel execution, you must create a CancellationTokenSource object, from which you can request a CancellationToken. This token is passed to the Parallel.Invoke method's first parameter, with the Action array becoming the second parameter. However, the token cannot be provided directly as when creating cancellable Task objects. Instead, you must instantiate a ParallelOptions object and set its CancellationToken property to the generated token.
With the cancellation token provided, you can call its Cancel method from within any of the Action delegates. To avoid problems with early termination, cancelling the tasks does not immediately stop their execution. Any tasks from the array that have not already begun executing will not be started. Any tasks that have already started will continue to run until they complete normally or throw an exception. For particularly long-running tasks, you may also check the cancellation token source's IsCancellationRequested property. If this is true, you can gracefully exit from a task early to improve performance.
When the tasks are cancelled, an OperationCanceledException is thrown, as it would be when you cancel tasks manually. You should generally catch this exception to ensure that it does not cause your software to exit abnormally. Other exceptions will be wrapped in an AggregateException and should be handled appropriately.
To demonstrate cancellation, first we need a cancellation token source that is visible to the entire program. Add the following declaration to the class, outside of any member.
static CancellationTokenSource _tokenSource;
We'll also add a new method that cancels the operation. This will be called by one of the Action delegates.
static void CancellingTask()
{
Console.WriteLine("Cancelling {0}", Task.CurrentId);
_tokenSource.Cancel();
}
Read more: BlackWasp
QR: 
Decrypting SSL packet dumps
Posted by
jasper22
at
08:43
|
We all love transport security but it can get in the way of a good tcpdump. Unencrypted protocols like HTTP, DNS etc can be picked apart for debugging but anything running over SSL can be impenetrable. Of course, that's an advantage too: the end-to-end principle is dead for any common, unencrypted protocol. But we want to have our cake and eat it.
Wireshark (a common tool for dissecting packet dumps) has long had the ability to decrypt some SSL connections given the private key of the server, but the private key isn't always something that you can get hold of, or want to spread around. MITM proxies (like Fiddler) can sit in the middle of a connection and produce plaintext, but they also alter the connection: SPDY, client-certificates etc won't work through them (at least not without special support).
So here's another option: if you get a dev channel release of Chrome and a trunk build of Wireshark you can run Chrome with the environment variable SSLKEYLOGFILE set to, say, /home/foo/keylog. Then, in Wireshark's preferences for SSL, you can tell it about that key log file. As Chrome makes SSL connections, it'll dump an identifier and the connection key to that file and Wireshark can read those and decrypt SSL connections.
Read more: ImperialViolet
QR: 
#593 – AddHandler Method Can Add Handler for Any Event
If you’re adding an event handler from code, rather than specifying the handler in XAML, you can just use the += notation for an event that is defined for the control in question. For example, the Button control defines a Click control, so you can do the following:
myButton.Click += new RoutedEventHandler(Button_Click);
But let’s say that you want to add a handler for the Click event to a StackPanel control, which does not define the Click event, and you want to do it from code. You can then use the AddHandler syntax:
myStackPanel.AddHandler(ButtonBase.ClickEvent, (RoutedEventHandler)HandleTheClick);
Read more: 2,000 Things You Should Know About WPF
QR: 
Почему бы я не рекомендовал Atmel или о непонимании успеха Arduino
Posted by
jasper22
at
12:28
|
Хочу немного поделиться негативным опытом использования микроконтроллеров Atmel в промышленной разработке.
Atmel как целевую платформу выбрал заказчик, хотя мы его и отговаривали (еще даже не зная, что нам предстоит — интуиция, что ли?). Ну что же, «заказчик всегда прав».
В продукте было два контроллера — 32-битный UC3A3 и 8-битный ATMega164. В качестве дебаггера выбрали AVR One!, в качестве среды разработки — AVR Studio 5.0 (последняя версия на момент старта).
И началось!
У двух из трех купленных AVR One! в течении первого же месяца отвалились JTAG-коннекторы. У одного из них пропадал контакт питания. Каждый дебаггер, к слову, стоит около 600 евро!
При первом подключении дебаггера к компу с установленной AVR Studio 5.0 последняя захотела обновить ему прошивку. И не просто захотела, а отказывалась работать без этого. Процедура обновления прошивки благополучно зациклилась в «обновление — ожидание готовности устройства — обновление завершено неуспешно — обновление...», произвести ее удалось только после долгих танцев с бубнами.
На начальной стадии работа ведется на Evaluation платах. Были такие и у Атмела. Вот только на «готовых» эвалкитах к большинству пинов процессора банально не было доступа! А универсальный пакет STK600, позволяющий «воткнуть» в него практически любой контроллер при помощи переходника (решение реально супер, если бы не одно но), имел маленький недостаток — его схема была недоступна ни в открытом доступе, ни за деньги! Блин, вот реально — тулкит, предназначенный для экспериментов с платформой, поставлялся без схемы! И схема его охранялась очень и очень тщательно, судя по многочисленным веткам на AVR freaks. Поскольку мы не могли представить себе, как же можно работать без наличия схемы, мы разумно отказались от покупки этого тулкита (который ни разу не дешевый, к слову!).
Еще веселее стало, когда приступили собственно к написанию и отладке кода.
Самым веселым оказалось то, что пошаговая отладка оказалась в принципе невозможной. Дело в том, что поставив где-нибудь в коде брейкпоинт, дождавшись остановки программы в этом месте и выполнив «шаг вперед», ты оказывался… в обработчике прерывания! (Естественно, в прерывании при этом никаких брейкпоинтов не было!). А поскольку прерывания в системе были всегда (таймеры и т.п.), процесс отладки выглядел следующим образом: приходилось ставить следующий брейкпоинт на следующей строке и нажимать Run вместо Step Over. Особенно весело это было, когда надо было отследить if или switch. Или же выполнить Step Into, а не Step Over…
Read more: Habrahabr.ru
QR: 
ASP.NET MVC, Web API, Razor and Open Source
Microsoft has made the source code of ASP.NET MVC available under an open source license since the first V1 release. We’ve also integrated a number of great open source technologies into the product, and now ship jQuery, jQuery UI, jQuery Mobile, jQuery Validation, Modernizr.js, NuGet, Knockout.js and JSON.NET as part of it.
I’m very excited to announce today that we will also release the source code for ASP.NET Web API and ASP.NET Web Pages (aka Razor) under an open source license (Apache 2.0), and that we will increase the development transparency of all three projects by hosting their code repositories on CodePlex (using the new Git support announced last week). Doing so will enable a more open development model where everyone in the community will be able to engage and provide feedback on code checkins, bug-fixes, new feature development, and build and test the products on a daily basis using the most up-to-date version of the source code and tests.
We will also for the first time allow developers outside of Microsoft to submit patches and code contributions that the Microsoft development team will review for potential inclusion in the products. We announced a similar open development approach with the Windows Azure SDK last December, and have found it to be a great way to build an even tighter feedback loop with developers – and ultimately deliver even better products as a result.
Very importantly - ASP.NET MVC, Web API and Razor will continue to be fully supported Microsoft products that ship both standalone as well as part of Visual Studio (the same as they do today). They will also continue to be staffed by the same Microsoft developers that build them today (in fact, we have more Microsoft developers working on the ASP.NET team now than ever before). Our goal with today’s announcement is to increase the feedback loop on the products even more, and allow us to deliver even better products. We are really excited about the improvements this will bring.
Learn More
You can now browse, sync and build the source tree of ASP.NET MVC, Web API, and Razor on the http://aspnetwebstack.codeplex.com web-site.
The Git repository on the site is the live RC milestone development tree that the team has been working on the last several weeks, and the tree contains both the runtime sources + tests, and is buildable and testable by anyone. Because the binaries produced are bin-deployable, this allows you to compile your own builds and try product updates out as soon as they are checked-in.
You can also now contribute directly to the development of the products by reviewing and sending feedback on code checkins, submitting bugs and helping us verify fixes as they are checked in, suggesting and giving feedback on new features as they are implemented, as well as by submitting code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the ASP.NET MVC Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.
Read more: ScottGu's Blog
QR: 
Quake 3 Source Code Review
Posted by
jasper22
at
00:13
|
id Software has a history of releasing the source code for their older games under the GPL. Coder Fabien Sanglard has been taking it upon himself to go through each of these releases, analyze the source code, and post a detailed write-up about it. He's now completed a review of the Quake 3 source code, diving into the details of idTech3. It's an interesting read — he says he was impressed in particular by the 'virtual machines system and the associated toolchain that altogether account for 30% of the code released. Under this perspective idTech3 is a mini operating system providing system calls to three processes.
Read more: Slashdot
Security flaw in MySQL, MariaDB allows access with any password—just keep submitting it
When the latest release of MariaDB was announced in April by MontyProgram AB founder and MySQL creator Michael "Monty" Widenius, it came with a warning from Widenius that a severe security bug had been discovered in previous versions of both MariaDB and MySQL. Oracle subsequently released a patch for MySQL. Now the details of the flaw, and the extent of the vulnerability, have been revealed: it could allow anyone who knows a valid user account on the database to connect using any password with a brute-force attack.
The affected versions of both databases have a flaw in their authentication system caused by a variation in how the memcmp() function—which compares two values stored in memory to see if they are equal—is implemented in some Linux compilers. When a user connects to the database and submits a password, the authentication system of the databases creates a token from the submitted password using a Secure Hash Algorithm and a randomly generated string of text as the key. The resulting token is compared to a hash made from the stored password in the system using the memcmp function, which returns a value of zero if they're the same; if they're not, the function is supposed to return a positive or negative integer. A return of "0" would mean the password is correct.
But in the affected versions of MariaDB and MySQL, as MontyProgram's Sergei Golubchik wrote in a list posting on June 9, the database can be fooled into accepting a password even if it doesn't match. "Because of incorrect [type] casting [in the code]," he wrote, "it might've happened that the token and the expected value were considered equal, even if the memcmp() returned a non-zero value. In this case, MySQL/MariaDB would think that the password is correct even while it is not."
Because of the random key strings used, Golubchik said the probability of exploiting the flaw on any given attempt "is about 1/256"; with enough attempts, even using the same password over and over again, an attacker could gain access just by knowing a valid account name (such as "root"). Given that it takes less than a second to submit hundreds of login attempts, the hole essentially renders password protection worthless.
Read more: arstechnica
QR: 
New .NET Diagnostic info added to Process Explorer
Posted by
jasper22
at
12:14
|
In this post, we will look at a new feature in Process Explorer, the popular SysInternals tool, which enables developers and IT Pros to collect accurate stack traces for .NET applications.
Adding .NET Stack frames to Process Explorer
A few months ago, a few of us on the .NET Team were looking at how we could improve Process Explorer to provide better diagnostic information for .NET applications. Process Explorer is a very useful tool for investigating why something is going wrong. We know that millions of developers and IT Pros use Process Explorer, so it would seem that even small improvements for .NET would be pretty useful.
After a little conversation, we decided that adding support for .NET frames in Process Explorer’s Stack window would be the most valuable improvement that we could make. We reached out to Mark Russinovich to pitch the idea. For those of you that don’t know, Mark is the creator and maintainer of Process Explorer, and is a Technical Fellow at Microsoft. Mark was immediately supportive of the idea, and gave us the go-ahead to make the changes in the Process Explorer code. That work is now done, and available as part of Process Explorer v15.2 (or later).
What can you do with this new support?
Developers typically reach for Visual Studio when one of their applications starts doing the wrong thing. As the developer of an app, you can reproduce the issue on your own, attach to a badly behaving live repro or look at a dump. You have the source, and can easily go from there. Visual Studio 2012 is great for that scenario.
Sometimes you are a developer working with a customer on their machine and don’t have access to your tools or your application source. You could also be an IT Pro who supports an application that someone else built. In either case, Process Explorer can help you quickly collect diagnostic information, such as call stacks, that can give you an early lead.
Read more: .NET Framework Blog
QR: 
In the blink of an eye: There goes your AES key
Posted by
jasper22
at
10:55
|
In the blink of an eye: There goes your AES key
(DRAFT of 28 May 2012)
Sergei Skorobogatov
University of Cambridge
Cambridge, UK
e-mail: sps32@cam.ac.uk
Abstract—This paper is a short summary of a real world AES key extraction performed on a military grade FPGA marketed as 'virtually unbreakable' and 'highly secure'. We demonstrated that it is possible to extract the AES key from the Actel/Microsemi ProASIC3 chip in a time of 0.01 seconds
using a new side-channel analysis technique called Pipeline Emission Analysis (PEA). This new technique does not introduce a new form of side-channel attacks (SCA), it introduces a substantially improved method of waveform analysis over conventional attack technology. It could be used to improve upon the speed at which all SCA can be performed, on any device and especially against devices previously thought to be unfeasible to break because of the time and equipment cost. Possessing the AES key for the ProASIC3 would allow an attacker to decrypt the bitstream or authenticate himself as a legitimate user and extract the bitstream from the device where no read back facility exists. This means the device is wide open to intellectual property theft, fraud and reverse engineering of the design to allow the introduction of a backdoor or Trojan. We show that with a very low cost hardware setup made with parts obtained from a local electronics distributor you can improve upon existing SCA up to a factor of x1,000,000 in time and at a fraction of the cost of existing SCA equipment.
Read more: PDF
QR: 
How to call WinRT APIs from C# Desktop applications – list the installed Metro packages
Posted by
jasper22
at
10:51
|
As Jaime Rodriguez detailed in April, Windows 8 Excellence Labs are made to help Metro developers to get a token which allows them to submit their application to the Windows Store with high confidence. I’m lucky enough to be part of this Microsoft effort and I hope meeting some of you soon :^)
A tool has been built to help Microsoft engineers to more easily check some basics of a Metro App such as implemented contracts or logos. This is a WPF Desktop application written in C# and its first task is to enumerate the installed Metro App packages.
I can imagine other scenari where you will certainly be interested in automatically checking that your application is well installed. This post will detail how a .NET developer could leverage WinRT from his Desktop application.
How to see the WinRT APIs in VS/.NET Decompiler
When you create a blank Metro App in C# with VS 2012 RC, two references are added to the project:

The first one allows you to use .NET types and the second one is the .NET view of the WinRT APIs. When you display the properties of the latter:

you end up in the C:\Program Files (x86)\Windows Kits\8.0\References\CommonConfiguration\Neutral\ folder where Windows.winmd waits for you. As explained by Martyn Lovell during his Lap around the Windows Runtime BUILD session, the WinRT team decided to keep the metadata format used by .NET assemblies to define their types and members.
Read more: Anything about WinRT
QR: 
Visual Studio 2012 New Features: Quick Launch
Posted by
jasper22
at
10:38
|
In the past, finding things deep in the IDE has been a challenge. Visual Studio 2012 introduces search abilities at virtually every level of the product. Perhaps the biggest change is the introduction of Quick Launch (CTRL + Q) which specifically addresses how to dig inside Visual Studio to find features you need. Let’s take a look.
Quick Launch: Basic Use
You can find Quick Launch in the upper right corner of the IDE:
The most basic scenario for using Quick Launch is finding an item that you have forgotten (or don’t know) the location of. Let’s say you are interested in something deep in the menu system like viewing your white space. You know what it’s called but can’t remember where it is at. Just press CTRL + Q and enter the word white:
All searches are contains operations so the results will show anything that has the word white anywhere in it. The results are grouped into categories and you simply either select the item from the list using your keyboard, mouse or, if there is a keyboard shortcut listed, take advantage of the shortcut. In this case, you could press CTRL+R, CTRL+W to show the white space and then go on with your work.
Categories
There are four categories that your results will fall into when using Quick Launch. Let’s take a look at each of these categories.
QR: 
NHibernate 3.2 mapping by code
Posted by
jasper22
at
00:40
|
NHibernate 3.2 will come with its own embedded mapping by code.
If you want know it is not based in fluent-interface, instead it is based on “loquacious”. That said you should understand that it has nothing related with Fluent-NHibernate.
The main idea under the NHibernate’s “sexy mapping” came from my dear ConfORM. In the past year the no conformist red man was running a lot and now I’m ready to transfer most of ConfORM’s intelligence directly inside NHibernate. To continue reading this post you have to run this song.
It’s simple (I’m too sexy)
Simple model
public class MyClass
{
public int Id { get; set; }
public string Something { get; set; }
}
Simple mapping
var mapper = new ModelMapper();
mapper.Class<MyClass>(ca =>
{
ca.Id(x => x.Id, map =>
{
map.Column("MyClassId");
map.Generator(Generators.HighLow, gmap => gmap.Params(new { max_low = 100 }));
});
ca.Property(x => x.Something, map => map.Length(150));
});
It’s flexible (I’m too sexy for my application)
You can organize your mapping as you want, class-by-class, different concerns about a class in different places and so on… (yes!! if you are a ConfORM user you know the concept)
var mapper = new ModelMapper();
mapper.Class<MyClass>(ca =>
{
ca.Id(x => x.Id, map =>
{
map.Column("MyClassId");
});
ca.Id(x => x.Id, map =>
{
map.Generator(Generators.HighLow, gmap => gmap.Params(new { max_low = 100 }));
});
ca.Property(x => x.Something);
ca.Property(x => x.Something, map => map.Length(150));
});
Read more: HunabKu
QR: 
Foolish consistency is foolish
Once again today's posting is presented as a dialogue, as is my wont.
Why is var sometimes required on an implicitly-typed local variable and sometimes illegal on an implicitly typed local variable?
That's a good question but can you make it more precise? Start by listing the situations in which an implicitly-typed local variable either must or must not use var.
Sure. An implicitly-typed local variable must be declared with var in the following statements:
var x1 = whatever;
for(var x2 = whatever; ;) {}
using(var x3 = whatever) {}
foreach(var x4 in whatever) {}
And an implicitly-typed local variable must not be declared with var in the following expressions:
from c in customers select c.Name
customers.Select(c => c.Name)
In both cases it is not legal to put var before c, though it would be legal to say:
from Customer c in customers select c.Name
customers.Select((Customer c) => c.Name)
Why is that?
Well, let me delay answering that by criticizing your question further. In the query expression and lambda expression cases, are those in fact implicitly typed locals in the first place?
Hmm, you're right; technically neither of those cases have local variables. In the lambda case, that is a formal parameter. But a formal parameter behaves almost exactly like a local variable, so it seems reasonable to conflate the two in casual conversation. In the query expression, the compiler is going to syntactically transform the range variable into an untyped lambda formal parameter regardless of whether the range variable is typed or not.
Read more: Eric Lippert’s Blog
QR: 
Let the moose run free...! Mighty Moose, a Continuous Testing Tool, is now free (as in free)
Posted by
jasper22
at
12:06
|
As some of you may know Svein (@ackenpacken) and I have decided to make Mighty Moose free. This is not a decision that is being take lightly and much thought has gone into it. This post is to explain why we went free and the future
...
Mighty Moose is from this point forward free. Not “free in beta” or “free with a bunch of functionality turned off” but free (license is being updated as I write this). We announced this rather quietly at NDC.
Many people have asked me “why would you go free? you could charge for what you have.”. This is true. Continuous Testing tools will be taking off and yes we could charge for it however its not quite as simple as that.
Read more: Greg's Cool [Insert Clever Name] of the Day
QR: 
Subscribe to:
Posts (Atom)