Browsing all articles in Programming
Apr
14

SQL Server 2014 Key Features and Enhancements

Author admin    Category IT News, SQL     Tags

sql-server-2014

SQL Server 2014 comes with a set of enhancements as compared to its processors that brings a lot of business benefits to the applications in OLTP and OLAP environments. This article highlights a few key enhancements that are built into the product.

Performance Enhancements

These are performance enhancements that can help your workload run faster.

  • In-Memory OLTP:  This is a new feature allows the database to handle in-memory operations in OLTP scenarios (resolve issues in high concurrency situations). This component is called as “Hekaton”.  Microsoft has released an in-memory component called ‘xVelocity’ catering to OALP requirements, along with SQL Server 2012.
  • On-line indexing at the partition level: This feature allows index rebuilding done at a partition level. Also, the index statistics can be managed at the partition level which will be a huge improvement in performance
  • Updatable Column Store Indexes (CSI):  The CSI feature has been introduced in 2012. The limitation with CSI was that the table cannot be modified once a CSI is created.  In order to update table information the index needed to be dropped or disabled and then rebuilt the index. This new feature provides the ability to load or delete data from the table with Column Store indexes.
  • Buffer Pool Extension to Solid State Drives (SSDs). Ability of each node to have its own SSD or SSD Array for buffering (just like you would with TempDB) and thus increase in the performance by means of faster paging.  In this way, one can cache frequently used data on SSDs. This feature can be best leveraged in case of read-heavy OLTP workloads.
  • Resource Management. Resource Governor can control  I/O along with CPU and Memory (provided by the previous versions).

 

Improved Scalability

SQL Server has imcreased the amount of hardware it can use.

  • Ability to scale up to 640 logical processors and 4TB of memory in a physical environment
  • Ability to scale to 64 virtual processors and 1TB of memory when running in a virtual machine (VM).

High-Availability Enhancements

  • AlwaysOn Availability Groups (AG) get more secondary nodes: Always On supports now up to 8 secondary nodes instead of 4 (is the case with SQL 2012). Of course, Enterprise Edition is needed.
  • AlwaysOn Availability Group’s Readable Secondary will be ON-LINE (more reliable). In SQL 2012, if the primary drops offline, the readable replica databases drop offline. In SQL 2014, the secondary remain online and readable when the primaries aren’t available.
  • Azure Integrated AlwaysOn Availability Groups:  Uses Azure VMs as AlwaysOn AG replicas. This replicas can be created asynchronously on cloud (Azure platform) that saves from paying for expensive offsite datacenter space with machines that sit idle all the time.

Backup Enhancements

  • Smart Backup to Azure (Windows Azure Integrated Backup): Another new backup feature is Smart Backups. With Smart Backups SQL Server determines whether a full or incremental backup is needed and backs up accordingly to Azure.
  •  Azure backup feature and the Azure AlwaysOn Availability options are completely integrated into SSMS.

Microsoft® in-memory database engine

Microsoft® implemented an in-memory transactional engine with the project code name Hekaton*”. Hekaton is expected to dramatically improve the throughput and latency of SQL Server’s on-line transaction processing (OLTP) capabilities. Hekaton is designed to meet the requirements of the most demanding OLTP applications for financial services companies, online gaming and other companies which have extremely demanding TP requirements. This product achieves breakthrough improvement in TP capabilities without requiring a separate data management product or a new programming model. It’s still SQL Server!

Note*: Hekaton is from the Greek word ?κατ?ν for “hundred”. The design goal for the Hekaton original proof of concept prototype was to achieve 100x speeds (possibly)  for certain TP operations.

Key Features:

  • Implements a row-based technology squarely focused on transaction processing (TP) workloads. However, the xVelocity* and Hekaton in-memory approaches are NOT mutually exclusive. The combination of Hekaton and SQL Server’s existing xVelocity column store index and xVelocity analytics engine, will result in a great combination.
  • Hekaton (In-memory TP engine) and xVelocity column store index will be built-in to SQL Server, rather than a separate data engine, which is a conscious design choice

Note*: xVelocity is OLAP version of in-memory database released along with SQL Server 2012.

Technology Implementation:

  • Hekaton works by providing in-application memory storage for the most often used tables in SQL Server. Identifies tables that are most accessed, and will store them in the system’s main memory for faster access time.
  • Hekaton compiles T-SQL stored procedures directly into native code for faster execution.
  • Hekaton uses a new concurrency control mechanism developed by Microsoft® team and researchers from the University of Wisconsin using lock-free data structures for better scalability across multiple cores, avoiding locks while preserving ACID transaction integrity.

These features may be available already outside SQL Server such as own Power Pivot and Power View. However, the biggest difference is that Hekaton is built directly into SQL Server, so that there are no extensions, downloads, or interfaces that can slow down the very program meant to help increase your speed.

A few challenges with the implementation of in-memory OLTP database are as follows.

  • Need to change your data model. Need to bring significant changes to the traditional OLTP model. For ex: Identity fields aren’t supported, may have to use a GUID as a primary clustered key.
  • Need to change application code to replace ad-hoc SQL queries with stored procedure calls. Hekaton works best with stored procedures, as the stored procedures can compile into native code.
  • Since the processing happens in in-memory only, if there is any sudden growth in the Hekaton tables, we can cache less of your other tables. We may run out of memory.

[sqlservercentral]

Mar
20

Android: Fast Communication with .NET Using Protocol Buffers

Author admin    Category .NET, Android, IT News, Programming, Tips & Trik     Tags

Introduction

One of challenges in the interprocess communication when communicating across platforms (e.g. between Android and .NET) is how to encode (serialize) messages so that they can be understood by both platforms. Default binary serializers provided by platforms are not compatible and so the common solution is to encode messages into some text format e.g. XML or JSON. This can be perfectly ok in many cases but for applications with high performance expectations using the text format may not be an optimal solution.

The example bellow demonstrates how to use Protocol Buffers binary serialization in the inter-process communication between Android and .NET applications.

You Need to Download

In order to build the example source code you will need to add references to related libraries into the project. To get these libraries you can download:

  • Eneter.ProtoBuf.Serializer – protocol buffer serializer for Eneter, it also contains compiled protocol buffer libraries and utility applications for ‘proto’ files.
  • Eneter.Messaging.Framework – communication framework that can be used for free for non-commercial use.

