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

JSIL

| Thursday, August 4, 2011
jsil_48px.png

JSIL is a compiler that transforms .NET applications and libraries from their native executable format - CIL bytecode - into standards-compliant, cross-browser JavaScript. You can take this JavaScript and run it in a web browser or any other modern JavaScript runtime. Unlike other cross-compiler tools targeting JavaScript, JSIL produces readable, easy-to-debug JavaScript that resembles the code a developer might write by hand, while still maintaining the behavior and structure of the original .NET code.


Read more: JSIL
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://jsil.org/

Posted via email from Jasper-net

MSDN Magazine August 2011

|
Team Foundation Server and Exchange: Build a Ticketing System Using Exchange and Team Foundation Server
What do you get if you combine the Team Foundation Server work item tracking functionality with the Exchange Web Services push notification? A unified support ticketing system that integrates e-mail and work items. Mohammad Jalloul shows you how to build it.
Mohammad Jalloul
Visual Studio LightSwitch: Advanced Programming Made Easy With Lightswitch

Visual Studio LightSwitch: Advanced Programming Made Easy With Visual Studio Lightswitch
Visual Studio LightSwitch dramatically simplifies the development of data-centric business applications because it takes care of all the plumbing for you, as Beth Massi illustrates with a sample application.
Beth Massi
HTML5: Building Apps with HTML5: What You Need to Know

HTML5: Building Apps with HTML5: What You Need to Know
In this article — the first of a series that aims to show you how you can use HTML5 to build apps for the Web — Brandon Satrom introduces HTML5, describes Microsoft's approach to the new standard and helps you think about how to adopt HTML5 technologies.
Brandon Satrom


Read more: MSDN Magazine August 2011
QR: hh339634.aspx

Posted via email from Jasper-net

What is Visual Tree and Logical Tree in WPF?

|
WPF1_thumb.jpg

Every programming style contains some sort of LogicalTree which comprises the Overall Program. The LogicalTree comprises the elements as they are listed in XAML. Thus they will only include the controls that you have declared in you XAML.

VisualTree on the other hand, comprises the parts that make up the individual controls. You do not generally need to deal with VisualTree directly, but you should know how each control is comprised of, so it would be easier to build custom templates using this.

Read more: Daily .Net Tips
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://dailydotnettips.com/2011/08/03/what-is-visual-tree-and-logical-tree-in-wpf/

Posted via email from Jasper-net

Adding a system-wide keyboard hook to your WPF Application

|
A global keyboard hook is, as the name suggests, a means for your application to intercept (or ‘hook’) all keyboard events, not just those that occur when your application has focus. Recently I needed just such a keyboard hook for a WPF application, and wanted to be able to set focus back to my application when a particular keyboard combination was pressed. Using the C# keyboard hooking code of Stephen Toub as a starting point I created the desired system keyboard hook for WPF.

I’ve added the code to my learnwpf.com samples project on bitbucket. The key moving parts are:

keyboardhook.cs – This contains the Win32 API calls for hooking keyboard input, as well as a static method for bringing focus back to a window of your choice when the keyboard hook is triggered (which is surprisingly hard in more modern versions of windows where some measures have been taken to stop apps stealing focus from others.) This code also uses the Keyboard.Modifiers to check to see if the CTRL key has been pressed. There were some posts on-line that suggested that this doesn’t work properly when your app doesn’t have focus (which would be a major problem for what we’re doing). Fortunately it seems that this problem has been solved in .NET 4.0.


Read more: LearnWP3
QR: Adding-a-system-wide-keyboard-hook-to-your-WPF-Application.aspx

Posted via email from Jasper-net

Using schema with NHibernate and SqlLite

|
Some time ago I blogged about a technique to use SqLite in Unit testing when you have nhibernate mapping that targets Sql Server tables in a schema different from dbo. The problem was: if you specify the schema name in the mapping of a class, then you are not able to execute the test in SqLite database.

Ex. if you have this mapping.

image_thumb.png

This is a mapping for a table called EngagementView in a schema called report and when u try to run some test on this entity with SqLite you got an error telling that there is no report database. The solution is to use the schema element of the mapping. The right schema should be

<class name="xxxxx" 
          schema="report" table="EngagementView" />

Read more: Alkampfer's Place
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.codewrecks.com/blog/index.php/2011/08/02/using-schema-with-nhibernate-and-sqllite/

Posted via email from Jasper-net

Major breakthrough claimed in wireless technology

|
Dropped calls, unsent texts, painfully slow Internet connections and overcrowded Wi-Fi hot spots have become a bane of modern life.

But veteran valley entrepreneur Steve Perlman may have a solution to those problems. Perlman and a team of engineers and scientists at Rearden, his business incubator in San Francisco, have come up with an innovative technique for transmitting and receiving radio signals that he says will result in fewer dropped calls and much faster wireless Internet connections.

The technology, some 10 years in the making and the subject of dozens of patents that Perlman says he has either applied for or received, is a breakthrough on par with the invention of the laser, said Richard Doherty, research director of the Envisioneering Group, a market research firm that focuses on wireless technologies.

"This is a whole new science of radio," said Doherty, who has been briefed on the technology. "It's a game changer. It's as clear as that. I don't know if I'll run into another one in my lifetime like this."

Perlman, 50, has a history of creating disruptive technologies. He helped develop the QuickTime video player while serving as chief scientist of Apple (AAPL); cofounded WebTV, an early effort to marry the television and the Web; and, more recently, cofounded OnLive,
an online gaming service that allows users to play console-quality video games without an expensive game machine.

