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

WPF's Most Important Property - UseLayoutRounding

| Tuesday, July 26, 2011
Ever since the introduction of WPF, applications developed using the technology have all had a similar look - fuzzy. In .NET 4, the developers at Microsoft made great strides in the clarity and readability of WPF applications.

Up until .NET 4, developers have used many tricks to get icons and line edges clearer than they are by default. Whereas some tricks may still be needed, one new property puts an end to much of the fuzziness frustration - UseLayoutRounding.

Below is an example of how UseLayoutRounding can help us. The left image is how WPF acts by default. The right is with UseLayoutRounding set to true.

example.png

The above examples are made using a very basic WPF application. The only difference between the applications is whether or not UseLayoutRounding is enabled.

<Window x:Class="UseLayoutRoundingTutorial.MainWindow"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       Title="MainWindow"
       Height="350"
       Width="525"
       UseLayoutRounding="True">
  <Grid>
    <Image Source="image.png" Width="100" Height="100" />
  </Grid>
</Window>

Read more: Switch on code
QR: wpfs-most-important-property-uselayoutrounding

Posted via email from Jasper-net

My Leading Candidate for Worst C# Feature – Method Hiding

|
I love C#, I really do. Of course is has its little annoying quirks here and there, but in general it is, IMHO, one of the best static programming languages out there. Having said that, one thing that makes me wonder “WHAT THE HELL WERE THEY THINKNING?!?$?!?” every single time is the feature known as “Method Hiding”.
What is Method Hiding?

Method hiding, in short, is the crippled, mentally-ill brother of method overriding. For example, look at the next code:

class A
{
  public string GetName()
  {
    return "A";
  }
}

class B : A
{
  public new string GetName()
  {
    return "B";
  }
}

Class A has a GetName method; class B inherits from class A and implements the GetName method as well.
Look carefully at the GetName method signature in class B – do you see the new keyword there? this means that the method doesn’t override the implementation in class A, it just hides it. What does that mean? read on.


So What’s the Big Deal? Hide, Override… Who Cares?


Read more: IronShay
QR: My_2D00_Leading_2D00_Candidate_2D00_for_2D00_Worst_2D00_C_2D00_Feature_2D00_e28093_2D00_Method_2D00_Hiding.aspx

Posted via email from Jasper-net

באיזה טכנולוגיות תומך ה–Coded UI Test?

|
השאלה הזאת עולה הרבה מאוד פעמים, באיזה טכנולוגיות תומך ה – Coded UI Test?

התשובה ניתנת בטבלה הבאה:


Support_table_1_thumb_4E9F53C9.png

Read more: Eran Ruso
QR: Coded-UI-Test-Technologies-Support.aspx

Posted via email from Jasper-net

“Version Control By Example” - Free ebook from Eric Sync (Think “226 pages focusing on DVCS, GIT, Mercurial, Veracity and SVN”)

|
1802_image0015.jpg?imgmax=800

About the book

This book uses practical examples to explain version control with both centralized and decentralized systems. Topics covered include:

    Basic version control commands and concepts
    Introduction to Distributed Version Control Systems (DVCS)
    Advanced branching workflows
    Strengths and weaknesses of DVCS vs. centralized tools
    Best practices
    How distributed version control works under the hood

Featuring these open source version control tools:

    Apache Subversion
    Mercurial
    Git
    Veracity


Read more: Greg's Cool [Insert Clever Name] of the Day
QR: version-control-by-example-free-ebook.html

Posted via email from Jasper-net

Synchronizing Threads in Multithreaded application in .Net - C#

|
The Problem "Concurrency"

When you build multithreaded application, your program needs to ensure that shared data should be protected from against the possibility of multiple threads engagement with its value. What's going to happen if multiple threads were accessing the data at the same point? CLR can suspend your any thread for a while who's going to update the value or is in the middle of updating the value and same time a thread comes to read that value which is not completely updated, that thread is reading an uncompleted/unstable data.

