This is a mirror of official site: http://jasper-net.blogspot.com/

NET Micro Framework

| Wednesday, July 21, 2010
.NET Micro Framework 4.1 SDK
The .NET Micro Framework is a .NET implemenation for very small, resource constrained devices. With version 4.1, we have added VS 2010 compatibility with multi targeting to support development for NETMF versions 3.0, 4.0, and 4.1. We have also added support for Big Endian processors. In addition, we have included ports for the Following Renesas processors and development boards: SH7216 RSK, SH7264 M3A HS64, SH7264 RSK, SH7619 EVB. We have added new applications diagnostics and DPWS custom bindings and additional samples. Finally, we have added the Hashtable type and enhanced the SPI type.

Read more: MS Download

.NET Micro Framework 4.1 Cryptography Companion Libraries
The Microsoft® .NET Micro Framework is a platform that enables developers to more quickly develop embedded systems that are smart, securely connected, and easier to manage. With the version 4.1 release, the .NET Micro Framework enables developers to create powerful embedded systems that are more securely connected through a variety of wired and wireless protocols.

Read more: MS Download


.NET Micro Framework 4.1 TCP/IP and SSL Libraries for Thumb Instruction Set
The Microsoft® .NET Micro Framework is a platform that enables developers to more quickly develop embedded systems that are smart, securely connected, and easier to manage. With the version 4.1 release, the .NET Micro Framework enables developers to create powerful embedded systems that are more securely connected through a variety of wired and wireless protocols.

Read more: MS Download

.NET Micro Framework 4.1 TCP/IP and SSL Libraries for SH2/A Instruction Set
The Microsoft® .NET Micro Framework is a platform that enables developers to more quickly develop embedded systems that are smart, securely connected, and easier to manage. With the version 4.1 release, the .NET Micro Framework enables developers to create powerful embedded systems that are more securely connected through a variety of wired and wireless protocols.

Read more: MS Download

.NET Micro Framework 4.1 TCP/IP and SSL Libraries for ARM Instruction Set
The Microsoft® .NET Micro Framework is a platform that enables developers to more quickly develop embedded systems that are smart, securely connected, and easier to manage. With the version 4.1 release, the .NET Micro Framework enables developers to create powerful embedded systems that are more securely connected through a variety of wired and wireless protocols.

Read more: MS Download

Posted via email from .NET Info

NET 4 is on windows update !

|
Today I was running windows update on some virtual machines, and noticed that .NET 4 Client Profile is available via windows update.  Seems it was released to windows update in June.

For Windows XP the update is optional. For Windows 7 and Vista the update is recommended.  What this basically means is for XP users they will typically need to run windows update and select .NET 4 from the optional updates:

3644.image_5F00_thumb_5F00_54B444F0.png

Read more: @ Head

Posted via email from .NET Info

Build a WPF Interactive Animation Application

|
Introduction

This article describes how to make a basic game – a window where bomb user controls drop from the top – to prompt the user to intercept them. To do this we are going to use Expression Blend 4, as anyone who has ever used this developer tool knows that the Design space is easily switched to an Animation space. WPF applications are sometimes easier to build using Expression Blend. Todd Miranda has a plethora of educational videos about how to use Expression Blend, found at expression.microsoft.com/en-us/cc197141.aspx . I am writing this article to show both the importance of C# in two code-behind files: one for the Main Window, and the other for the bomb, which is a UserControl, an added new item. If you are unfamiliar with how this application derives its output, do not be intimidated. Expression Blend 4 functions as a superior vector-based design tool used to gain a stronger hold on both of the Windows Presentation Foundation technology and Silverlight.

Here is a look at the WPF application. Many beginners, me included, develop WPF applications to implement the powerful graphics, animations, and media facilities. This application serves as an amusing little game, or it can serve as a skeleton application for the reader to expand on.

Read more: Codeproject

Posted via email from .NET Info