But some critics are skeptical about his latest technology. Perlman has released few of the technical details, so it's hard to say how well the technology will work, said Philip Solis, a research director who focuses on mobile networks for ABI Research, a technology consultancy.

"It's something that's more theoretical than practical at this point," Solis said.


Read more: MercuryNews.com
QR: ci_18603178

Posted via email from Jasper-net

Best Silverlight 5 example project EVER

|
3d-cartoon-animal-wallpaper_1280x1024_698.jpg

I just reviewed this sample and it is really shows off Expression and Silverlight 5.  It is entirely possible that you could base an entire business off of this project by John Papa!  It shows how to implement the 3D features in Silverlight 5.  It provides a project that allows you to create a house along with a bill of material (think parts list).  If you have family that is in construction, this might be for you.

Check it out at: 3D Housebuilder demo

Read more: Secret Microsoft Communications
QR: best-silverlight-5-example-project-ever.aspx

Posted via email from Jasper-net

A shell extension is a guest in someone else's house; don't go changing the code page

|
A customer reported a problem with their shell extension:

    We want to format a floating point number according to the user's default locale. We do this by calling snprintf to convert the value from floating point to text with a period (U+002E) as the decimal separator, then using Get­Number­Format to apply the user's preferred grouping character, decimal separator, etc. We found, however, that if the user is running in (say) German, we find that sometimes (but not always) the snprintf function follows the German locale and uses a comma (U+002C) as the decimal separator with no thousands separator. This format prevents the Get­Number­Format function from working, since it requires the decimal separator to be U+002E. What is the recommended way of formatting a floating point number according to the user's locale?

The recommended way of formatting a floating point number according to the user's locale is indeed to use a function like snprintf to convert it to text with U+002E as the decimal separator (and other criteria), then use Get­Number­Format to apply the user's locale preferences.

The snprintf function follows the C/C++ runtime locale to determine how the floating point number should be converted, and the default C runtime locale is the so-called "C" locale which indeed uses U+002E as the decimal separator. Since you're getting U+002C as the decimal separator, somebody must have called set­locale to change the locale from "C" to a German locale, most likely by passing "" as the locale, which means "follow the locale of the environment."

    Our shell extension is running in Explorer. Under what conditions will Explorer call set­locale(LC_NUMERIC, "")? What should we do if the locale is not "C"?


Read more: The old new thing
QR: 10192225.aspx

Posted via email from Jasper-net

Bazaar in Visual Studio: External Tools

|
Bazaar.png

Introduction

Bazaar is a modern, distributed version control system. As of this writing, there are no Bazaar add-in packages that provide integration with Visual Studio. This article will show how to integrate Bazaar into the Visual Studio Integrated Development Environment (IDE) using Visual Studio's External Tools.
Background

TortoiseBzr (see image below) is a Graphical User Interface (GUI) that provides integration of Bazaar into the Windows Operating System's file manager, Explorer (not to be confused with Internet Explorer). The default Bazaar Windows Installation includes TortoiseBzr, Python, and Bazaar. This is the recommended installation. During the installation, you will be offered the options of which add-ins, languages and options you wish to install. You can skip languages you do not speak, but you should install everything else. If you do not install TortoiseBzr, this How-to will provide unsatisfying results. You can still configure external tools to use Bazaar, but all the output will go to the text-only based Output window of Visual Studio. When we configure the Status command, an example will be provided that demonstrates how this can be done for other commands, but with similar output results.

Read more: Codeproject
QR: Bazaar4VS.aspx

Posted via email from Jasper-net

SSH Tricks

|
SSH is a powerful tool that allow you to remotely operate another machine. Here you'll find some tips about SSH.
Basic Usage
The most typical usage of SSH is something like this:

ssh dmelo@merov
Where dmelo is the user name and merov [1] the name of the host being accessed. When run this command the ssh use TCP to start a communication on the port 22 of the host merov (it can also be an IP address) and tells that the users dmelo wants to start a secure remote shell. You'll be prompted about your password. The user name and the password must match with the /etc/passwd file, which is the default to make authentications.

Installing and configuring a SSH server
By default, ssh client is present on most part of the Linux distributions but the ssh server is not. To install the ssh server on Ubuntu you must install the package openssh-server.

sudo apt-get install openssh-server
No further configuration is necessary to get the ssh server working. After that command, the apt will install and run the server. But there is some security constraints that I will cover here. There is a lot of robots trying to hack machines over the internet. A good amount of them try it by ssh. This robots try to open a connection with the port 22 to verify if there is any ssh server running. When the robot find a machine with ssh, it start trying to login into that machine. There is three simple actions that can help you to prevent that kind of attacks.

    Disable ssh root access
    Change the ssh port
    Be sure that none of the users have weak password

When you try to login, using ssh, you have to provide a user and a password. A user that all linux machine have is the root. If the cracker get root access to some machine, nothing (almost nothing) can stop him. When a robot is going to search for ssh servers, it usually try only the port 22. If your ssh server is working on a different port, you'll avoid most part of them. Weak passwords is a big problem. Since the robot can try to connect a lot of times and one time or another it will find a user with a weak password. To disable root access you'll have to edit the file /etc/ssh/sshd_config, don't forget that you need superuser privileges for that sudo gedit /etc/ssh/sshd_config. On the line with PermitRootLogin yes, replace the 'yes' by 'no'. On the same file you can change the port. Look for the line Port 22 and replace the 22 by another number. Be sure the new port is not being used by another software and prefer to use ports above 1024, like 2222 for example. After that you have to restart the server.

sudo sh /etc/init.d/ssh restart


Running graphical softwares
     That's the basic stuff let's turn the things a little more interesting. Usually you can only use non graphical software. SSH has a way to export the X from the remote machine to yours. To do that you need to add the flag `-X`.