To illustrate the problem of concurrency let write some line of code

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("----Synchronnization of Threads-----");
        Console.WriteLine("Main Thread {0}", Thread.CurrentThread.ManagedThreadId);
        Printer p = new Printer();

        Thread[] threads = new Thread[5];

        //Queue 5 threads
        for (int i = 0; i < 5; i++)
        {
            threads[i] = new Thread(new ThreadStart(p.PrintNumbersNonSync));
        }
        foreach (Thread t in threads)
        {
            t.Start();
        }

        Console.ReadLine();
    }
}

class Printer
{
    public void PrintNumbersNonSync()
    {
        Console.WriteLine(" ");
        Console.WriteLine("Executing Thread {0}", Thread.CurrentThread.ManagedThreadId);
        for (int i = 1; i <= 10; i++)
        {
            Console.Write(i + " ");
        }
    }
}


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

Posted via email from Jasper-net

Speed up Visual Studio Builds

|
image_thumb_53D4E6F9.png

Recently I got involved in a big project where we had a single solution with approximately 100 projects.


Why 100 Projects in a Solution?

The reason for a 100 projects solution is that like in many modular systems these days, we have the following three tiers:

    A few core / common projects every project will use.
    A large amount of modules, independent of each other. This tier directly depends on tier 1.
    A few end-projects which loads the different modules. This tier indirectly depends on tier 2.

Read more: .NET Zone
QR: speed-visual-studio-builds

Posted via email from Jasper-net

20 Database Design Best Practices