How to execute a TSQL statement for all databases

|
I wanted a quick way to execute a TSQL command against all databases.  I was having hard time getting the sp_MSforeachdb to work and didn’t want to write a cursor,  so I instead built a TSQL command which makes the commands I need to execute.  Not fancy, but it got the job done.

--Command to be exeuted on all databases
SELECT DATABASEPROPERTY( 'Northwind' ,'IsFulltextEnabled')
--undocumented command, but hard to get syntax correct with imbedded ' (quotes)
sp_MSforeachdb "SELECT DATABASEPROPERTY( ?  ,'IsFulltextEnabled')"
--Use statement below to build the TSQL commands to be executed
--Set Output-to-Text before running.
select 'SELECT DATABASEPROPERTY( ' + char(39) + name + char(39) + ',' + char(39)
  + 'IsFulltextEnabled' + char(39) + ')'
  from sysdatabases

Read more: REPLTalk covers Using and Tuning SQL Replication

Posted via email from .NET Info

Системные переменные MySQL сервера.

|
auto_increment_increment
Устанавливает приращение для механизма AUTO_INCREMENT. Возможные значения: 1 - 65 535. Значение по умолчанию: 1. При установке значения 0,получает значение 1, при попытке присвоить значение меньше нуля или больше 65 535, принимает значение 65 535. Если например, присвоить данной переменной значение 10, то значения счетчика автоинкремента, будет увеличиваться не на 1, а на 10.Введена с версии 5.0.2.

auto_increment_offset
Устанавливает начальное значение счетчика для механизма AUTO_INCREMENT. Возможные значения: 1 - 65 535. Значение по умолчанию: 1. При установке значения 0, получает значение 1, при попытке присвоить значение меньше нуля или больше 65 535, принимает значение 65 535. Если присвоить этой переменной значение 7, счетчик автоинкремента, начнет увеличиваться не с 1, а с 7. Введена с версии 5.0.2.

back_log
Размер очереди запросов на подключение клиентов. При получении вхлдящего запроса на соединение, основной поток MySQL сервера, после проверки запроса, запускает новый поток. Если запросов на соединение пришло слишком много за короткий промежуток времени, на их обслуживание потребуется некоторое время. Данная переменная устанавливает количество запросов, которые могут быть помещены в стек, на время, пока не освободится основной поток для их обслуживания. Все соединения выше данного значения - отбрасываются, клиенту выдается соответствующее сообщение. По сути, данная переменная устанавливает длину очереди, входящих TCP соединений, и не может привышать значение, установленной операционной системой.

basedir
Содержит путь к базовому каталогу установки. Может быть установлена с помощью параметра командной строки: --basedir

Read more: BSDADMIN.RU

Posted via email from .NET Info

Xaps Minifier. Дополнение для Visual Studio 2010, позволяющее уменьшать размер Silverlight приложений

|
Я постоянно работаю с Silverlight приложениями и выкладываю релизы регулярно. Как правило, я использую паттерн MVVM и его реализацию Prism. В результате создаётся несколько XAP файлов, содержащих сборки приложения и манифест.

Каждый, кто работает в соответствии с таким подходом, замечает, что большинство XAP файлов содержат дублирующиеся сборки. Например, при использовании библиотеки Prism, практически каждый XAP файл будет содержать все сборки из этой библиотеки. Prism добавляет порядка 300 Кб к каждому XAP файлу, что может увеличить размер приложения более чем на 1 Мб (при наличии 4-5 XAP файлов). Кроме того, дополнительные библиотеки (в первую очередь UI элементов) могут ещё более увеличить размер приложения.

Все эти факты заставили меня начать поиск пути уменьшения размеров XAP файлов.

Идея

Я работал над одной проблемой, когда наткнулся на заметку в блоге Jeff Prosise. Он упоминал, что сборка может быть добавлена в приложение, но не в XAP файл. Для этого достаточно установить параметр