Protocol Buffers libraries are open source projects that can be found at:

  • protobuf – Google implementation of Protocol Buffers for Java, C++ and Python.
  • protobuf-net – Protocol Buffers implementation from Marc Gravell for .NET platforms.
  • Eneter.ProtoBuf.Serializer – Open source project to integrate Protocol Buffers and Eneter Messaging Framework.

Add Following References into your Project

Into .NET project:

  • protobuf-net.dll – protocol buffers serializer for .NET, Windows Phone, Silverlight and Compact Framework developed by Marc Gravell.
  • Eneter.ProtoBuf.Serializer.dll – implements serializer for Eneter Messaging Framework using protobuf-net.dll.
  • Eneter.Messaging.Framework.dll – lightweight cross-platform framework for inter-process communication.

Into Android project:

  • protobuf.jar – protocol buffers serializer for Java and Android developed by Google.
  • eneter-protobuf-serializer.jar – implements serializer for Eneter Messaging Framework using protobuf.jar from Google.
  • eneter-messaging.jar – lightweight cross-platform framework for inter-process communication.

Important: please follow this procedure (for Eclipse) to add libraries into the Android project:
(To add a library into the project you need to import it instead of adding it via project properties.
Also ensure Java compliance level is set to 6.0. Properties -> Java Compiler -> JDK Compliance -> 1.6.)

  1. Create a new folder ‘libs’ in your project. (use exactly name libs)
  2. Right click on ‘libs’ and choose ‘Import…’ -> ‘General/File System’ -> ‘Next’.
  3. Then click ‘Browser’ button for ‘From directory’ and navigate to directory with libraries you want to add.
  4. Select check boxes for libraries you want to add.
  5. Press ‘Finish’

Protocol Buffers

Protocol Buffers is a binary serialization originally developed by Google to share data among applications developed in different languages like Java, C++ and Python. It became the open source and was ported to other languages and platforms too.

The biggest advantage of Protocol Buffers is its performance and availability on multiple platforms what makes it an alternative to consider when designing the communication between applications.
If you are interested a simple performance measurement is available at https://code.google.com/p/eneter-protobuf-serializer/wiki/PerformanceMeasurements.

Working With Protocol Buffers

The following procedure is optimized for defining messages for cross-platform communication:
(If you want to use Protocol Buffers only in .NET you do not have to declare messages via the ‘proto’ file but you can declare them directly in the source code by attributing classes – same way as using DataContractSerializer.)

  1. Declare messages in the ‘proto’ file.
  2. Compile the ‘proto’ file into the source code (C# and Java). It transforms declared messages to classes containing specified fields and the serialization functionality.
  3. Include generated source files into C# and Java projects.
  4. Initialize Eneter communication components to use EneterProtoBufSerializer.

640249/UsingProtoBuf.png

Example Code

The example bellow is exactly the same as in my previous article Android: How to communicate with .NET application via TCP. The only difference is the code in this article uses EneterProtoBufSerializer instead of XmlStringSerializer.

Please refer to Android: How to communicate with .NET application via TCP if you need details about how to use TCP on Android and how to setup the IP address in the emulator.

640249/CommunicationBetweenAndroidandNETProtoBuf.png

proto File

The ‘proto’ file represents a contract describing messages that shall be used for the interaction. Messages are declared in the platform neutral protocol buffer language – for the syntax details you can refer to https://developers.google.com/protocol-buffers/docs/proto.

Messages in our example are declared in the file MessageDeclarations.proto:

Collapse | Copy Code
// Request Message
message MyRequest
{
    required string Text = 1;
}

// Response Message
message MyResponse
{
    required int32 Length = 1;
}

The ‘proto’ file is then compiled to C# and Java source code. Declared messages are transformed to classes containing declared fields and serialization functionality.

The following commands were used in our example to compile the ‘proto’ file:

Collapse | Copy Code
protogen.exe -i:MessageDeclarations.proto -o:MessageDeclarations.cs
protoc.exe -I=./ --java_out=./ ./MessageDeclarations.proto

Android Client Application

The Android client is a very simple application allowing user to put some text message and send the request to the service to get back the length of the text.
When the response message is received it must be marshaled to the UI thread to display the result.

The client uses EneterProtoBufSerializer. It instantiates the serializer in the openConnection() method and puts its reference to the DuplexTypedMessagesFactory ensuring so the message sender will use Protocol Buffers.

The whole implementation is very simple:

Collapse | Copy Code
package net.client;

import message.declarations.MessageDeclarations.*;
import eneter.messaging.dataprocessing.serializing.ISerializer;
import eneter.messaging.diagnostic.EneterTrace;
import eneter.messaging.endpoints.typedmessages.*;
import eneter.messaging.messagingsystems.messagingsystembase.*;
import eneter.messaging.messagingsystems.tcpmessagingsystem.TcpMessagingSystemFactory;
import eneter.net.system.EventHandler;
import eneter.protobuf.ProtoBufSerializer;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;

public class AndroidNetCommunicationClientActivity extends Activity
{
    // UI controls
    private Handler myRefresh = new Handler();
    private EditText myMessageTextEditText;
    private EditText myResponseEditText;
    private Button mySendRequestBtn;

    // Sender sending MyRequest and as a response receiving MyResponse.
    private IDuplexTypedMessageSender<MyResponse, MyRequest> mySender;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        // Get UI widgets.
        myMessageTextEditText = (EditText) findViewById(R.id.messageTextEditText);
        myResponseEditText = (EditText) findViewById(R.id.messageLengthEditText);
        mySendRequestBtn = (Button) findViewById(R.id.sendRequestBtn);

        // Subscribe to handle the button click.
        mySendRequestBtn.setOnClickListener(myOnSendRequestClickHandler);

        // Open the connection in another thread.
        // Note: From Android 3.1 (Honeycomb) or higher
        //       it is not possible to open TCP connection
        //       from the main thread.
        Thread anOpenConnectionThread = new Thread(new Runnable()
            {
                @Override
                public void run()
                {
                    try
                    {
                        openConnection();
                    }
                    catch (Exception err)
                    {
                        EneterTrace.error("Open connection failed.", err);
                    }
                }
            });
        anOpenConnectionThread.start();
    }

    @Override
    public void onDestroy()
    {
        // Stop listening to response messages.
        mySender.detachDuplexOutputChannel();

        super.onDestroy();
    } 

    private void openConnection() throws Exception
    {
        // Instantiate Protocol Buffer based serializer.
        ISerializer aSerializer = new ProtoBufSerializer();

        // Create sender sending MyRequest and as a response receiving MyResponse
        // The sender will use Protocol Buffers to serialize/deserialize messages. 
        IDuplexTypedMessagesFactory aSenderFactory = new DuplexTypedMessagesFactory(aSerializer);
        mySender = aSenderFactory.createDuplexTypedMessageSender(MyResponse.class, MyRequest.class);

        // Subscribe to receive response messages.
        mySender.responseReceived().subscribe(myOnResponseHandler);

        // Create TCP messaging for the communication.
        // Note: 10.0.2.2 is a special alias to the loopback (127.0.0.1)
        //       on the development machine.
        IMessagingSystemFactory aMessaging = new TcpMessagingSystemFactory();

        IDuplexOutputChannel anOutputChannel
            = aMessaging.createDuplexOutputChannel("tcp://10.0.2.2:8060/");
            //= aMessaging.createDuplexOutputChannel("tcp://192.168.1.102:8060/");

        // Attach the output channel to the sender and be able to send
        // messages and receive responses.
        mySender.attachDuplexOutputChannel(anOutputChannel);
    }

    private void onSendRequest(View v)
    {
        // Create the request message using ProtoBuf builder pattern.
        final MyRequest aRequestMsg = MyRequest.newBuilder()
                .setText(myMessageTextEditText.getText().toString())
                .build();

        // Send the request message.
        try
        {
            mySender.sendRequestMessage(aRequestMsg);
        }
        catch (Exception err)
        {
            EneterTrace.error("Sending the message failed.", err);
        }

    }

    private void onResponseReceived(Object sender,
                                    final TypedResponseReceivedEventArgs<MyResponse> e)
    {
        // Display the result - returned number of characters.
        // Note: Marshal displaying to the correct UI thread.
        myRefresh.post(new Runnable()
            {
                @Override
                public void run()
                {
                    myResponseEditText.setText(Integer.toString(e.getResponseMessage().getLength()));
                }
            });
    }

    private EventHandler<TypedResponseReceivedEventArgs<MyResponse>> myOnResponseHandler
            = new EventHandler<TypedResponseReceivedEventArgs<MyResponse>>()
    {
        @Override
        public void onEvent(Object sender,
                            TypedResponseReceivedEventArgs<MyResponse> e)
        {
            onResponseReceived(sender, e);
        }
    };

    private OnClickListener myOnSendRequestClickHandler = new OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            onSendRequest(v);
        }
    };
}