ssh -X dmelo@merov


Read more: diogomelo.net
QR: ssh-tricks

Posted via email from Jasper-net

Android Interview Questions and Answers

|
Here are some basic Android related interview questions and their respective answers.

What is Android?
Android is a stack of software for mobile devices which includes an Operating System, middleware and some key applications. The application executes within its own process and its own instance of Dalvik Virtual Machine. Many Virtual Machines run efficiently by a DVM device. DVM executes Java languages byte code which later transforms into .dex format files.


What is an Activity?
A single screen in an application, with supporting Java code.

What is an Intent?
A class (Intent) which describes what a caller desires to do. The caller will send this intent to Android's intent resolver, which finds the most suitable activity for the intent. E.g. opening a PDF document is an intent, and the Adobe Reader apps will be the perfect activity for that intent (class).

What is a Sticky Intent?
sendStickyBroadcast() performs a sendBroadcast(Intent) known as sticky, i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent). One example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. When you call registerReceiver() for that action -- even with a null BroadcastReceiver -- you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.

How the nine-patch Image different from a regular bitmap? Alternatively, what is the difference between nine-patch Image vs regular Bitmap Image?
It is one of a resizable bitmap resource which is being used as backgrounds or other images on the device. The NinePatch class allows drawing a bitmap in nine sections. The four corners are unscaled; the middle of the image is scaled in both axes, the four edges are scaled into one axis.

What is a resource?
A user defined JSON, XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.

How will you record a phone call in Android? or How to handle an Audio Stream for a call in Android?
Permission.PROCESS_OUTGOING_CALLS: Will Allow an application to monitor, modify, or abort outgoing calls. So using that permission we can monitor the Phone calls.

Does Android support the Bluetooth serial port profile?
Yes.

Can an application be started on powerup?
Yes. 


Read more: Java code geeks
QR: android-interview-questions-answers.html

Posted via email from Jasper-net

Analog of SVN branch switch for Git

|
Working with Git in SVN based organization is possible and make a lot of benefits. Sources checked out once are now at you local repository, so all you do is commits, rebases and dcommits back to SVN. But sometimes you need to be able to switch to another SVN branch. You need something equivalent to "SVN switch" command inside Git environment.

I’m been trying to switch to new branch, but I found no related information about that. I ended up this solution, I would like to share.

    Manually add new configuration into ~/.gitconfig, for new SVN location

        [svn-remote "svn25"]
            url = https://svn.server/branches/branch25
            fetch = :refs/remotes/git-svn-25

    Fetch changes from svn25

        git svn fetch svn25


Read more: .NET Zone
QR: analog-svn-branch-switch-git

Posted via email from Jasper-net

Debugging Your MonoTouch Apps: The Future

|
One of the "paper cuts" developers have been having with developing their MonoTouch 4.0.x (and earlier) applications is that for some networking setups, the IP of the developer's workstation detected by MonoDevelop and given to the iPhone or iPad device for debugging purposes is not correct. This often happens if the WiFi is a different network than the network that the developer's machine is connected to (although there are other scenarios as well).

Since it does not seem to be widely known about, allow me to point out that current versions of MonoTouch allow developers to modify the IP that the runtime should connect to for debugging via the iOS Settings app found on any iPhone or iPad (or Simulator). You can see a screenshot of this per-App Settings page in the screenshot to the left. Each of these fields are editable, allowing you to override the defaults filled-in by MonoDevelop.

Read more: A Moment of Zen
QR: debugging-your-monotouch-apps-future.html

Posted via email from Jasper-net

Web Fonts: Custom Fonts Using @font-face

|
Web based platform are increasing in popularity day by day and a huge portion of ‘netizens’ completely depend on internet for their various needs. No wonder then that most of that companies are going online and one of the most important requirements of such sites are the way they are ‘written’, i.e. the fonts they use. Different fonts provide different user interface(UI) or ‘emotions’ of their respective sites and the users browsing a site are often drawn to such sites by the type of font that the site is using. For e.g. a business site which is a formal site and is used by corporate often goes for a simple and soothing look and feel fonts like ‘Arial’ or ‘Verdana’ while a site dedicated to kids might use high fashioned and colorful fonts which would help to attract kids.

The one problem that the webpage’s had in the previous version of the CSS was that it could only ‘read’ and display fonts that were installed or present in the user’s local PC. But this had some serious disadvantages. Problems like ‘Would my site appear clean and formal to my clients (the users who browse my site) when some of their PC’s might not have the font ‘Arial’ installed (don’t worry, this is only an example as Arial is present in almost all the PC’s and laptops…)’ or ‘would my music site have the perfect rock star look and feel on it?’. Could there be a way where we could dynamically embed font’s that are not in the user.

Before ‘tested’ font embedding methodologies came onto existence, there were a couple of services which were used by the webmasters for recreating the ‘look and feel’ of embedded fonts. They are as mentioned below:

1. sIFR – Takes the help of Javascript and flash to provide the ‘embedding effects’ of different fonts.
2. Cufon – This converts the fonts in SVG format and then uses JavaScript to render the same to various webpages.

Read more: Design modo
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://designmodo.com/custom-web-fonts-fontface/

Posted via email from Jasper-net

Create GPS-enabling web applications

|
Web sites that provide services based on your geographic location are quite popular on the Internet. Sites such as Foursquare, Yelp, and Google Maps all make use of where you are to give you information relevant to you right in that location. You can easily get someone’s location and give them information based on that locale.