|
  1. Use well defined and consistent names for tables and columns (i.e. School, StudentCourse, CourseID ...).
  2. Use singular for table names (i.e. use StudentCourse instead of StudentCourses). Table represents a collection of entities, there is no need for plural names.
  3. Don’t use spaces for table names. Otherwise you will have to use ‘{‘, ‘[‘, ‘“’ etc. characters to define tables (i.e. for accesing table Student Course you'll write “Student Course”. StudentCourse is much better).
  4. Don’t use unnecessary prefixes or suffixes for table names (i.e. use School instead of TblSchool, SchoolTable etc.).
  5. Keep passwords as encrypted for security. Decrypt them in application when required.
  6. Use integer id fields for all tables. If id is not required for the time being, it may be required in the future (for association tables, indexing ...).
  7. Choose columns with the integer data type (or its variants) for indexing. varchar column indexing will cause performance problems.
  8. Use bit fields for boolean values. Using integer or varchar is unnecessarily storage consuming. Also start those column names with “Is”.
  9. Provide authentication for database access. Don’t give admin role to each user.
  10. Avoid “select *” queries until it is really needed. Use "select [required_columns_list]" for better performance.
  11. Use an ORM (object relational mapping) framework (i.e. hibernate, iBatis ...) if application code is big enough. Performance issues of ORM frameworks can be handled by detailed configuration parameters.
  12. Partition big and unused/rarely used tables/table parts to different physical storages for better query performance.

Read more: CodeBalance
QR: 20-database-design-best-practices.html

Posted via email from Jasper-net

Free Security tools which you should have in your tool belt

|
    OWASP web site (https://www.owasp.org/index.php/Main_Page)

The Open Web Application Security Project (OWASP) is a 501c3 not-for-profit worldwide charitable organization focused on improving the security of application
software. In their web site, you almost could find every piece of information regarding security.

    Microsoft Security Development Lifecycle (http://www.microsoft.com/security/sdl/default.aspx)

A practical process we could follow to make our software more secure.

    Security Essentials (http://www.microsoft.com/en-us/security_essentials/default.aspx)

Microsoft Security Essentials provides real-time protection for your home or small business PC that guards against viruses, spyware, and other malicious software.

Microsoft Security Essentials is a free* download from Microsoft that is simple to install, easy to use, and is automatically updated to protect your PC with the
latest technology.


Read more: Tiki Wan
QR: free-security-tools-which-you-should-have-in-your-tool-belt.aspx

Posted via email from Jasper-net

There's a Tatt for That

| Monday, July 25, 2011
Researchers at Northeastern University have come up with a way to measure sodium and glucose levels in the blood that combines the iPhone with fluorescing nanoparticle tattoos.

According to a report this week in MIT's Technology Review, the technique involves "tattooing" the skin with a solution containing nanoparticles that fluoresce when exposed to certain molecules. The level of fluorescence indicates how much of a given molecule (glucose or sodium, for example) is present in the blood.

The iPhone, with some modifications, then measures the level of fluorescence. Those modifications include a filter for the iPhone's camera and a three-LED array, according to the report.

Measuring sodium levels could help athletes detect dehydration, while measuring glucose levels could provide diabetics with an alternative to finger pricking.


Read more: Campus technology
QR: theres-a-tatt-for-that.aspx

Posted via email from Jasper-net

CyberGhost VPN Allows Free, Anonymous Private Browsing [Privacy]

|
CyberGhost-VPN-Login.png

Using anonymous surfing by concealing your actual credentials is a much safer way to browse the Internet than to do otherwise. This is because harmful websites attempt to log IP addresses for malicious purposes. As certain spyware applications and harmful codes require personal IP addresses to initiate attacks. Similarly, hackers try to use IP information in order to obtain home addresses, credit card information, social security numbers and bank account credentials. Using an anonymous proxy tricks such malicious sources by providing them with alternative credentials, which protects your computer’s security from being compromised. Having a proxy also shelters from tracking agents that attempt to profile user activities.

CyberGhost is a VPN service which replaces the externally visible IP address (which users obtain from their ISP), with a CyberGhost VPN IP address. This procedure ensures that your connection is secure with CyberGhost 1024-bit SSL encryption. CyberGhost has both a free and pro version, the former is limited to 1GB bandwidth, whereas the latter has packages ranging from 4.17 Euro to 9.92 Euro. The pro version also enables choosing an IP from a selected location which can also help bypass restrictions imposed by location restricted websites like Hulu. The free version only gives you a German IP address.

Read more: Addictive tips
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.addictivetips.com/windows-tips/cyberghost-vpn-allows-free-anonymous-private-browsing-privacy/

Posted via email from Jasper-net

Google Music Manager dusts off tuxedo, makes Linux debut

|
tux-on-eighth-note.jpg

Odds seem pretty good that, if you're a Linux user who's been aching to give Google Music a spin, you haven't been sitting idly by, waiting to upload your content through official channels. If you have, in fact, been waiting Google's blessing, however, the time is now. The software giant has released the official Linux version of its Music Manager application for your cloud-listening pleasure. You'll still need an invite, of course, but once that's squared away, the sky (and upload cap) is the limit.

Read more: Engadget
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.engadget.com/2011/07/23/google-music-manager-dusts-off-tuxedo-makes-linux-debut/

Posted via email from Jasper-net

NoMoarPowah! – Alternate Charging Screen For Rooted Samsung Android Devices

|
NoMoarPowah-For-Android-Samsung-Devices1.jpg

It seems old Chainfire isn’t going to run out of original ideas any time soon. The veteran Android developer’s latest venture into the Android Market is as unique (both in name and functionality) as his other endeavors (such as Chainfire3D). The app is called NoMoarPowah! and its purpose is to replace the default charging screen of your Samsung device with a more practical one. That is, it replaces the graphic that appears while your phone is being charged while powered off with an interface that displays the current time and battery percentage, allows you to reboot your device with a single tap or set it to reboot once the battery is fully charged. And that’s not all. From within the app, you can customize the charging screen to wake your device at a time of your choice or, if the battery level is critically low, when said level reaches 15%. The app works only for selective Samsung Android Devices with root access.

Read more: Addictive tips
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.addictivetips.com/mobile/nomoarpowah-alternate-charging-screen-for-rooted-samsung-android-devices/

Posted via email from Jasper-net

OfflineIMAP

|
Welcome to the OfflineIMAP project

OfflineIMAP is a tool to simplify your e-mail reading. You can read the same mailbox from multiple computers. You get a current copy of your messages on each computer, and changes you make one place will be visible on all other systems. For instance, you can delete a message on your home computer, and it will appear deleted on your work computer as well. OfflineIMAP is also useful if you want to use a mail reader that does not have IMAP support, has poor IMAP support, or does not provide disconnected operation.

It is a Free Software project licensed under the GNU General Public License (v2+). You can download it for free, and you can modify it. In fact, you are encouraged to contribute changes back to us.

OfflineIMAP is FAST; it features a multi-threaded synchronization algorithm that can dramatically speed up performance in many situations by synchronizing several different things simultaneously. The defaults are very conservative, so you might want to check the configuration page to learn how to enable multithreaded syncing.

OfflineIMAP is FLEXIBLE; you can customize which folders are synced via regular expressions, lists, or Python expressions; a versatile and comprehensive configuration file is used to control behavior; two user interfaces are built-in; fine-tuning of synchronization performance is possible; internal or external automation is supported; SSL and PREAUTH tunnels are both supported; offline (or "unplugged") reading is supported; and esoteric IMAP features are supported to ensure compatibility with the widest variety of IMAP servers.

OfflineIMAP is SAFE; it absolutely attempts to never ever lose one of your mails under any circumstances. Of course, legally speaking, OfflineIMAP comes with no warranty, so I am not responsible if this turns out to be wrong.

OfflineIMAP was originally written by John Goerzen, who retired from maintaining it at then end of 2010. It is now maintained by Nicolas Sebrecht. We are grateful for the great job John did and for having shared his project with us.

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

Posted via email from Jasper-net

Google+ Account Suspensions Over ToS Drawing Fire

|
    Reports of Google+ deleting user accounts are all over, including Limor Fried — AKA Lady Ada / Adafruit Industries (recently featured in Wired Magazine) and former Google employee Kirrily 'Skud' Robert for violating Google's identity ToS. Other users are finding themselves locked out of their accounts without an explanation of how they violated the ToS. The worst part for these individuals is that a lock-out of Google+ includes being locked out of all Google services, including email, calendar, and documents.

Read more: Slashdot
QR: Google-Account-Suspensions-Over-ToS-Drawing-Fire

Posted via email from Jasper-net

גוגל מציגה: משחקים פלוס

|
כשגוגל השיקה את הרשת החברתית החדשה שלה, גוגל+, אחת השאלות הראשונות היו "האם גם היא תציע משחקים?". השבוע התגלתה עוד חתיכה מהפאזל, כשבדפי העזרה באתר גוגל הופיעה התייחסות ברורה למדור המשחקים החדש שלה.
Googville

מסתמן כי גוגל+ מתכננת להציב אתגר אמיתי לפייסבוק, על ידי השקת מדור משחקים משלה. מהלך זה היה צפוי, שכן פייסבוק היא המובילה כיום בתחום משחקי האונליין ונדמה כי זוהי אחת הסיבות בגללה משתמשים אינם ממהרים לנטוש אותה. אישור למדור המשחקים החדש, שיקרא Games Stream היה ניתן למצוא בדף העזרה של אתר גוגל+ עצמו, אך החברה כבר הספיקה לערוך את הטקסט ולמחוק את ההתייחסות למדור החדש.

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

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


Read more: newsGeek
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.newsgeek.co.il/google-games-stream/

Posted via email from Jasper-net

Android Password Data Stored In Plain Text

|
    The Hacker News is reporting that Android password data is being stored as plain text in its SQlite database. Hackers News says that 'The password for email accounts is stored into the SQLite DB which in turn stores it on the phone's file system in plain text. Encrypting or at least transforming the password would be desirable.' I'm sure most would agree encrypted password data in at least SHA or MD5 would be kind of a good idea!

Read more: Slashdot
QR: Android-Password-Data-Stored-In-Plain-Text

Posted via email from Jasper-net

CleanProject - Cleans Visual Studio Solutions For Uploading or Email

|
You know those little tools you build to help in your development?  The ones that you slapped together in a hurry and might not work all the time but you put up with them because you don’t want to take the time to fix them?  Well CleanProject.exe is one of those tools that I’ve had for a long while.  Years ago I think I shared an earlier version of it but when I mentioned this tool in an episode of AppFabric.tv I had some people ask if they could get the tool.  I didn’t want to share it because it was far too fragile.  It had numerous bugs and I didn’t want to take the time to fix it.  Then I found that I needed to use CleanProject in the build for Microsoft.Activities.UnitTesting and so I did some work that I can now share with you.


CmdLine

First I created a command line parser I call CmdLine.  I know the old joke is that everybody has to build a Command Line parser.  There are many of them out there but I didn’t have one that worked just the way I wanted so I created one.  You can use it by simply installing it with NuGet.  Now that I had a solid command line parser the rest was easy.
Clean Project

SNAGHTMLad8e3e

Clean Project is a utility that cleans Visual Studio project directories so you can quickly upload or email a zip file with your solution.

  •     CodePlex Download CleanProject v1.1.0
  •     Visual Studio Gallery CleanProject
  •     MSDN Code Samples (source download) CleanProject

Read more: Ron Jacobs
QR: clean-project-cleans-visual-studio-solutions-for-uploading-or-email.aspx

Posted via email from Jasper-net

U.S. Dept. of Defense offers up tiny, secure Linux distribution

|
LPS_02-580x435.jpg

With the number of websites being hacked at the moment, security has to be a growing concern at all major companies and organizations across the U.S. That includes departments of the government.

It’s not just the security of websites that has to be considered, though. We’ve also seen USB sticks and laptops full of information lost or stolen, and people’s online accounts being hacked with valuable information stolen.

The U.S. Department of Defense and the Air Force Research Laboratory have decided to respond and offer up a way to use a PC securely by developing a new lightweight and secure Linux distribution.

The distro is called Lightweight Portable Security (LPS) and has been created to allow any system, secure or not, to be used in a trusted way. LPS does this by running directly from a CD or USB stick, executing only within a machine’s RAM, while offering up Internet access, a web browser, file system, and a small range of applications to use.


Read more: geek.com
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.geek.com/articles/chips/u-s-dept-of-defense-offers-up-tiny-secure-linux-distribution-20110722/

Posted via email from Jasper-net

VMware ESX 4 can even virtualize itself

|
Running VMware ESX inside a virtual machine is a great way to experiment with different configurations and features without building out a whole lab full of hardware and storage. It is pretty common to do this on VMware Workstation nowadays — the first public documentation of this process that I know of was published by Xtravirt a couple of years ago.

But what if you prefer to run ESX on ESX instead of Workstation?

You may be pleased to know that the GA build of ESX 4 allows installing ESX 4 as a virtual machine as well as powering on nested virtual machines — VMs running on the virtual ESX host.  You can even VMotion a running virtual machine from the physical ESX to a virtual ESX — on the same physical server!

VMware vSphere 4.1 UPDATE: VMware ESXi 4.1 has a keyboard issue when virtualized on an ESX 4.0 host.  In order to virtualize ESXi 4.1, the underlying host must be 4.1.  However, ESX 4.1 classic will work on ESX 4.0.

The extra tweaks to make it all work are minimal, and I will show you how without even opening up a text editor.

After installing ESX 4 onto your real hardware, configure as desired and enable promiscuous mode on a vSwitch:

vswitch0_promisc.png

Read more: VCritical
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/

Posted via email from Jasper-net

Optimizing wait in MultiThreading Environment - C#

|
While working in Multithreading environment the primary thread has to wait until its secondary thread to complete their execution. So in this case most of the time we use Thread.Sleep() and that is a bad practice because it blocks the primary thread for a time that might be less or exceeds than the completion time of secondary thread. You can optimize the waiting time in multithreading by using System.Threading.AutoResetEvent class.

To achieve this we'll utilize the WaitOne() method of AutoResetEvent class. It'll wait until it gets notified from secondary thread for completion and this I think should be the optimized way for wait here.

Let see the example:

using System;
using System.Threading;
namespace Threads_CSHandler_AutoResetEvent
{
    class Program
    {
        //Declare the wait handler
        private static AutoResetEvent waitHandle = new AutoResetEvent(false);

        static void Main(string[] args)
        {
            Console.WriteLine("Main() running on thread {0}", Thread.CurrentThread.ManagedThreadId);

            Program p = new Program();
            Thread t = new Thread(new ThreadStart(p.PrintNumbers));
            t.Start();
            //Wait untill get notified
            waitHandle.WaitOne();
            Console.WriteLine("\nSecondary thread is done!");
            Console.Read();
        }


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

Posted via email from Jasper-net