.NET Service Application

The .NET service is a simple console application listening to TCP and receiving requests to calculate the length of a given text.

The service uses EneterProtoBufSerializer. It instantiates the serializer and puts its reference to the DuplexTypedMessagesFactory ensuring so the message receiver will use Protocol Buffers to deserialize incoming messages and serialize response messages.

The whole implementation is very simple:

Collapse | Copy Code
using System;
using Eneter.Messaging.DataProcessing.Serializing;
using Eneter.Messaging.EndPoints.TypedMessages;
using Eneter.Messaging.MessagingSystems.MessagingSystemBase;
using Eneter.Messaging.MessagingSystems.TcpMessagingSystem;
using Eneter.ProtoBuf;
using message.declarations;

namespace ServiceExample
{
    class Program
    {
        private static IDuplexTypedMessageReceiver<MyResponse, MyRequest> myReceiver;

        static void Main(string[] args)
        {
            // Instantiate Protocol Buffer based serializer.
            ISerializer aSerializer = new ProtoBufSerializer();

            // Create message receiver receiving 'MyRequest' and receiving 'MyResponse'.
            // The receiver will use Protocol Buffers to serialize/deserialize messages. 
            IDuplexTypedMessagesFactory aReceiverFactory =
                new DuplexTypedMessagesFactory(aSerializer);
            myReceiver = aReceiverFactory.CreateDuplexTypedMessageReceiver<MyResponse, MyRequest>();

            // Subscribe to handle messages.
            myReceiver.MessageReceived += OnMessageReceived;

            // Create TCP messaging.
            IMessagingSystemFactory aMessaging = new TcpMessagingSystemFactory();

            IDuplexInputChannel anInputChannel
                = aMessaging.CreateDuplexInputChannel("tcp://127.0.0.1:8060/");

            // Attach the input channel and start to listen to messages.
            myReceiver.AttachDuplexInputChannel(anInputChannel);

            Console.WriteLine("The service is running. To stop press enter.");
            Console.ReadLine();

            // Detach the input channel and stop listening.
            // It releases the thread listening to messages.
            myReceiver.DetachDuplexInputChannel();
        }

        // It is called when a message is received.
        private static void OnMessageReceived(object sender,
                                              TypedRequestReceivedEventArgs<MyRequest> e)
        {
            Console.WriteLine("Received: " + e.RequestMessage.Text);

            // Create the response message.
            MyResponse aResponse = new MyResponse();
            aResponse.Length = e.RequestMessage.Text.Length;

            // Send the response message back to the client.
            myReceiver.SendResponseMessage(e.ResponseReceiverId, aResponse);
        }
    }
}

[codeproject]
Mar
14

10 Programming Languages You Should Learn in 2014

Author admin    Category IT News, Programming     Tags

The tech sector is booming. If you’ve used a smartphone or logged on to a computer at least once in the last few years, you’ve probably noticed this.

As a result, coding skills are in high demand, with programming jobs paying significantly more than the average position. Even beyond the tech world, an understanding of at least one programming language makes an impressive addition to any resumé.

The in-vogue languages vary by employment sector. Financial and enterprise systems need to perform complicated functions and remain highly organized, requiring languages like Java and C#. Media- and design-related webpages and software will require dynamic, versatile and functional languages with minimal code, such as Ruby, PHP, JavaScript and Objective-C.