In this article, you will build both the back end and the front end of an application that uses GPS location to provide news content to the user. The back end is written in PHP and uses MySQL to hold a list of articles and their related location and its coordinates. The front-end web page uses the location services supported by webkit browsers to get the GPS coordinates of the user. It then sends those coordinates to the back end in an Ajax request. The PHP back-end system responds with an XML listing of articles, which the front end then renders dynamically.

You use locations in two different ways in this article. The first is when you add new articles to the database. You give the PHP back end a location (for example, Fremont, CA or Washington, DC), and the page uses a geolocation service provided by Yahoo! to turn that location into GPS coordinates. The second way you use location is when the web page makes a request to the browser to get the location of the user and then uses that information to query the database using Ajax.


Building the back end

The back end code starts at the database, which in this case is MySQL. Listing 1 shows a schema for the single table database.

Listing 1. db.sql

DROP TABLE IF EXISTS articles;
CREATE TABLE articles(
     lon FLOAT,
     lat FLOAT,
     address TEXT,
     title TEXT,
     url TEXT,
     summary TEXT );


The table has six columns, starting with the latitude and longitude values and the original address provided for the article (for example, Fremont, CA). There is then some biographic information about the article including the title, URL, and summary.

To build the database, first use mysqladmin to create it and then use the mysql command to run the db.sql script:

% mysqladmin --user=root --password=foo create articles
% mysql --user=root --password=foo articles < db.sql


With the database created, you can build the PHP page that you will use to add records to the database. Listing 2 shows the code for the insert.php page. (Note: The value for $url on lines 5 and 6 should appear as a single character string. It appears as two shorter strings for formatting purposes only.)

Listing 2. insert.php

<?php
$dd = new PDO('mysql:host=localhost;dbname=articles', 'root', '');
if ( isset( $_POST['url'] ) ) {
// You need a Yahoo! PlaceFinder application key
// Go to: http://developer.yahoo.com/geo/placefinder/
  $url = "http://where.yahooapis.com/geocode?q=".urlencode($_POST['address']).
         "&appid=[yourappid] ";

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  $body = curl_exec($ch);

  preg_match( "/\<latitude\>(.*?)\<\/latitude\>/", $body, $lat );
  preg_match( "/\<longitude\>(.*?)\<\/longitude\>/", $body, $lon );

  $sql = 'INSERT INTO articles VALUES ( ?, ?, ?, ?, ?, ? )';
  $sth = $dd->prepare($sql);
  $sth->execute( array(
    $lon[1],
    $lat[1],
    $_POST['address'],
    $_POST['title'],
    $_POST['url'],
    $_POST['summary']
    ) );
}
?>
<html>
<body>
<form method="post">

Read more: developerWorks
QR: index.html

Posted via email from Jasper-net

MonoMac add-in for MonoDevelop

|
After a small hiatus we are back.

If you have been using MonoMac to build MacOS applications, we have just released an update to the MonoDevelop.MonoMac add-in that should fix the problem with packaging your applications on Lion.

This update just contains a critical fix and delivers the add-in to all three MonoDevelop platforms in use today: our stable MonoDevelop 2.4, the 2.6beta3 and for the fearless among you MonoDevelop/master.

This was just the first step in maintaining the add-in. I had to sort out the build setup for all three branches and the pipeline to deliver the updates. Now that I got things in place, I will be able to fix some of the other problems that have been reported.


Read more: Miguel's OSX and iOS blog
QR: Aug-03.html

Posted via email from Jasper-net

Difference between On clause and Where clause when used with left join in SQL Server

|
Introduction

The purpose of this article is to show the difference between the On clause and Where clause when using with left join in SQL Server.

Background

I have been working on SQL Server databases for more than 5 years and I was not aware of the difference between the On clause and Where clause when used with left join. Once I asked this question to our DBA and he said that there is some difference but he was not be able to explain the difference. Then I started exploring this topic myself and got some interesting observations of these two clauses when used with left join. So today I decided to share my knowledge so that everyone could benefit from my work.
Using the code

Today I will explain the difference between the On clause and Where clause when used with left join in SQL Server. When the On clause is used in an outer join, the outer table will have no effect on this On clause and all rows from the outer table will be returned and the On clause determines which rows of the subordinate table joins to the outer table. Rows of the outer table that do not meet the condition specified in the On clause in the join are extended with null values for subordinate columns (columns of the subordinate table), whereas the Where clause filters the rows that actually were returned to the final output. It's difficult to understand this from the above definition, so let's try to understand this difference with an example. Suppose we have two tables Departments (deptId, deptName) and Employees (empID, DeptID, EmpName, Salary) and deptiD is the foreign key of the department table. An employee can have only one department where as a department can have many employees.


Read more: C# Corner
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.c-sharpcorner.com/UploadFile/hmshms/8617/

Posted via email from Jasper-net

Application Pools on IIS 6.0

|
Introduction

This article describes the concept of application pools and web garden that has been introduced in IIS 6.0 and tuning IIS 6.0 for better performance. I have tried to keep it simple and short, at the same time informative.
Fundamentals
What is an Application Pool?

IIS can isolate an individual Web application or multiple sites into a self-contained process (called an application pool) that communicates directly with the Operating System kernel.
What is a Web Garden?

IIS 6.0 worker process isolation modes also enable multiple worker processes to be configured to service requests for a given application pool. This configuration is known as a Web garden.
IIS 6.0 Architecture

The figure below describes the IIS 6.0 architecture in its simplest form. Unlike previous versions of IIS, there are multiple processes (application pools) that run independent of each other. The biggest advantage of this (isolation of processes) is, in a shared hosting environment, when one of the web sites goes down because of a heavy load, that doesn't effect the other websites that are running under a different application pool.


