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

iPhone lockscreen can be bypassed with new iOS 6.1 trick

| Sunday, February 17, 2013
A security flaw in Apple's iOS 6.1 lets anyone bypass your iPhone password lock and access your phone app, view or modify contacts, check your voicemail, and look through your photos (by attempting to add a photo to a contact). The method, as detailed by YouTube user videosdebarraquito, involves making (and immediately canceling) an emergency call and holding down the power button twice. We followed the steps and managed to access the phone app on two UK iPhone 5s running iOS 6.1. This isn't the first time this has happened — a very similar bug affected iOS 4.1, and was fixed in iOS 4.2. We've reached out to Apple for comment and will update you once we hear back.

Процесс взлома:

1) Разблокируйте устройство
2) Нажмите клавишу «Экстренный вызов»
3) Зажмите клавишу Power до появления слайдера выключения устройства
4) Нажмите «Отменить»
5) Позвоните на номер экстренной помощи 112 и сразу же сбросьте вызов
6) Нажмите Power для блокировки устройства
7) Еще раз разблокируйте устройство и затем зажмите Power (с экрана ввода пароля)
8) Через (примерно) 3 секунды нажмите на «Экстренный вызов»
Ну вот вы и в приложении телефон

Read more: Habrahabr.ru
Read more: The verge
QR: Inline image 1

Posted via email from Jasper-net

Decompiling .NET Applications

|
...
...

Let’s consider a basic variable instantiation and an equality check, when this is compiled it will output something partially readable. To me the output is readable but that’s just because I have a weird love for IL. When this basic snippet was compiled using LINQPad it generated some IL which you can see below.

Inline image 1

So how do we do this? By using a decompiler!

As I tend to do this quite often to understand how libraries work that I have no control over, I have tried some different tools for just this cause. Let’s take a look at four of the most common ones on the market. Don’t worry, there’s both free versions and paid ones out there!

Telerik JustDecompile

The first one that we’re looking at is a product from the Just* family created by Telerik. I do like the products from Telerik so this one should be quite interesting!

JustDecompile is completely free and available for download over at Teleriks website. One thing that I didn’t like thought was the installer, generally Telerik’s installers are pretty nice, but I don’t like being “guided” to install other stuff than what I’ve asked for.

QR: Inline image 2

Posted via email from Jasper-net

#781 – A struct Can Implement an Interface

|
Like a class, a struct can implement an interface.  In the example below, the DogCollar struct implements the IStrapDimensions interface, which contains a couple of properties and a method.

public interface IStrapDimensions
{
    double Length { get; }
    double Width { get; }

    double CalcArea();
}

public struct DogCollar : IStrapDimensions
{
    private double length;
    public double Length
    {
        get { return length; }
    }

    private double width;
    public double Width
    {
        get { return width; }
    }

    public double CalcArea()
    {
        return Length * Width;
    }

...

QR: Inline image 1

Posted via email from Jasper-net

Targeting Mono in Visual Studio 2012

|
These steps are known good on my Windows 8 machine, with Visual Studio 2012 w/ Update 1 and Mono 2.10.9.

Choose a decent path, which for me was C:\Program Files (x86)\Mono-2.10.9

  • Load an elevated administrative Command Prompt (Top tip: On Windows 8, hit WinKey+X then choose “Command Prompt (Admin)“)
  • From this Command Prompt, execute the following commands (in order):
$ cd "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile"
$ mklink /d Mono "C:\Program Files (x86)\Mono-2.10.9\lib\mono\4.0"
$ cd Mono
$ mkdir RedistList
$ cd RedistList
$ notepad FrameworkList.xml

  • Notepad will start and ask about creating a new file, choose Yes.

  • Now paste in this text and Save the file:
<?xml version="1.0" encoding="UTF-8"?>
<FileList ToolsVersion="4.0" RuntimeVersion="4.0" Name="Mono 2.10.9 Profile" Redist="Mono_2.10.9">
</FileList>

  • From the same Command Prompt, type:
$ regedit