CopyLocal=false

для каждой требуемой сборки, которая находится в списке References. В этом случае проект будет ссылаться на нужную сборку, но не будет добавлять её в папку bin при компиляции.

Это натолкнуло меня на мысль, что всем дублирующимся сборкам в приложении можно проставить

CopyLocal=false

не изменяя только параметры сборок главного XAP файла. Именно главный XAP файл должен содержать все дублирующиеся сборки, которые будут автоматически загружаться в Application Domain, и будут доступны для всех сборок из остальных XAP файлов.

Read more: Habrahabr.ru

Posted via email from .NET Info

NET Hidden Gems - Memory fail points

|
I am embarking in a series of mini post called .NET hidden gems, not necessarily new bits but usually unknown. They are dedicated to those small features and components that are not commonly used but can deliver interesting value in certain scenarios.
Today I am going to show you some functions that can help you to understand the memory state of your application when you need to store large objects.
The first hidden gem is the MemoryFailPoint object, this can be accessed through the System.Runtime namespace.
The main function of it is validating that there is enough memory to perform an operation.

[SecurityCritical]
public MemoryFailPoint(int sizeInMegabytes);
It is very easy to use it, just create an instance when you need the memory:
//
// Do I have enough memory to run this method?
//
System.Runtime.MemoryFailPoint CheckForMemory = new System.Runtime.MemoryFailPoint(1000);

Internally, it checks the global memory status of the process; if it does not have enough it will perform a full collection.

Read more: MSDN Utopia

Posted via email from .NET Info

Community Goodies: Silverlight for PC

|
Tools and Enviroment
Enviroment
Visual Studio 2008
Visual Studio 2008 SP1
Visual Studio 2010
Expression Studio 3
Expression Blend 4 RC

Tools
Silverlight Toolkit
Silverlight3 Tools for Visual Studio 2008 SP1
Silverlight4 Tools RC2 for Visual Studio 2010
WCF RIA RC2
WCF RIA Services Toolkit
WCF RIA Hotfix(For WCF RIA Beta)

Features
Application and Programming Models
Managed API for Silverlight
Dynamic Languages in Silverlight
Communication Between Local Silverlight-Based Applications
Out-of-Browser SupportAlternative Hosting
Layout, Text, and Input
Controls
Graphics, Animation, and Media
XAML
Integrating Silverlight with a Web Page
Types, Properties, Methods, and Events
Data Access and Data Structures
Networking and Communication
Debugging, Error Handling, and Exceptions
Deployment and Localization
Performance
Security

Read more: Community Goodies

Posted via email from .NET Info

Debugging an OOB Silverlight Business Application

|
Recently, we came across a bug with the Silverlight Business Application with respect to an Out of Browser application. In the RTM bits for Silverlight 4 Tools a new feature was added to enable a better debugging experience with Out of Browser application. The feature basically launched the app in OOB window when run with the debugger attached. If you have tried that with the business application template, you will notice that the app does not run. It crashes with an exception, that the URI path is not valid.

We realize this is an issue most folks are running into and we have fixed this template and we are looking ways to get you access to it. However, there is a relatively easy workaround to fix this issue.

The steps involved are :-

Create a new or open up an existing application that was created using the BusinessApplicationTemplate
Once the project is open, go to the Project Properties page for the Silverlight Application.
In that, first uncheck the OOB option which is enabled by default


Save the project
Close the Project Property Page
Open the Project Property page again
Then go ahead and check the OOB option.

Read more: @deepeshm

Posted via email from .NET Info

Ubuntu Kung-Fu – 10 Best Tricks (and some even work on Macs)

|
If your vision of a great vacation is laying down with a laptop on your belly, banging away on new bash commands and scripts, then this is the book for you.

Now here are my favorite 10 tips.