Read more: Codeproject
QR: Application_Pools_on_IIS_.aspx

Posted via email from Jasper-net

How To Create 32-bit Import Libraries Without .OBJs or Source

| Wednesday, August 3, 2011
This article explains how to create an import library given a .DLL for which you have no source code or object modules. There is no 32-bit utility that can create an import library from a .DLL, as there was with 16-bit versions of Visual C++.

NOTE: This method may not work with DLLs generated with non-Microsoft development tools.

Normally, when building a .DLL or any target that exports functions or data items, an import library (and exports file) is generated as part of the linking process. But in the case of a third-party .DLL that does not ship with an import library, you may need to generate an import library in order to use the .DLL successfully using load-time dynamic linking. An import library is not needed for run-time dynamic linking.

There are two ways to create an import library given a .DLL:

    Create a .DEF file for use with the LIB /DEF: command.
    Stub out functions, and use the .OBJ files created to mimic the import/export relationships. Then use the LIB /DEF: command to create the import library.


Read more: MS Support
QR: 131313

Posted via email from Jasper-net

C++ Going Native - a new monthly show

|
If you need proof that Microsoft has a new passion for C++ you just need to see the first episode of "Going Native", a new Channel 9 monthly video show.

Microsoft marketing department clearly has a new buzz word!

The blurb says:

dedicated to native development and native developers

Well to me "native development" means "assembler" but OK I have to be re-educated by Microsoft.

It now seems that "native" means C++and "non-native" means managed code. Applying "native" to C++ seems a little strange as there is nothing native about C++ on any machine architecture that I know of - i.e. it still needs a compiler to convert it into the truly native language that actually runs on the hardware.  It might even seem more reasonable to use "native" to apply to say C or anything so primitive that it doesn't support objects.

The presenters start out stating that we shouldn't swallow the image that "native" developers have grey hair and are basically dinosaurs from a bygone age. We are told that the average C++ developer, sorry native developer, is really quite with it and on the cutting edge.

Most of us would probably feel that Microsoft might have sidelined C++ developers in the past, but the majority of us have been getting on with using and supporting the language for some time. To have Microsoft now lecture us on how we really are, and always were, trendy is something of an insult in itself!


Read more: I Programmer
QR: 2805-c-going-native-a-new-monthly-show.html

Posted via email from Jasper-net

Microsoft goes after Google with humor (that actually worked)

|
When it comes to funny competitive attack commercials, many have tried and failed to capture the magic of “I’m a Mac”. Microsoft was finally able to put out a cute (not hilarious, but point made) video taking a jab at Google services that will be competing against Microsoft Office 365.

Introducing Gmail Man. The video does make some good points that many people know but that most try to ignore. Google has and probably always will algorithmically comb our emails in an effort to serve more relevant ads on their email service. It’s a controversial practice that Google has been able to sidestep for years. Microsoft is calling them on it nicely.

According to Amy Vernon at Network World, “The entire point of this video isn’t so much out of concern for the public as it is to pimp out its new Office 365 suite, meant to compete directly with Google Apps.”

It’s a valiant effort. Will they truly be able to cast doubt on Google’s more dubious practices?

Read more: Techi
Read more: Youtube
QR: watch?v=OrkAuwaoFGg

Posted via email from Jasper-net

מנגנון ה-SFC מבקש להכניס תקליטור של Windows XP Professional, ולי יש בכלל Windows XP Home Edition. מה לעשות?

|
שלום לכולם,

כאן דן ויזנפלד מצוות התמיכה של Microsoft.

יגאל א., אחד מלקוחותינו, ביקש לדעת כיצד ניתן להתמודד עם הבעיה בה הוא נתקל:

בעת הפעלת מנגנון הסריקה SFC (ותוכלו לקרוא עליו בהרחבה בפוסט הבא) מבקש להכניס תקליטור התקנה של Windows XP Professional, בעוד שליגאל מותקנת במחשב מערכת ההפעלה Windows XP Home Edition.

תקלה זו נובעת מקבצי מערכת שאינם רשומים במערכת בצורה תקינה. בפוסט הבא אבקש להסביר לכם כיצד ניתן לתקן בעיה זו.

הפעולות המתבקשות:

1. לחצו על Start (התחל) ולאחר מכן על My Computer (המחשב שלי).

מנגנון ה-SFC מבקש להכניס תקליטור של Windows XP Professional, ולי יש בכלל Windows XP Home Edition. מה לעשות?

--1_thumb_24986C8C.png

. לחצו על Tools (כלים) ועל Folder Options (אפשרויות תיקיה).

...
...

--8_thumb_5F0B4462.png

Read more: MS Support blog
QR: _DE05E005D205E005D505DF05_-SFC-_DC05D005_-_E205D505D105D305_.aspx

Posted via email from Jasper-net

Dealing with HWND in WPF

|
Tweet

If you are trying to run a WPF application, you must remember that WPF content is actually constraint to a single HWND. You could have only a single window handle that represents the entire window, and everything inside it is a bitmap drawn on the WPF canvas. Except Popup (which eventually have its own HWND) no WPF element has its own HWND associated with it.

As a matter of fact, a normal win32 application has several HWND’s, I mean every control has its own HWND and the pixels associated with that HWND isn’t been shared between other elements. But while rendering WPF content, a single Pixel can be shared by multiple UIElement, it cannot have Win32 model applied to it. But as it runs as Win32 application, it needed to have a Window handle associated with it which represents the outer window.
To retrieve the Window handle you can call :

HwndSource source = (HwndSource)HwndSource.FromVisual(this);
IntPtr hWnd = source.Handle;