  • In the Registry Editor, navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\ and create a new Key folder called .NETFramework,Version=v4.0,Profile=Mono

  • Now navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\ and create the same Key folder again here (this step is only necessary for x64 machines, but since all software developers use those then you’ll probably need to do it!)

  • Now load up VS2012 and a project. Goto the Project Properties (Alt+Enter whilst having it selected on Solution Explorer) .

QR: Inline image 1

Posted via email from Jasper-net

Fun with Object and Collection Initializers

|
...
...

Is it an object initializer? Is it a collection initializer? (Parenthetically speaking...)

In a lot of C# code, an assignment expression is just a normal expression. That means there's potentially room for ambiguity, in exactly the same kind of situation as above - when sometimes we want a collection initializer, and sometimes we want an object initializer. Consider this sample class:

using System; 
using System.Collections; 

class Weird : IEnumerable 
    public string Foo { get; set; } 
     
    private int count; 
    public int Count { get { return count; } } 
         
    public void Add(string x) 
    { 
        count++; 
    } 
             
    IEnumerator IEnumerable.GetEnumerator() 
    { 
        throw new NotSupportedException(); 
    }     
}

As you can see, it doesn't actually remember anything passed to the Add method, but it does remember how many times we've called it.

Now let's try using Weird in two ways which only differ in terms of parentheses. First up, no parentheses:

string Foo = "x"; 
Weird weird = new Weird { Foo = "y" }; 
     
Console.WriteLine(Foo);         // x 
Console.WriteLine(weird.Foo);   // y 
Console.WriteLine(weird.Count); // 0

Okay, so it's odd having a local variable called Foo, but we're basically fine. This is an object initializer, and it's setting the Foo property within the new Weird instance. Now let's add a pair of parentheses:

string Foo = "x"; 
Weird weird = new Weird { (Foo = "y") }; 
     
Console.WriteLine(Foo);         // y 
Console.WriteLine(weird.Foo);   // Nothing (null) 
Console.WriteLine(weird.Count); // 1

Just adding those parenthese turn the object initializer into a collection initializer, whose sole item is the result of the assignment operator - which is the value which has now been assigned to Foo.

Needless to say, I don't recommend using this approach in real code...

QR: Inline image 1

Posted via email from Jasper-net

Creating Metro (Windows 8) Loading Animation Using XAML

|
Introduction 

This article provides a complete XAML code with explanation required to create a Metro-style loading animation as seen in Microsoft Windows 8. A developer will be able to customize this code (e.g. change a particle color, a rotating speed, etc.) to suit his needs.

During my development, I use Kaxaml as a tool to create the animation.

Background 

There are plenty of articles out there providing tutorials about how to create an AJAX-style loading animation (busy indicator) in Silverlight/WPF using XAML. However, as my job required me to mimic a Metro-style loading animation, I decided to create one and shared it here

...
...

<Grid
    xmlns:system = "clr-namespace:System;assembly=mscorlib"
    <Grid.Resources>
        <SolidColorBrush x:Key = "ParticleColor" Color = "#006699"/>
        <SolidColorBrush x:Key = "ParticleBackgroundColor" Color = "Transparent"/>
        <system:Double x:Key = "ParticleOpacity">1</system:Double>
        <system:Double x:Key = "StartingPointX">0</system:Double>
        <system:Double x:Key = "StartingPointY">-20</system:Double>
        <Style x:Key = "EllipseStyle" TargetType = "Ellipse">
            <Setter Property = "Width" Value = "5"/>
            <Setter Property = "Height" Value = "5"/>
            <Setter Property = "Fill" Value = "{StaticResource ParticleColor}"/>
            <Setter Property = "RenderTransformOrigin" Value = "0.5, 0.5"/>
            <Setter Property = "Opacity" Value = "1"/>
        </Style>
    </Grid.Resources>
    <Canvas Width = "50" Height = "50">
        <Canvas.Triggers>
            <EventTrigger RoutedEvent = "Canvas.Loaded">
                <EventTrigger.Actions>
                    <BeginStoryboard>
                        <Storyboard
                            x:Key = "MetroLoadingAnimation"
                            BeginTime = "00:00:00.000"
                            Duration = "00:00:2.000"
                            RepeatBehavior = "Forever">
                            <DoubleAnimation
                                Storyboard.TargetName = "p0"
                                Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
                                From = "0"
                                To = "360"
                                BeginTime = "00:00:00.000"
                                Duration = "00:00:01.000"/>
                            <DoubleAnimation
                                Storyboard.TargetName = "p1"
                                Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
                                From = "0"
                                To = "360"
                                BeginTime = "00:00:00.100"
                                Duration = "00:00:01.100"/>