1. Command History Search with Ctrl+R – In a terminal, the up and down arrow shuffles through recent commands on almost any operating system. I had been using grep to search my history (history | grep something) until I found out about Ctrl+R. When you type Ctrl+R, the terminal goes into a matching mode where it tries to guess the entry from your history based on what you type. So type the first few letters of a recent command and the entire thing comes up. This is great, and I use it regularly to expand out “git pu” into a full “git pull origin master”. But don’t get the wrong idea! I still think git is awful.

2. Running jobs with & and nohup – I discovered & long ago. If you run a program from the command line then the terminal is frozen until the program completes. But if you append & (for instance, “gedit &”) then it launches as a job and you can use the terminal again while your program runs simultaneously. The problem is if you close the terminal then your other program closes as well. Instead use nohup (”nohup gedit”) so that your program does not hang up when the terminal closes.

3. Use Trash for Command Line File Deletes – There are a bunch of safe alternatives to deleting files using “rm -rf”, and this type lists yet another one. However, I prefer to use the “trash” package. Just run:
sudo apt-get install trash

Read more: canoo

Posted via email from .NET Info

Knights, Knaves, Protected and Internal

|
When you override a virtual method in C# you are required to ensure that the stated accessibility of the overridden method - that is, whether it is public, internal, protected or protected internal(*) – is exactly re-stated in the overriding method. Except in one case. I refer you to section 10.6.4 of the specification, which states:

an override declaration cannot change the accessibility of the virtual method. However, if the overridden base method is protected internal and it is declared in a different assembly than the assembly containing the override method then the override method’s declared accessibility must be protected.

What the heck is up with that? Surely if an overridden method is protected internal then it only makes sense that the overriding method should be exactly the same: protected internal.

I’ll explain why we have this rule, but first, a brief digression.

A certain island is inhabited by only knights and knaves. Knights make only true statements and only answer questions truthfully; knaves make only false statements and only answer questions untruthfully. If you walk up to an inhabitant of the (aptly-named) Island of Knights and Knaves you can rapidly ascertain whether a particular individual is a knight or a knave by asking a question you know the answer to. For example “does two plus two equal four?” A knight will answer “yes” (**), and a knave will answer “no”. Knaves are prone to saying things like “my mother is a male knight”, which is plainly false.

It might seem at first glance that there is no statement which could be made by both a knight and a knave. Since knights tell the truth and knaves lie, they cannot both make the same statement, right? But in fact there are many statements that can be made by both. Can you think of one?

Read more: Fabulous Adventures In Coding

Posted via email from .NET Info

Fresh Mono Baked

|
Andrew just announced Mono 2.6.7, the version that is replacing our long-term maintenance release of Mono with plenty of bug fixes as well as the following new features:

Microsoft's ASP.NET MVC2 is now bundled with Mono.
Upgraded xbuild tool (Mono's msbuild)
Upgraded our LINQ to SQL (DbLinq)
Upgraded our Soft Debugger
We now publish CentOS/RHEL packages.

Our CentOS/RHEL packages install on /opt/novell/mono, just like our packages for SUSE Linux Enterprise and should not conflict with your own packages of Mono that you might have from some other sources.

Read more: Miguel de Icaza's web log

Posted via email from .NET Info

Import Data from Excel to DataGridView in C#

|
First need to add the reference "Microsoft ADO Ext. 2.8". You can easily add it from COM components.

Add an open Dialog box control on form

Put the following code on Browser button click events…..

       private void button1_Click_1(object sender, EventArgs e)
       {
           OpenFileDialog fdlg = new OpenFileDialog();
           fdlg.Title = "Select file";
           fdlg.InitialDirectory = @"c:\";
           fdlg.FileName = txtFileName.Text;
           fdlg.Filter = "Excel Sheet(*.xls)|*.xls|All Files(*.*)|*.*";
           fdlg.FilterIndex = 1;
           fdlg.RestoreDirectory = true;
           if (fdlg.ShowDialog() == DialogResult.OK)
           {
               txtFileName.Text = fdlg.FileName;
               Import();
               Application.DoEvents();
           }
       }

This will filter only Excel file from your Machine.

This Excel file can contains more than one Sheet. You need to add another form to all excel sheets name so that user can select any one excel sheet which he want to import.

Write the following code on Page Load even of this form

       private void Select_Tables_Load(object sender, EventArgs e)
       {
           if (!DataTables)
           {
               if (Tables != null)
               {
                   for (int tables = 0; tables < Tables.Length; tables++)
                   {
                       try
                       {
                           ListViewItem lv = new ListViewItem();
                           lv.Text = Tables[tables].ToString();
                           lv.Tag = tables;
                           lstViewTables.Items.Add(lv);
                       }
                       catch (Exception ex)
                       { }
                   }
               }
           }
           else

Read more: C# Corner

Posted via email from .NET Info

Mono's Git Migration

|
Mono's source code is being migrated to GitHub on July 22nd, starting at 9am Boston time.

We are psyched that Github was kind enough to host Mono's large repositories for free on their system. We are also taking advantage of their new Organizations functionality.

Gonzalo posted the following details about the migration:

We are moving our source code repository to GitHub.

On July 22nd ~9am EDT (1300 GMT) the subversion repository at "svn+ssh://mono-cvs.ximian.com/source" will be set to read-only mode and kept that way forever.

We estimate that the process of migrating all the projects and moving them to GitHub will take more than 3 and less than 8 hours. Once it is completed we will send an email to this list with URLs to the new repositories, FAQs,...

Read more: Miguel de Icaza's web log

Posted via email from .NET Info

How to be a Cool C# Programmer

|
There are many C# programmers out there… but you probably want to be the coolest… it’s not enough to just call a bunch of methods, invoke some delegates, etc. You need to write it cool.

Here are some ways you can make yourself a cool C# programmer (and pick up geeky chicks at your local C# party):

1. Use anonymous delegates whenever possible (or lambda expressions, see 2):

var nums = new List<int>();
//...
var nums2 = nums.FindAll(delegate(int n) {
  return n % 2 == 0;
});

2. Use lambda expressions when delegates are required (this is super-cool):

button1.Click += (s, e) => {
  MessageBox.Show("This is super-cool!");
};


3. If you’re using a lambda expression that accepts one argument and you don’t need it, provide its name as underscore:

ThreadPool.QueueUserWorkItem((_) => {
  Console.WriteLine("This is way too cool!");
});

4. When raising events, the event should be checked to be non-null, but the cool thing to do is always register an empty handler so the check is unnecessary:

class Printer {
  public event EventHandler PagePrinted = delegate { };
  //...
  protected virtual void OnPagePrinted() {
     PagePrinted(this, EventArgs.Empty); // look ma, no check!
  }
}

5. Use LINQ whenever possible, using complex operators if you can:

var procs = from p in Process.GetProcesses()
           where p.Threads.Count > 15
           orderby p.ProcessName
           group new {
              Name = p.ProcessName,
              Id = p.Id,
              Threads = p.Threads.Count
           } by p.BasePriority into g
           orderby g.Key descending
           select g;

foreach(var g in procs) {
  Console.WriteLine("Priority {0}", g.Key);
  foreach(var p in g)
     Console.WriteLine("  {0}", p);
}

Read more: Pavel's Blog

Posted via email from .NET Info

Dokan.Mem, a filesystem prototype

|
Introduction

Hiroki Asakawa created a device driver that enables an application in user-mode to simulate a file-system, and distributed it under a MIT-style license. This post shows how that's used in C# to create the functionality of a RAM-Disk, with some tips on rolling your own file-system application.

Before you can run the code, you have to run the installer to install a proxy driver (dokan.sys). This driver then acts as an intermediate between the kernel and our custom .NET solution. The installer for the proxy driver is also included with the sourcecode here, but I'd recommend downloading the package from the original website as they contain two cool examples; The first implements a mirror of your C-drive, and the second makes the Registry available as a readonly drive. This article briefly explains how the Dokan-libraries are used to build something that resembles a RAM-disk in functionality

Having the option to expose data as a file-system has several advantages. It makes your data instantaneous available for other applications, without the need for a complicated UI.

Download the basic installer and .NET bindings to Dokan here[^].

Using the code

Log in as administrator, run the installer (it's just 513 Kb), open the project and hit F5; a trayicon should appear, and on doubleclick it should open the Windows-Explorer, pointing to a simulated harddisk. It'll mount on the first available free drive-letter. Paste a zipfile on there and extract it :)

I choose to implement a basic RAM-Disk to test the library (version 0.5.3), with the results documented here.

There's three projects in the solution;

DokanNet - these are the .NET bindings to the Dokan libraries
Buffers - used to replace the MemoryStream
Dokan.Mem - example-implementation of the Dokan-interface, simulating a RAM-Disk

Read more: Codeproject

Posted via email from .NET Info

Install LAMP with just one command line on Debian/Ubuntu

|
I'm so tired of install Apache with MySQL and PHP. I always have to make lots of "apt-get"s tto get all the packages installed just because I don't remember all of them at the first "apt-get".

Here is the line to install all you (probably) need:

apt-get install mysql-client mysql-common mysql-server mysql-server php5-mysql php-apc php-db php-pear php5 php5-cli php5-common php5-curl php5-gd php5-imagick php5-mcrypt php5-memcache php5-memcache php5-mysql php5-sqlite php5-suhosin apache2 apache2-doc apache2-mpm-prefork apache2-suexec apache2-utils apache2.2-common libapache2-mod-php5

Now we have to do some fine tunning. I know... it brokes the "Just One Command" that I was promising, but it's for a good cause :)

Read more: diogomelo.net

Posted via email from .NET Info

Deploying Microsoft RemoteFX for Virtual Desktop Pools Step-by-Step Guide

|
This step-by-step guide walks you through the process of setting up a working virtual desktop pool that uses RemoteFX in a test environment. Upon completion of this step-by-step guide, you will have a virtual desktop pool with RemoteFX that users can connect to by using RD Web Access.

Read more: MS Download

Posted via email from .NET Info

BUG: .NET 4.0 (System.Net.Mail) Unable to send emails with large attachments (more than 3MB)

|
This is probably the first bug reported by customer so far for System.Net.Mail Class in .NET 4.0 Framework, or at least the first one I worked on. This was pretty straight forward repro and I did not had to do much to reproduce the issue locally.

static void Main(string[] args)

       {

           SmtpClient client = new SmtpClient("contoso_smtp_server");
           client.Credentials = new System.Net.NetworkCredential("User1", "Password", "contoso");


           MailMessage msg = new MailMessage("user1@contoso.com", "user2@contoso.com", "Large Attachment Mail", "Large Attachment - Test Body");

           Attachment attachment = new Attachment(@"d:\3mb.dat");
           msg.Attachments.Add(attachment);

           client.Send(msg);

     
       }
That was the simplest code you could possibly write to send out email using SNM but the problem is it Fail with an “Error in sending email” message. So I looked around what was happening and found that the problem was not directly related to SNM but its underlying classes and specifically the Base64Encoding class which was used as default method of encoding emails attachments while sending.

That saved me more troubleshooting and I changed the way the attachments were being encoded from Base64 to 7Bit and it worked like charm.

So all you need to do is add any of the following line to your code to make it work.

// Any "one" of those two code section will work
attachment.TransferEncoding = System.Net.Mime.TransferEncoding.QuotedPrintable;
attachment.TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;

Read more: Jive into Messaging world

Posted via email from .NET Info

Back in business

|
I've been off for some time but now I'm back in business. A lot of material will be uploaded in this and next week.

Posted via email from .NET Info