The above code will retrieve the Window handle associated with your WPF application.
One of the major cases where HWND is really required is with Modal window. In WPF, you might know that you can use the following code to create a modal window :

Window w = new Window();
w.ShowDialog();

Read more: Daily .Net Tips
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://dailydotnettips.com/2011/08/02/dealing-with-hwnd-in-wpf/

Posted via email from Jasper-net

7 Chrome Tips Developers & Designers May Not Know

|
I'm not sure about you, but Google Chrome has been my primary browser for quite some time. At first the simplicity and speed of Chrome initially drew me in. I do admit I went back to Firefox every so often for Firebug's rich set of debugging tools.

However,  over the past year or so the amount of tooling for developers and designers in Chrome has grown immensely.

Here are some fairly recent features of Google Chrome that you may not be aware of...

1. The ability to modify the source JavaScript and execute it

How many times have you been tinkering around JavaScript and wished you could tweak it out temporarily just to test something out? Well, if you are using IE or Firefox then you are out of luck, however in Chrome you can just double-click inside a JavaScript file, make changes, and then proceed to run the web application like normal ( see line 33 ).

15602761547_CL8TT.jpg

Read more: Web Dev .Net
QR: 7-chrome-tips-developers-designers-may.html

Posted via email from Jasper-net

WCF Extensibility – System.Diagnostic Tracing

|
This post is part of a series about WCF extensibility points. For a list of all previous posts and planned future ones, go to the index page.

This post takes again a detour from the normal flow of the series, as the extension I’ll be covering today isn’t a WCF extensibility per se, but it can be used to solve some real issues and since I’ve seen a post last week with an issue which can be solved exactly by the example in this topic, I decided to jump into tracing before going back to “normal” WCF extensibility.

Tracing is a very powerful tool in WCF. I think I've answered tens of questions in the MSDN forums with "enable tracing and find out the exception which caused the problem" and in most of the cases just that was enough for the the user to find out the issue – you look at the trace file generated by the diagnostic subsystem using the Service Trace Viewer Tool, look for the “line in red” (how the tool marks exceptions which were thrown or handled by the WCF runtime), and in most cases there will be the exception there explaining the problem. This is often seen in questions such “my client got a 400 response” or “the server forcefully closed the connection”. Notice that the tracing subsystem is a lot more powerful then just tracing exceptions (correlating a message between the client and the server, message time charts, etc.), but I’ll focus on the error aspect in this post.

This series is about places where one can hook up code to be executed in the WCF pipeline, but almost all of the examples of tracing I’ve seen simply add some information in the application configuration file which saves the traces in the file system for later analysis. But it doesn’t have to be this way. The tracing subsystem can also be extended, and it has been in the past for scenarios such as where one cannot access the trace file on a machine (i.e., in shared hosting environments) or to capture errors which the “normal” means (such as IErrorHandler) cannot detect.

The tracing subsystem is based on some sources which send data to a list of listeners. Many features in the .NET Framework act as event sources: System.Net and System.Net.Sockets (for networking traces), System.Runtime.Serialization (for traces in the WCF serialization subsystem), System.ServiceModel (the “main” WCF traces) and so on. All sources fire events to the subsystem under certain circumstances (e.g., when a message arrives to a WCF encoder, when some bytes are sent over a socket, when a new dynamic class is generated for serialization, etc.). The “Configuring Tracing” page on MSDN is the main source of information about tracing in WCF, and it describes the tracing sources in the platform. There’s one more missing from the list in that page, which is the System.Runtime.Serialization.CodeGeneration, which logs the IL generated (and executed) by the serialization subsystem for dynamic classes generated by WCF (to improve the performance of serialization / deserialization of objects). This is hardly ever used, though.

The listeners are simply subclasses of the abstract TraceListener class. As I mentioned, while most examples use one of the .NET classes (such as TextWriterTraceListener or XmlWriterTraceListener), one can provide its own implementation of the TraceListener and handle the messages from there.

    public abstract class TraceListener
    {
        public abstract void Write(string message);
        public abstract void WriteLine(string message);
    }

Read more: Carlos' blog
QR: wcf-extensibility-system-diagnostic-tracing.aspx

Posted via email from Jasper-net

Hosting a WPF control inside a Windows Form

|
Hosting a WPF content inside a Windows Forms application is very easy. You need to use ElementHost control which takes a FrameworkElement in its Child property. So if you specify a UserControl for Child of an ElementHost, the WPF content will be loaded to the Forms application .

Lets take a look into this in steps :

Step 1 :

Create a Windows Forms application and add a WPF UserControl Library to the project. ( If you are unaware of User Controls, please feel free to check these posts on UserControl and CustomControl, or you can read my WPF Tutorial from here. )

Step 2 :

Add a UserControl to the project and create something. In this sample application, I have just created a ColorAnimation that will be started when a Button is Clicked. Lets look how the code looks like :

<UserControl x:Class="SimpleWpfUserControlLibrary.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <Storyboard x:Key="cAnimBorder" Storyboard.TargetProperty="Background.Color" Storyboard.TargetName="brd">
            <ColorAnimation AutoReverse="True" From="Red" To="Green" RepeatBehavior="Forever">
            </ColorAnimation>
        </Storyboard>

    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <ToggleButton x:Name="btn" Content="Start" Click="Button_Click"/>
        <Border x:Name="brd" Grid.Row="1" CornerRadius="25" Margin="10" Background="Black">
        </Border>
    </Grid>
</UserControl>

Step 3:

Lets put the code for the Button Click eventhandler which will start the Animation on Button Click.