Read more: Codeproject
QR: Inline image 1

Posted via email from Jasper-net

Samsung Plans Multiple Tizen Smartphones for 2013

|
Inline image 1

Samsung’s intentions for Tizen, the Linux-based mobile platform it’s developing with Intel, grow clearer by the day. Earlier this week, we learned that NTT Docomo, Japan’s largest wireless carrier, has quietly signed on to help bring a Tizen handset to market. Now comes news that the device will be one of many that Samsung plans to debut this year.

Read more: AllThingsD
QR: Inline image 2

Posted via email from Jasper-net

The Best Free Programs and Online Services for Sending and Sharing Large Files

|
Last week, we published a list of websites for sharing photos with friends and family. Of course, you can also share your photos by emailing them, but many email services impose a limit on the size of files you can send.

TyphoonUpload allows you to quickly and easily send files to co-workers, friends, and family without the hassle of email attachments or the burden of FTP. Manage email addresses and receive confirmation emails when your files are successfully delivered. TyphoonUpload features full Windows integration and the Express Send option allows users to send files in just a few clicks.

The free account allows you to send any files up to 2GB in size. Other paid plans are available that allow you to send bigger files.

Read more: How-to geek
QR: Inline image 1

Posted via email from Jasper-net

Skype calls now equivalent to one-third of global phone traffic

|
Inline image 2

New research (PDF) from TeleGeography, a telecom market analysis firm, shows that worldwide Skype usage is now equivalent to over one-third of all international phone traffic—a record level.

The firm’s new data, released Wednesday, shows that “international telephone traffic grew 5 percent in 2012, to 490 billion minutes.” At the same time, “cross-border Skype-to-Skype voice and video traffic grew 44 percent in 2012, to 167 billion minutes. This increase of nearly 51 billion minutes is more than twice that achieved by all international carriers in the world, combined.”

While that doesn’t mean that telcos are going to go out of business anytime soon, it does mean that they are certainly continuing to feel the heat.

Read more: ArsTechnica
QR: Inline image 1

Posted via email from Jasper-net

Optimize your delegate usage

|
Kudos to David Fowler for spotting this! We had a chat on JabbR and David pointed out something quite odd about delegates which he had discovered while optimizing some code.

Let’s assume that we have the following code that declares a delegate and a method that uses it:

public delegate void TestDelegate();

public void Bar(TestDelegate test)
{
    test();
}

Now consider that you want to run this method and pass a method for it to execute that corresponds with the delegate. The process of running this will be in a loop that runs for 10 000 iterations.

The method we want to run is called Foo and looks like the following:

public void Foo() { }
Everything is set up, so what is it that we need to optimize when calling this 10 000 times? Well we have two different ways of using the method with a delegate.

Option 1
The first option is that we can use an anonymous method to call this method looking like the following:

for (var i = 0; i < 10000; i++)
{
    Bar(() => Foo());
}

If we compile this and open it up in Reflector to see what is generated, there’s also some other stuff generated behind the scenes but this is the important part:

TestDelegate test = null;
for (int i = 0; i < 0x2710; i++)
{
    if (test == null)
    {
        test = () => this.Foo();
    }
    this.Bar(test);
}

Looks good so far, right? Let’s take a look at Option 2 and compare.

Option 2
The second option that we have is just writing the method name to tell it to use this like you can see here:

for (var i = 0; i < 10000; i++)
{
    Bar(Foo);
}

This one is quite common and I’ve seen it used a lot, but what happens behind the scenes here?