With some help from Lynda.com, we’ve compiled a list of 10 of the most sought-after programming languages to get you up to speed.

1. Java

java2

What it is: Java is a class-based, object-oriented programming language developed by Sun Micro systems in the 1990s. It’s one of the most in-demand programming languages, a standard for enterprise software, web-based content, games and mobile apps, as well as the Android operating system. Java is designed to work across multiple software platforms, meaning a program written on Mac OS X, for example, could also run on Windows.

Where to learn it: Udemy, Lynda.com, Oracle.com, LearnJavaOnline.org.

2. C Language

c2

What it is: A general-purpose, imperative programming language developed in the early ’70s, C is the oldest and most widely used language, providing the building blocks for other popular languages, such as C#, Java, JavaScript and Python. C is mostly used for implementing operating systems and embedded applications.

Because it provides the foundation for many other languages, it is advisable to learn C (and C++) before moving on to others.

Where to learn it: Learn-C, Introduction To Programming, Lynda.com, CProgramming.com,Learn C The Hard Way.

3. C++

cplusplus

What it is: C++ is an intermediate-level language with object-oriented programming features, originally designed to enhance the C language. C++ powers major software like Firefox, Winampand Adobe programs. It’s used to develop systems software, application software, high-performance server and client applications and video games.

Where to learn it: Udemy, Lynda.com, CPlusPlus.com, LearnCpp.com, CProgramming.com.

4. C#

csharp

What it is: Pronounced “C-sharp,” C# is a multi-paradigm language developed by Microsoft as part of its .NET initiative. Combining principles from C and C++, C# is a general-purpose language used to develop software for Microsoft and Windows platforms.

Where to learn it: Udemy, Lynda.com, Microsoft Virtual Academy, TutorialsPoint.com.

5. Objective-C

objectivec

What it is: Objective-C is a general-purpose, object-oriented programming language used by theApple operating system. It powers Apple’s OS X and iOS, as well as its APIs, and can be used to create iPhone apps, which has generated a huge demand for this once-outmoded programming language.

Where to learn it: Udemy, Lynda.com, Mac Developer Library, Cocoa Dev Central, Mobile Tuts+.

6. PHP

PHP

What it is: PHP (Hypertext Processor) is a free, server-side scripting language designed for dynamic websites and app development. It can be directly embedded into an HTML source document rather than an external file, which has made it a popular programming language for web developers. PHP powers more than 200 million websites, including WordPress, Digg andFacebook.

Where to learn it: Udemy, Codecademy, Lynda.com, Treehouse, Zend Developer Zone,PHP.net.

7. Python

python

What it is: Python is a high-level, server-side scripting language for websites and mobile apps. It’s considered a fairly easy language for beginners due to its readability and compact syntax, meaning developers can use fewer lines of code to express a concept than they would in other languages. It powers the web apps for Instagram, Pinterest and Rdio through its associated web framework, Django, and is used by Google, Yahoo! and NASA.

Where to learn it: Udemy, Codecademy, Lynda.com, LearnPython.org, Python.org.

8. Ruby

ruby

What it is: A dynamic, object-oriented scripting language for developing websites and mobile apps, Ruby was designed to be simple and easy to write. It powers the Ruby on Rails (or Rails) framework, which is used on Scribd, GitHub, Groupon and Shopify. Like Python, Ruby is considered a fairly user-friendly language for beginners.

Where to learn it: Codecademy, Code School, TryRuby.org, RubyMonk.

9. JavaScript

javascript

What it is: JavaScript is a client and server-side scripting language developed by Netscape that derives much of its syntax from C. It can be used across multiple web browsers and is considered essential for developing interactive or animated web functions. It is also used in game development and writing desktop applications. JavaScript interpreters are embedded in Google’s Chrome extensions, Apple’s Safari extensions, Adobe Acrobat and Reader, and Adobe’s Creative Suite.

Where to learn it: Codecademy, Lynda.com, Code School, Treehouse, Learn-JS.org.

10. SQL

sql2

What it is: Structured Query Language (SQL) is a special-purpose language for managing data in relational database management systems. It is most commonly used for its “Query” function, which searches informational databases. SQL was standardized by the American National Standards Institute (ANSI) and the International Organization for Standardization (ISO) in the 1980s.

[Mashable]

Nov
14

Microsoft Launches Visual Studio 2013, Cloud-Based Visual Studio Online

Author admin    Category IT News, Microsoft, Programming, Visual Studio     Tags

Visual-Studio-2013-Cloud-Based-Visual-Studio-Online-399960-2

Microsoft has just unveiled the brand new Visual Studio 2013 development suite and together with it, the company also introduced cloud-based companion called Visual Studio Online.

This new service is based on Microsoft’s very own Windows Azure and comes with a freeware license for development groups of up to five users.

Visual Studio Online will, however, be offered in four different options, namely Visual Studio Online Advanced, Visual Studio Online Professional, Visual Studio Online Basic, and Visual Studio Premium with MSDN.

This last version comes with support for an unlimited number of users, as well as with integration with lots of development tools, such the desktop-based Visual Studio, Eclipse, and Xcode. It also includes support for Office 365 business apps and tools to host team projects on-premises and in the cloud.

At the same time, Visual Studio Online comes with support for Monaco, a new coding environment specifically designed for the cloud. According to ZDNet, Microsoft recently revealed that work on Monaco has started three years ago, as it’s based on a service providing users specific Visual Studio features right within a browser.

“Visual Studio Online, formerly Team Foundation Service, is the home for your project data in the cloud. Get up and running in minutes on our cloud infrastructure without having to install or configure a single server,” Microsoft said in the introduction of the new cloud-based service.

“Set up an environment that includes everything from hosted Git repos and project tracking tools, to continuous integration and an IDE, all packaged up in a monthly per-user plan. Connect to your project in the cloud using your favorite development tool, such as Visual Studio, Eclipse or Xcode.”

Along with Visual Studio Online, Microsoft has also revealed that Visual Studio 2013 and Net Framework 4.5.1 now bring improvements for XAML, HTML and JavaScript in order to build Modern apps, as well as asynchronous debugging for a number of languages.

[softpedia]

Oct
2

HTML Editing Features in Visual Studio 2013 RC