public bool IsAnimationStarted { get; set; }
private void Button_Click(object sender, RoutedEventArgs e)
{
    Storyboard sBoard = (Storyboard)FindResource("cAnimBorder");
    btn.Content = "Start";
    sBoard.Stop();


Read more: Daily .Net Tips
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://dailydotnettips.com/2011/08/01/hosting-a-wpf-control-inside-a-windows-form/

Posted via email from Jasper-net

Firefox maker moves towards a browser-free world

|
Open...and Shut Something interesting is brewing at Mozilla, and it appears to have very little to do with browsers.

For years, Mozilla's brand has been closely aligned with its open source browser, Firefox, despite the non-profit's efforts to branch out into mail suites (Thunderbird), social networking (Raindrop), and more.

Now, Mozilla is moving beyond the browser, just when the web seems to be outgrowing the browser.

The browser is dead. Long live the web?

Not exactly. No one at Mozilla is offering eulogies for the browser just yet, but the language at Mozilla does seem to be changing. At least, a little.

Mozilla, while always centered more on freedom of the internet than any particular software program used to access it, used to identify itself much more with the browser. For example, in February 2004 Mozilla touted its mission as "maintain[ing] choice and innovation on the Internet by developing the acclaimed, open source, Mozilla 1.6 web and email suite and related products and technology."

These days, Mitchell Baker, Mozilla Foundation chair, states that "Mozilla’s mission is to build user sovereignty into the fabric of the Internet." It's no longer about browsers, in other words, but rather something much more fundamental.

Read more: The Register
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.theregister.co.uk/2011/07/29/mozilla_moving_beyond_the_browser/

Posted via email from Jasper-net

Using 'this' Keyword When Defining a Constructor in C#

|
When defining a constructor we can use the 'this' keyword in order to instruct on calling another constructor from the very same class. The following video clip (hebrew) shows how to do it.

Read more: Life Michael
QR: using-this-keyword-when-defining-a-constructor-in-c.aspx

Posted via email from Jasper-net

Making awesome Wedding documents using OpenType Ligatures and Stylistic Sets in Microsoft Word 2010 and Gabriola

|
ligaturesmall.gif

My brother-in-law is getting married in a few weeks and  since I'm the default IT guy for the family, I'm making CDs with CD-TEXT for the guests amongst other things. Apparently one of those other things is doing the Agenda for the day as well as the Menus that appear on the guests' tables. Anyone can bang out a simple document in word and/or pick a wacky font, but I wanted to try something a little different.

Microsoft Word 2010 includes advanced support for OpenType Fonts, not just TrueType fonts. One of the cool things in OpenType and Word is the support for ligatures. From Wikipedia:

    "In writing and typography, a ligature occurs where two or more graphemes are joined as a single glyph."


Read more: Scott Hanselman Computer Zen
QR: MakingAwesomeWeddingDocumentsUsingOpenTypeLigaturesAndStylisticSetsInMicrosoftWord2010AndGabriola.asp

Posted via email from Jasper-net

HTML5 Periodic Table of Elements (as in HTML5 Tags… )

|
image5.png?imgmax=800

The table below shows all valid elements in the current HTML5 specification. They are grouped and coloured based on their "Content Model" i.e. what type of element it may contain. Items shown with red text have complex requirements but are shown alongside elements with similar content models. Unlike the Mendelevian Periodic Table that is used in Chemistry, there is no fundamental ordering to the elements within a group, and no significance to the presence of a few empty spaces.

Read more: Greg's Cool [Insert Clever Name] of the Day
Read more: Periodic Table of HTML5 Elements
QR: html5-periodic-table-of-elements-as-in.html

Posted via email from Jasper-net

COM Port Communication Library

|
Project Description
This library provide features to send/receive data via virtual COM Port asnync/sync.

Read more: Codeplex
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=https://comportcl.codeplex.com/

Posted via email from Jasper-net

משתמשי Visual studio ככה תדעו כמה זמן המחשב דלוק.

|
image_thumb_5BD8322E.png

היי,

היום אראה שיטה דיי נחמדה איך לדעת כמה זמן המחשב דלוק.

השיטה הולכת ככה:

כאשר אתה מדליק את המחשב , הקובץ הראשון שעולה הוא Explorer.exe / סייר Windows.

ומתי שהוא עולה הוא לא עולה לבד , בדרך כלל הוא מעלה איתו בקירוב 33 Threads .

מה שאומר שניתן לזהות את משך זמן הריצה של threads של Explorer דרך פונקצית Win32api בשם GetThreadsTimes .

בגלל שאני עצלן , אנו לאורך מאמר זה נשתמש בכלי Spy++ שבא ביחד עם Visual Studio .

דבר ראשון נפתח את spy++ .


Read more: BnayaA
QR: visual-studio.aspx

Posted via email from Jasper-net

Redirect Mobile Devices Using Htaccess

| Tuesday, August 2, 2011
When working with clients you always get some odd requests, well I recently was requested to redirect a particular url on a site to a third party url when someone visits from a mobile device. Now, in theory this doesn't sound all that difficult and really there isn't much code either. The problem is getting the exact htaccess code you need, which can be a pain especially with trying to debug mod_rewrite and Apache.

I figured I would help everyone out and plop down some code here for everyone. So, in all it's glory I give you some rules for mod_rewrite to redirect a url on a mobile device to another url.

########## Begin - Redirect Mobile Browser Accessing /siteurltoredirect
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^siteurltoredirect$ http://theendpointurl.com [R,L]
########## End - Redirect Mobile Browser Accessing /siteurltoredirect

Read more: Switch on code
QR:redirect-mobile-devices-using-htaccess

Posted via email from Jasper-net

Can we get a little Unity?

|
In this post I would like to do a simple introduction to Unity Application Block. Unity is a framework that supports dependency injection (DI) in constructors, properties, and method calls. Unity also supports intercepting method calls which I may cover in a later post.

The documentation for Unity is pretty detailed, so it is probably a good place to start for background information. I’ve also included a link to the download area in the references section at the bottom of the post.

What is Unity and why would you use it?

When you start a project, the code base is usually small so it is not difficult to maintain or test. As the project gets larger, it is often the case that it gets broken down into components, and each component is created separately, and then integrated into the rest of the project.

In the beginning, the components are self contained and testable on their own if the person doing the work was paying attention to object oriented design principles. Even if the component was carefully constructed, at some point during integration it is usually the case that component boundaries begin to break down and components start having strong dependencies on each other.

Part of the break down of component boundaries happens because components start to inherit responsibility for configuring the dependencies with other components. Once a component has built in knowledge on how to create and configure another component, it becomes difficult to separate the components and test them independently.

This is where Unity comes in. Not only does Unity take the responsibility for creating and configuring components, it does so in a consistent way. Components don’t have to know where their dependent components come from. In addition, Unity can automatically create the dependent components if, necessary, or use existing instances.

Read more: Greg's Cool [Insert Clever Name] of the Day
QR: can-we-get-little-unity.html

Posted via email from Jasper-net

Appropriate Uses For SQLite

|
SQLite is different from most other SQL database engines in that its primary design goal is to be simple:

    Simple to administer
    Simple to operate
    Simple to embed in a larger program
    Simple to maintain and customize

Many people like SQLite because it is small and fast. But those qualities are just happy accidents. Users also find that SQLite is very reliable. Reliability is a consequence of simplicity. With less complication, there is less to go wrong. So, yes, SQLite is small, fast, and reliable, but first and foremost, SQLite strives to be simple.

Simplicity in a database engine can be either a strength or a weakness, depending on what you are trying to do. In order to achieve simplicity, SQLite has had to sacrifice other characteristics that some people find useful, such as high concurrency, fine-grained access control, a rich set of built-in functions, stored procedures, esoteric SQL language features, XML and/or Java extensions, tera- or peta-byte scalability, and so forth. If you need some of these features and do not mind the added complexity that they bring, then SQLite is probably not the database for you. SQLite is not intended to be an enterprise database engine. It is not designed to compete with Oracle or PostgreSQL.

The basic rule of thumb for when it is appropriate to use SQLite is this: Use SQLite in situations where simplicity of administration, implementation, and maintenance are more important than the countless complex features that enterprise database engines provide. As it turns out, situations where simplicity is the better choice are more common than many people realize.

Another way to look at SQLite is this: SQLite is not designed to replace Oracle. It is designed to replace fopen().
Situations Where SQLite Works Well

    Application File Format

    SQLite has been used with great success as the on-disk file format for desktop applications such as financial analysis tools, CAD packages, record keeping programs, and so forth. The traditional File/Open operation does an sqlite3_open() and executes a BEGIN TRANSACTION to get exclusive access to the content. File/Save does a COMMIT followed by another BEGIN TRANSACTION. The use of transactions guarantees that updates to the application file are atomic, durable, isolated, and consistent.


Read more: SQLite
QR: whentouse.html

Posted via email from Jasper-net

ASP.NET Internals : “Clearing ASP.NET Session Variables” a in-depth look

|
ASP.NET Session is one of most common state management technique for any ASP.NET Web Application.  If you want to do a quick refresh or want to know some thing more, please go ahead and read one of my article “Exploring Session in ASP.NET” published at Code Project.  ASP.NET provides several methods for removing Session. But which methods needs to use at what time, is a must known stuff for asp.net developer. In this post I going to talk about bit internals of removing session variables from applications. Why this Post ?  I found many people having some confusion around removing / clearing the  session variable ( Mainly with Session.Clear(), Session.RemoveAll(), Session.Abandon()) , which method needs to use, what is the purpose of particular method etc.

ASP.NET Provides below methods to clearing or removing Session information.

    Session.Clear()
    Session.RemoveAll()
    Session.Abandon()
    Session.RemoveAt(index)
    Session.Remove(string);

We will be mainly focusing the first 3 methods.

Let’s start with Session.Clear() and Session.RemoveAll(). Well, you may ask, why I am starting with two methods together. Yes, we are in same track. Both Session.Clear() and Session.RemoveAll() does the same job. Let’s explore it

Session.Clear () Vs. Session.RemoveAll()

Let’s assume  stored below information with in session variable.

image.png?w=375&h=115
now, if you want to remove all the items from session you can use either Session.RemoveAll() or Session.Clear().   if you check the definition  from meta data file you will get below details, where description says the same.


Read more: Beyond Relational
QR: asp-net-internals-clearing-asp-net-session-variables-a-in-depth-look.aspx

Posted via email from Jasper-net

Top 20 Highly Useful Google APIs For Developers And Designers

|
google-api.jpg

Today we are going to introduced APIs of Google. API( Application Programming Interface) is a set of rules that used for accessing an application or services or communicate with operating system or other programs such as Database management system(DBMS) and communicate protocol.  Google offers number of API, provides a big collection of Web APIs for web developers and web designers. Google provides popular consumer products APIs like Google Map, Google Earth, AdSense, Adwords, Google Apps and YouTube.

1) Lattitude API
2) Earth API
3) Google Map API


Read more: ZoomZum
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://zoomzum.com/top-20-highly-useful-google-apis-for-developers-and-designers/

Posted via email from Jasper-net