If we open this up in Reflector we can see that the following code was generated:

for (int i = 0; i < 0x2710; i++)
{
    this.Bar(new TestDelegate(this.Foo));
}

QR: Inline image 1

Posted via email from Jasper-net

Too Much, Too Fast with WPF and Async

|
.NET 4.5 added asynchronous language features for C# and VB. For the most part, this has made it much easier to improve a user interface’s responsiveness—you can use asynchronous APIs to perform potentially slow work in a way that will not cause your user interface to freeze, and yet you can use simple programming techniques that look very similar to those used in single-threaded code. However, this is not a panacea. There are some kinds of slow, IO-oriented work (i.e., the kind of work that often benefits most from asynchrony) where a simple application of these techniques won’t help as much as you might hope.

For example, you can run into trouble if you’re doing something that’s slow, but not quite slow enough. If you want to display a large amount of data from a file, a naive asynchronous (or, for that matter, multithreaded) approach can run into problems. The async and await keywords deal easily with long waits, but if you’re doing something slightly more busy you may need to apply these techniques with a bit more subtlety. This is the first in a series of blog posts exploring these issues.

The following code reads web server .log files. It reads all the files in a folder, and picks out the cs-uri-stem column, putting the result in an ObservableCollection<string>. We can bind that to a ListBox to show all of the URLs that have been fetched. (It’s a little crude—it ignores query strings for example, but for the log data I’m looking at, that happens not to matter, and the processing details aren’t the main point here.)

using System;
using System.IO;
using System.Collections.ObjectModel;

public class LogReader
{
    public LogReader()
    {
        LogUris = new ObservableCollection<string>();
    }

    public ObservableCollection<string> LogUris { get; set; }

    public void ReadLogs(string folder)
    {
        foreach (string logfile in Directory.GetFiles(folder, "*.log"))
        {
            using (StreamReader reader = File.OpenText(logfile))
            {
                int column = -1;
                while (!reader.EndOfStream)
                {
                    string line = reader.ReadLine();
                    if (line == null) { break; }

                    string[] fields = line.Split(' ');
                    if (line.StartsWith("#Fields"))
                    {
                        column = Array.IndexOf(fields, "cs-uri-stem") - 1;
                    }
                    else if (line[0] == '#' || fields.Length < (column + 1))
                    {
                        continue;
                    }
                    if (column >= 0)
                    {
                        string uri = fields[column];
                        LogUris.Add(uri);
                    }
                }
            }
        }
    }
}

I have a folder with about 40MB of log files, containing about 180,000 log entries. If I process this with my LogReader, and use it as the data source for a WPF ListBox, my aging desktop system takes about 2.6 seconds to load the information in that folder.

That’s clearly slow enough to be annoying, so you might think this would be an obvious candidate for going asynchronous. We’re loading a moderately large quantity of data from disk, so at least some of the work will be IO bound, and that’s where async usually shines.

Naive Asynchronous Implementation

At this point, an overenthusiastic developer might think “Ooh—async and await!” and make the obvious modifications. With .NET 4.5 and C#5 this is pretty simple. First, we need to change the signature of the method, adding the async keyword to enable the language features, and returning a Task to enable asynchronous completion, error reporting, and composition with other tasks:

public async Task ReadLogsAsync(string folder)

Read more: IanG on Tap
QR: Inline image 1

Posted via email from Jasper-net

SoShare — 1 терабайт бесплатно от BitTorrent

|
Inline image 2

​В пятницу BitTorrent анонсировал старт публичной беты SoShare, сервиса, который переплюнет сервисы, подобные YouSendIt, DropBox и другим, разрешая передавать до 1TB. Компания позиционирует сервис для использования людьми креативных профессий — дизайнерам, фотографами, музыкантами и так далее — теми, кто работает с большими объёмами данных, но испытывает сложности с пересылкой их друг другу из-за ограничений почтовых служб и сервисов синхронизации и пересылки.

Read more: Habrahabr.ru
Read more: ​SoShare
QR: Inline image 1

Posted via email from Jasper-net