Author admin    Category IT News, Programming, Visual Studio     Tags

Several interesting features have been added to the new HTML editor in Visual Studio 2013 RC since the VS 2013 Preview release. See HTML Editing Features in Visual Studio 2013 Preview for a rundown of the Preview features.

CSS Class and ID IntelliSense

In the Preview release, the new HTML editor did not implement CSS Class IntelliSense, meaning that if you typed <p class=”” you did not get a list of available classes. In RC, this feature is complete and is significantly better than the VS 2012 implementation.

VS 2012 had to follow file references back to CSS files to construct Class IntelliSense completion lists, so it failed to work in cases where files were included dynamically, or where ASP.NET Bundling and Minification was utilized, or even when the Web Development (Code Only) Profile was in use. VS 2013 RC inspects all available CSS files and makes class names available as values for the class attribute of any HTML tag. In cases where ID selectors are declared in CSS (such as #mainform {…}), unused ID selectors are available in value IntelliSense for id attributes.

image

ASPX and other WebForm files using the legacy editor do not benefit from this implementation in VS 2013, but may adopt the new system in future releases.

JavaScript References Auto-Sync and Update

Since VS 2012, web project templates have included a file in the Scripts folder named _references.js. This file contains JavaScript reference comments, such as:
/// <reference path=”jquery-1.8.2.js” />
These comments are used by the JavaScript Language Service to augment IntelliSense in JavaScript files, since explicit references are rarely available in JavaScript.

In VS 2013 RC, new functionality has been added to this feature. The included _references.js files now begin with:
/// <autosync enabled=”true” />
When this attribute is included and set to “true,” any JavaScript file added to the project will automatically be added to the _references.js file, and IntelliSense for that file will instantly become available in all JavaScript files and <script> blocks in the project.

Auto-sync can be set to “false” and manual updating can be performed by using context menu commands available when right-clicking on the open _references.js file:

image

You can add a _references.js file to a Scripts folder at the root of any project and turn on auto-sync using the context menu or by typing the attributed comment in. JavaScript files may be added anywhere, but the _references.js file must be in the folder named Scripts. (Important: see the caveat below: JavaScript References Auto-Sync adds Too Many References if Count Exceeds ~ 100.)

Knockout IntelliSense

In VS 2013 Preview, Knockout IntelliSense was not available, either in the legacy (WebForm) editor or in the new HTML editor. In VS 2013 RC, Knockout IntelliSense is back.

We do have a backlog of Knockout IntelliSense feature requests, but the schedule for VS 2013 did not permit us to make significant improvements in this release. There are a few bug fixes, but not feature additions in Knockout IntelliSense. See Knockout IntelliSense in ASP.NET and Web Tools 2012.2 RC for a description of this feature.

Razor Formatting

There are a large number of bug fixes and improvements in Razor editing and formatting in VS 2013 RC. Perhaps most significant is the long-awaited ability for Razor pages to layout and format correctly in Keep Tabs mode. In previous release, only Insert Spaces tab mode worked well with Razor. If you prefer tabs to spaces, try Tools\Options\Settings\Text Editors\HTML\Tabs: Keep Tabs.

image

CSS Hacks

If you’re not certain what CSS Hacks refers to, a tradition of selectively invalid CSS declarations has been employed for years to make “certain” browsers conform to standards-based behavior. In VS 2012, we introduced tolerance for and validation of CSS Hacks, as they were a solution intentionally used by many developers to deal with a difficult problem.

One hack that we did not handle was the \9 hack, which seems to be gaining significantly in popularity. For example, declarations like:
float: none\9;
…where flagged as illegal values in VS 2013 Preview, and are now validated as intentional CSS constructs.

Un-minify

If you right-click on an HTML or Razor file, the last command in the context menu is “Un-minify.” In RC, this command does nothing, but was included to ensure that the localization process was completed for all shipping languages. In RTM this command will expand minified HTML files.

RC Caveats

Unfortunately, RC shipped with some serious HTML editor bugs which have been found and fixed for RTM. These did not make it into the ReadMe file, so I will describe them here.

Exception when Typing and [Enter] Immediately after @{ in Razor C# Files

If you place the insertion point immediately after @{ and press enter, an exception is thrown. While the Razor Editor continues to function after the exception is dismissed, it is safest to close the affected file and reopen it before continuing if you encounter this issue. This is fixed in RTM.

KO Value IntelliSense Replaced by JavaScript IntelliSense in Some Cases

Due to a race condition, in some pages KO IntelliSense works for bindings, but instead of showing available binding values, it shows JavaScript syntax after the colon. We’re aware of this issue and it has been fixed for RTM.

JavaScript References Auto-Sync adds Too Many References if Count Exceeds ~ 100

An error in the code which auto-updates the _references.js file begins adding file names recursively after the file size exceeds 10 KB. Adding the AngularJS or Globalization NuGet packages will trigger this behavior and adds hundreds of additional lines of JavaScript References. The solution to this problem is to turn auto-update off by right-clicking on the editor surface of the _references.js file, selecting “Auto-sync JavaScript References,” which sets autosync enabled=”false”, and manually updating references using the “Update JavaScript References” context menu in the same manner. This has been fixed in RTM.

Razor Formatting on Paste

In some cases, when you paste Razor code into a cshtml page, the formatting of the pasted text is incorrect. Specifically, when you paste Razor blocks into an indented context (inside an HTML content element like a div, for example) extra indentation will be added to each Razor block progressively. To fix up the page after such an incident, format the document (Control-K followed by Control-D).
Unfortunately, selecting the affected area and applying Format Selection (Control-K Control-F) will not work; the bug was in the Format Selection code.  This has been fixed in RTM.

HTML Validation is Noisy

If you validate legacy HTML pages, the error list may include a good deal of noise that you’re not interested in. The <font> and <center> tags generate warning and many attributes are called out which are no longer in common use, but which browsers still honor. Such pages are unlikely to be completely re-written if they are still in use, and the low signal-to-noise ratio makes it difficult to find serious errors in such pages, so the usefulness of the validation process is reduced.

In RTM, we’ve eliminated many of these warnings. While deprecated tags and attributes do not appear in IntelliSense, they are not flagged as warnings if they appear in your page. If a legacy attribute is used with an incorrect value, the value will be flagged with a warning.

[msdn]

Jul
4

How to Start Learning Computer Programming

Author admin    Category IT News, Programming, Tips & Trik     Tags

Programming is a lot of fun and extraordinarily useful. While you learn to program, you’ll also develop a host of other analytical and critical thinking skills for tackling all sorts of complex problems (not just ones on computers) and it may just help you start a new career or land a new job in software development.

Computer programming is almost always done in some sort of Programming Language. These languages are written so that humans can understand them, but are formal and rigorous enough to input into a machine.

Programming languages are a way for you to express your thoughts about how to perform a specific task. As such, the programming language you start out with will inherently influence how you think about a particular problem. This influence is usually called the programming language’s paradigm.

There are hundreds – even thousands – of programming languages out there. (Programmers like to write new programming languages.) You don’t need to learn them all to be a good programmer, in fact, many of them use the same paradigm as other languages, so by learning one programming language, you’ll probably have a “Reading knowledge” of several others and be able to learn it completely rather quickly.

Some languages are geared for specific purposes. C, Java, etc are meant to be “general purpose” languages for building software and computer applications (like a web browser!) Languages like PHP are meant for dynamic websites (like wikiHow!) And there are others still: Python, Perl, etc are meant for performing a wide variety of small tasks.

  1. Start with a good book or tutorial on programming. The book will probably suggest a language. If you need recommendations, you might try Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman. It’ll teach you how to start programming in a language called Scheme( Now called Racket), which is a very simple language to learn. The book is available online for free at http://mitpress.mit.edu/sicp/full-text/book/book.html
  2. Get a compiler/interpreter/IDE for the programming language your book uses. A compiler/interpreter is just another computer program, but it will convert ideas you’ve written in a programming language into “machine code” so you can see things work. If you chose to use the book above, try PLT Scheme (http://www.drscheme.org/) If you’re starting to program in Java, you could try Eclipse (http://www.eclipse.org/downloads/) If you’re using C/C++, try Dev C++ (http://www.bloodshed.net/devcpp.html) or C/C++ interpreter Ch (http://www.softintegration.com)
  3. Read the book! Take examples of the programming language from the book and put them into your interpreter. Try changing the examples and making the program do different things.
  4. Try putting together your own ideas to form a working program. Start with simple things, like a program to convert currencies, and work your way up a long to more complex things as you continue reading and learning about your programming language.
  5. Once you start actively programming in your first language, you may want to learn a second one. You’ll get the most out of learning a second programming language if you pick one that uses a radically different paradigm than the one you started with. For instance, if you started in Scheme, you might try learning C or Java next. If you started in Java, you could learn Perl or Python.
  6. Continue programming and trying new things! To be a good programmer, you, at the very least, have to keep up with changing technology. Its a constant learning process, and you should always be learning new languages, new paradigms, and most importantly: programming new things!
  7. Learn how to type – This is very essential as it is make your programming very fast and effective. Although, people don’t always recommend that you should learn how to type but it’s very helpful

Edit Tips

  • Get a handy reference book. Make sure it’s the latest version as languages keep updating.
  • Don’t jump start into complex language like Java but start with python as it encourages beginners and is composed of basically every little aspect in programming.
  • If you are learning Java then work with NetBeans 6.0.1, it’s very cool and easy.
  • Java has a powerful concept called multithreading. Study it carefully.
  • Start with something fun, motivate yourself to solving challenges, progressing your skills in logical problem solving.
  • By heart the syntax is a must. You are free to apply it in your own way. Study some sample programs then start coding your own.

[wikihow]

Jun
18

Download Code Editor for Windows 8

Author admin    Category IT News, Programming     Tags

Download-Code-Editor-for-Windows-8

Code Writer is a Metro Windows 8 app that allows users to create and edit documents without even leaving the Modern UI, while also benefiting from helpful tools such as syntax highlighting and tabs.

“The app has been built from the ground up with Windows 8 design principles in mind. It’s fast and fluid, and gives you the power to edit documents with features you’d normally only find in desktop apps. Code Writer is perfect for editing any text-based file, doing code reviews, or giving presentations with code samples,” developers explained in the official description.

Since it’s mostly aimed at developers, it support more than 20 languages, such as HTML, CSS, JavaScript, XML, C#, VB, C++, ASP, PHP, Markdown, and Perl.

It can be installed not only on the desktop version of Windows 8, but also on Windows RT devices, such as Microsoft’s own Surface RT.

Download Code Writer for Windows 8

[softpedia]

Feb
18

Java Wins Programming Beauty Pageant, But C and Objective C Gussy Up

Author admin    Category IT News, Programming     Tags

programming

The Java programming language, bolstered by the adoption of Android-based smartphones and tablets in the market, has regained the crown as the top language in the Tiobe Programming Community Index put together by programming tool maker Tiobe Software.

The index is based on a number of different factors, including the availability of courses and training, the popularity of searches in Google, Bing, Yahoo, Amazon, YouTube, and Baidu search engines, and the number of engineers with specific programming skills based on their employment and job searches. The Tiobe Index has been around for more than a decade, and it is as much for fun as it is for information.

Java was the number one language in the Tiobe Index for February, with a rating of 18.4 percent, up 1.34 points over the past year. C was second with a 17.1 percent rating and climbing 56/100ths of a point, followed by Objective C, with a 9.8 percent rating but climbing 2.74 points. (Objective C is the variant of C that is used on Apple iOS.) Objective C has jumped two spots, passing by C++, the new-and-improved, object-oriented version of C that stopped short of becoming Java, and C#, which is Microsoft’s Java-C mashup for its Common Language Runtime that was supposed to be enough like a JVM to make everyone happy except Sun Microsystems (now Oracle) and IBM. Python, Ruby, VisualBasic.NET, Pascal, Bash, Matlab, and Assembly are all climbing among the top 20 programming languages in the February ranking.

Venerable COBOL has a rating of 0.514 percent among the top 50 languages and ranked just behind the SAS statistical programming language and just ahead of Fortran (used in supercomputers) and the R open source statistical language. Good ole Report Program Generator for IBM i and OS/400 ranked number 38 on the February 2013 list, with a rating of 0.247 percent. It jumps around a lot, sometimes kissing 1 percent. This time around, it is behind Smalltalk and ahead of OpenCL.

My guess is that there are around 15 million or so programmers in the world–meaning people who get paychecks for their work–so if you apply the Tiobe numbers to this figure, you won’t get anything that makes sense. It is commonly believed that there are around 10 million Java programmers in the world, and if you multiplied the Tiobe index against the raw population, you would bet something on the order of 2.7 million Java programmers. Like I said, this is more for fun than fact.

As for RPG, if there are 150,000 customers worldwide as IBM has told us, and the average shop has between two and three programmers (with the so-called CIO being a programmer with system administration and budget responsibilities), then there should be maybe on the order of 300,000 to 450,000 RPG programmers in the world (okay, so maybe 5 percent to 10 percent of them are actually COBOL programmers on the IBM i platform. If you use the Tiobe numbers percent against the raw number of 0.247 percent for RPG, you get a number that is an order of magnitude lower than this. Again, this was meant to be fun.

[itjungle]

Dec
12

Using YAML for Java Application Configuration

Author admin    Category IT News, Java, Programming     Tags

YAML is well-known format within Ruby community, quite widely used for a long time now. But we as Java developers mostly deal with property files and XMLs in case we need some configuration for our apps. How many times we needed to express complicated configuration by inventing our own XML schema or imposing property names convention?

Though JSON is becoming a popular format for web applications, using JSON files to describe the configuration is a bit cumbersome and, in my opinion, is not as expressive as YAML. Let’s see what YAML can do for us to make our life easier.

For sure, let’s start with the problem. In order for our application to function properly, we need to feed it following data somehow:

  • version and release date
  • database connection parameters
  • list of supported protocols
  • list of users with their passwords

This list of parameters sounds a bit weird, but the purpose is to demonstrate different data types in work: strings, numbers, dates, lists and maps. The Java model consists of two simple classes: Connection

01.package com.example.yaml;
02.
03.public final class Connection {
04.private String url;
05.private int poolSize;
06.
07.public String getUrl() {
08.return url;
09.}
10.
11.public void setUrl(String url) {
12.this.url = url;
13.}
14.
15.public int getPoolSize() {
16.return poolSize;
17.}
18.
19.public void setPoolSize(int poolSize) {
20.this.poolSize = poolSize;
21.}
22.
23.@Override
24.public String toString() {
25.return String.format( "'%s' with pool of %d", getUrl(), getPoolSize() );
26.}
27.}

and Configuration, both are typical Java POJOs, verbose because of property setters and getters (we get used to it, right?).

01.package com.example.yaml;
02.
03.import static java.lang.String.format;
04.
05.import java.util.Date;
06.import java.util.List;
07.import java.util.Map;
08.
09.public final class Configuration {
10.private Date released;
11.private String version;
12.private Connection connection;
13.private List< String > protocols;
14.private Map< String, String > users;
15.
16.public Date getReleased() {
17.return released;
18.}
19.
20.public String getVersion() {
21.return version;
22.}
23.
24.public void setReleased(Date released) {
25.this.released = released;
26.}
27.
28.public void setVersion(String version) {
29.this.version = version;
30.}
31.
32.public Connection getConnection() {
33.return connection;
34.}
35.
36.public void setConnection(Connection connection) {
37.this.connection = connection;
38.}
39.
40.public List< String > getProtocols() {
41.return protocols;
42.}
43.
44.public void setProtocols(List< String > protocols) {
45.this.protocols = protocols;
46.}
47.
48.public Map< String, String > getUsers() {
49.return users;
50.}
51.
52.public void setUsers(Map< String, String > users) {
53.this.users = users;
54.}
55.
56.@Override
57.public String toString() {
58.return new StringBuilder()
59..append( format( "Version: %s\n", version ) )
60..append( format( "Released: %s\n", released ) )
61..append( format( "Connecting to database: %s\n", connection ) )
62..append( format( "Supported protocols: %s\n", protocols ) )
63..append( format( "Users: %s\n", users ) )
64..toString();
65.}
66.}

ow, as model is quite clear, let us try to express it as the human being normally does it. Looking back to our list of required configuration, let’s try to write it down one by one. 1. version and release date

version: 1.0
released: 2012-11-30

2. database connection parameters

connection:
    url: jdbc:mysql://localhost:3306/db
    poolSize: 5

3. list of supported protocols

protocols:
   - http
   - https

4. list of users with their passwords

users:
    tom: passwd
    bob: passwd

And this is it, our configuration expressed in YAML syntax is completed! The whole file sample.yml looks like this:

version: 1.0
released: 2012-11-30

# Connection parameters
connection:
    url: jdbc:mysql://localhost:3306/db
    poolSize: 5

# Protocols
protocols:
   - http
   - https

# Users
users:
    tom: passwd
    bob: passwd

To make it work in Java, we just need to use the awesome library called snakeyml, respectively the Maven POM file is quite simple:

02.<modelversion>4.0.0</modelversion>
03.
04.<groupid>com.example</groupid>
05.<artifactid>yaml</artifactid>
06.<version>0.0.1-SNAPSHOT</version>
07.<packaging>jar</packaging>
08.
09.<properties>
10.<project.build.sourceencoding>UTF-8</project.build.sourceencoding>
11.</properties>
12.
13.<dependencies>
14.<dependency>
15.<groupid>org.yaml</groupid>
16.<artifactid>snakeyaml</artifactid>
17.<version>1.11</version>
18.</dependency>
19.</dependencies>
20.
21.<build>
22.<plugins>
23.<groupid>org.apache.maven.plugins</groupid>
24.<artifactid>maven-compiler-plugin</artifactid>
25.<version>2.3.1</version>
26.<configuration>
27.<source>1.7</source>
28.<target>1.7</target>
29.</configuration>
30.</plugins>
31.</build>
32.</project>

Please notice the usage of Java 1.7, the language extensions and additional libraries simplify a lot of regular tasks as we could see looking into YamlConfigRunner:

01.package com.example.yaml;
02.
03.import java.io.IOException;
04.import java.io.InputStream;
05.import java.nio.file.Files;
06.import java.nio.file.Paths;
07.
08.import org.yaml.snakeyaml.Yaml;
09.
10.public class YamlConfigRunner {
11.public static void main(String[] args) throws IOException {
12.if( args.length != 1 ) {
13.System.out.println( "Usage: <file.yml>" );
14.return;
15.}
16.
17.Yaml yaml = new Yaml();
18.try( InputStream in = Files.newInputStream( Paths.get( args[ 0 ] ) ) ) {
19.Configuration config = yaml.loadAs( in, Configuration.class );
20.System.out.println( config.toString() );
21.}
22.}
23.}

The code snippet here loads the configuration from file (args[ 0 ]), tries to parse it and fill up the Configuration class with meaningful data using JavaBeans conventions, converting to the declared types where possible. Running this class with sample.yml as an argument generates the following output:

Version: 1.0
Released: Thu Nov 29 19:00:00 EST 2012
Connecting to database: 'jdbc:mysql://localhost:3306/db' with pool of 5
Supported protocols: [http, https]
Users: {tom=passwd, bob=passwd}

Totally identical to the values we have configured!

[dzone]

Dec
11

PHP 6 Features

Author admin    Category IT News, PHP, Programming     Tags

PHP 6′s Status

Several books have already been written and published about PHP 6, such as Professional PHP6 by Edward Lecky-Thompson & Steven Nowicki. Despite this, PHP6 does not exist yet. There is no PHP 6 beta or even alpha. PHP 6 does not exist.

To see that PHP 6 doesn’t exist yet, see PHP’s official Subversion page. Subversion, or svn, is the source code control software used for the development of PHP. There are instructions for getting the code for PHP 5.3 or 5.4, but not for any newer version:

PHP 5.3: svn checkout http://svn.php.net/repository/php/php-src/branches/PHP_5_3 php-src-5.3
PHP 5.4: svn checkout https://svn.php.net/repository/php/php-src/branches/PHP_5_4 php-src-5.4

As you can see here from the branches in the PHP source code the newest branch is PHP_5_3:

  FIRST_UNICODE_IMPLEMENTATION/	 296285	 16 months	 derick	 - Committing my session cookie patch; it's a bug fix and good to have in the h…
...
  PHP_4_4/	 295390	 16 months	 derick	 - Set-up externals for the Zend engine so 4.4 can at least be build from SVN a…
  PHP_5_0/	 284180	 2 years	 gwynne	 one more attempt at ridding us of some of those annoying mime types
  PHP_5_1/	 284180	 2 years	 gwynne	 one more attempt at ridding us of some of those annoying mime types
  PHP_5_2/	 311125	 2 months	 dmitry	 Fixed crash on recursive error handler invocation
  PHP_5_2_WITH_DRCP/	 284180	 2 years	 gwynne	 one more attempt at ridding us of some of those annoying mime types
  PHP_5_3/	 313616	 31 hours	 scottmac	 When we have a blocking SSL socket, respect the timeout option. reading from SS…
  PHP_5_4/	 313646	 3 hours	 stas	 No E_STRICT in production

(Older code branches omitted for brevity.)

There’s no PHP 6 code branch yet. Notice the FIRST_UNICODE_IMPLEMENTATION branch – the story behind this code branch, and why it delayed PHP 6 follows.

What does exist is an official todo for PHP 6, authored by Andrei Zmievski, which includes a rough list of PHP 6 features in the PHP Wiki.

UPDATE 21 July 2011: Now the PHP 5.4 Alpha has been released, a PHP 6 branch may exist for PHP’s developers without showing up on PHP’s public subversion. The code for PHP 5.4 did not show up on the sites above until the PHP 5.4 Alpha was released.

Reasons for Delays to PHP 6

The reasons for the delay to PHP 6 appear to be:

  1. Issues with Unicode support: The development team initially decided to use UTF-16 internally in PHP 6. This causes double memory usage for strings, more CPU usage and increased complexity of coding PHP 6. Using UTF-16 apparently took a lot of fun out of developing PHP, caused tension amongst PHP’s developers and slowed development. The choice to use UTF-16 was aborted by Rasmus Lerdorf, creator of PHP, in 2010. The developers restarted the Unicode implementation.
  2. PHP 5.3 took some PHP 6 features: PHP 5.3 included many of the features slated as desirable for PHP 6. This removed a lot of momentum for PHP 6.
  3. High Hopes: PHP 6 is a major version number change. It’s possible in a major release to make significant changes, including making breaks from the past. Agreeing and delivering major changes can take some time.
  4. Feature Set Not Finalized: Agreement hasn’t been reached on the features in PHP 6.0.
  5. Lack of Urgency: PHP works very well. There are no burning issues forcing the release of PHP 6.
  6. PHP 5.4 takes some PHP 6 features: Rasmus Lerdorf previously stated, when he scrapped PHP 6′s original Unicode implementation, that there may be a PHP 5.4 yet, or PHP may go straight to version 6. Jani Taskinen created a PHP 5.4 development branch on 11 March 2010, but this appears to be due to frustration as being able to move PHP’s development forward. The PHP 5.4 code branch is no longer there. There is however an official PHP 5.4 todo wiki, with Stanislav Malyshev as the tentative release manager. So it looks there will be PHP 5.4, which would push out the PHP 6.0 release further. UPDATE on 24 July 2011: The PHP 5.4 Alpha has been released, and it includes some features originally targeted for PHP 6.0, such as traits and the removal of register_globals and safe_mode.

PHP 6 Features

The likely set of PHP6 features is:

  1. Internationalization: Native Unicode – UTF-8 – to the core (strings, APIs).
  2. Performance: Page level (opcode) caching through moving Alternative PHP Cache (APC) into the PHP core. Native application caching.
  3. Break to label: Sending a break to a label (like a goto).
  4. Enhanced array indexing: Array indexing can be used to substring or take an array slice.
  5. Removed features: Magic quotes will be removed.

The are quite a few more minor features and changes in PHP 6.

[smartwebdeveloper]

Follow us on Twitter! Follow us on Twitter!
[Powered by Android]

Blogroll

Google Search :)

Calendar

April 2014
M T W T F S S
« Mar    
 123456
78910111213
14151617181920
21222324252627
282930  

Archives

Recent Posts