How to view documents using Visual Studio

View documents in Visual Studio with an amazing tool

Xpath Axes

A very useful trick for automation

Review: Spire.DataExport for .NET

A great tool for exporting data in .NET

How to install Arch Linux, step by step, for VMware Workstation (Part I)

First part of a installation tutorial for this beloved OS

How to setup a local repository in Ubuntu

The steps to have a local repo in Ubuntu

Saturday, January 31, 2015

How to create a linked server (SQL Server 2012)

A couple of days ago I published a post on how to execute functions in a linked server.  If you want to try it, you'll have to create a linked server, but how to do it? Follow these instructions and you'll achieve that in a minute.

Requirements:

- 2 SQL Server Instances. I used 2 virtual machines with Windows Server 2012, each one with an instance of SQL Server 2012. I'll call them Server1 and Server2.
- Of course, you'll need to have the machines in the same network.

Steps:

1. Open SQL Server Management Studio in Server1.
2. Expand Server Objects
expanded server objects
3. Right click Server Objects > New > Linked Server...
new linked server
4. Enter the name of Server2 in the field 'Linked Server'
5. Select 'SQL Server' as Servet type.
general linked server
6. Click 'Security'
7. Click 'Add'
8. Here you can select a user from Server1 to access Server2. In this case, I'll user the credentials of a user from Server2 called 'testools'. So, leave 'Impersonate' unchecked.
9. Click 'Security Options'
10. Set 'RPC Out' to 'true'. This enables you to run stored procedures remotely.
remote user
11. Click OK and there you have it! if you expand Server Objects > Linked Server you'll see you recently added server:
added linked server

Wednesday, January 28, 2015

Final blow for Flash? Youtube now with HTML5 by default

HTML5 logo

There's a extensive letter by Steve Jobs in the official Apple site where he explains the reasons why he didn't want to back Flash in the first place.  I've always been a big Steve Jobs' fan, but also I always had some doubts about this point. I mean, if you read his official biography you'll immediately notice that the most important motivators for Apple and all the other technology companies is not exactly technology itself, or innovation. It's money. As simple as that. And I think Jobs had his own business reasons to begin a "war" on Flash.

However, as the time went by, Flash lost a lot of territory, especially in the mobile field. I can't tell if Steve Jobs was right with the technical reason he gave, but I'm sure he always won at the end. And maybe now we could be certain about it.

Youtube has announced in its official Engineering and Developers Blog that they'll use HTML5 as default for its videos.

This may be the end for Flash, since they had Youtube as one of their biggest (if not the biggest) clients. Flash has been consistently loosing market share during the last months, as you can see in the following chart:
Flash historical trend

You can consult some other related charts here.

The fall of Flash begun as soon as the iPhone was released for the first time.  A long time ago, Apple lost against Microsoft but not because of bad technology choices, but for business moves that gave Microsoft and edge. Right now, I'm not in the position to say if Flash was really a bad choice for mobile devices, but I'm sure that the business decisions dig the grave for Flash back when the true Smartphone market was raising.

On the other hand, we could evaluate the technical reason given by Steve Jobs in his own words:


As a conclusion, and given the circumstances, maybe it's time to bury Flash once and for all...

How to execute functions in a linked server (SQL Server 2012)

Linked servers are very useful.  They are often used in work environments for different reasons. As you may know, there's a well known method to query tables in a linked server:

Check the linked servers and databases:

- Open SQL Server Management Studio
- Expand the instance > Server Objects > Linked Servers. There you can see the servers linked to your own server. For example, in my case:

Linked servers
- That was to illustrate the where you can check the linked servers. To query a table in a linked server, you can use the following "template":

<Server>.<database>.dbo.<table>

For example:

SELECT * from SERVER2.testDB.dbo.actresses where firstName = 'Jennifer'

Query to linked server

That's OK, but what if you want to execute a function in a linked server? Let's try that with the same formula:

SELECT * from SERVER2.testDB.dbo.fn_getInitialsById(1)

That is meant to run a simple function to get the initial from a celebrity (in this case, I want to get the initials 'J' and 'L' from Jennifer Lawrence, with the ID 1):

Remote function error

We get the following error:

Msg 4122, Level 16, State 1, Line 1
Remote table-valued function calls are not allowed.

But there is another way to query a function in a linked server. Use the following example:

EXEC SERVER2.testDB.dbo.sp_executesql N'SELECT * FROM testDB.dbo.fn_getInitialsById (1)'

Executing function in linked server
It worked! The detail here is this stored procedure: sp_executesql. You can find more information about it here.

Of course, you'll need to adapt that query to your necessities, but that's the general way to run a function in a linked server. I hope this is useful!

Monday, January 26, 2015

Solution to problem when installing SQL Server 2012 on Windows Server 2012

Windows server 2012

There's an annoying problem when you try to install SQL Server 2012 in Windows Server 2012. In the final installation step, almost at the beginning of the configurations, an error message is displayed:
Error installing SQL Server

With this particular message:

Error while enabling Windows feature : NetFx3, Error Code : –2146498298 , Please try enabling Windows Feature : NetFx3 from Windows management tools and then run setup again.

This is a feature for Windows Server 2012 that is not installed by default, so you won't find it in the list of features in the Control Panel. So, you'll need the Windows Server 2012 installation disc. With that at hand, follow these steps:

1. Open a command line as administrator.

2. Enter this command:

dism /online /enable-feature /featurename:netfx3 /all /source:<drive with the installation disk>:\sources\sxs

For example, if you have the disk in the e: drive, enter:

dism /online /enable-feature /featurename:netfx3 /all /source:e:\sources\sxs

Command for Windows Server 2012

3. Press enter and you'll see a confirmation message:

Confirmation message
4. If you were installing SQL Server and this problem stopped it, cancel the installation and start over again. If you don't, the installation will be completed with several errors.

Friday, January 23, 2015

Windows 10 and why Microsoft is getting better

Windows 10 logo
A couple of days ago Windows 10 was presented. It is interesting to think that Microsoft is getting better with the time. Actually, my impression was that Windows 10 is one of the checkpoints of the path of innovation that Microsoft has taken over the last few years. Whether we like it or not, this company is taking important steps and sometimes is even leading the innovation in the industry. I don't say Apple is not the king of the sector, but I think that since Satya Nadella is in charge, some things have changed for the better. But let's take a look at the highlights of yesterday's presentation:

Microsoft HoloLens: This was the most impressive part of the presentation. And maybe it's a step forward to the wide use of holograms.

Hololens

Closing the gap between PC and mobile devices: Microsoft is working very hard on this. Windows 8 was the first approach and I think it was not the best. The return of the Start button is a plus. They shouldn't have gotten rid of it in the first place. Also, the features to switch from Desktop to Mobile almost instantly are what you would have expected from Windows 8 in the first place, but we'll have to see how it works in our hands.

Universal apps: Microsoft dominates the PC market almost completely. The problem is that they can't take all that huge community experience to the mobile world. This might be the beginning of that process, but I must admit I'm a little skeptic. However, the decision of opening .NET and Visual Studio Community Edition are big steps towards the cross-platform development.

Universal apps
Spartan: Internet Explorer is bad. It's so bad that they needed desperately to kill it. At last, they understood it. This is one of the things I'm waiting for. I want to try Spartan!

I didn't mention Cortana, the gaming capacities and much more that was presented by Microsoft, but I think these are the key features that will give Microsoft an edge against the competitors. I never though I would say this, but Microsoft may be taking the leadership in the innovation race if they deliver all they are promising. And if you want to try Windows 10 by yourself, download the Technical Preview. It doesn't have some features yet, like the new browser Spartan, but at least you'll get an idea of what's coming.

Thursday, January 22, 2015

The Mobile Web will ignite its best in 2015

Over the past few years an enormous shift has been observed in consumer behavior and the way they are using mobile phones. For a while, it was a very common practice to think that mobile web experience is secondary to having an app. As the world of rich mobile applications gained momentum, the majority of online players rushed toward creating enthralling apps, believing that they will help them earn a larger legion of fans. Although, there are apps which performed amazingly well in the market to make customers lives better, but it's the mobile web which is always with people with no extra work ( as you don't need to download anything). It's native to Smartphones, which isn't the case with mobile apps.

Not too surprisingly, the growth of mobile web is prominent and it will become bigger and bigger. According to the People's Web Report, 25% of the customers spend around more than 6 hours each day on the mobile web, while 7% spend for more than 12 hours. These are clear indications of how people around the world seek information by pursuing mobile web only. This increase in time and the fundamental shift in the user behavior are the biggest driving sources behind the needs for online companies to preserve their strong online presence.
The Mobile Web will ignite its best in 2015

Mobile Web usage has become more prominent from the past few years

It is quite interesting to know how content consumption has been changed from the past few years. Smartphones media has gradually increased as compared to the desktop and will become greater in the near future.  Most of the visitors search websites through mobile, so it's important to make the mobile web as a part of business strategy. Not only this, but marketers also need to continuously develop their understanding of the consumer behavior and optimize the website accordingly.

“Mobile First” philosophy can have several dimensions to the retailers, but the general idea is to get the hold on where searches and visitors are, businesses must also be there. This highlights the idea of having a reliable cross-platform strategy from the very beginning.

While there are millions of apps floating in the ocean of Google Play Store, the reports generated by Google's Our Mobile Planet Data, an average Smartphone user only downloads 26 apps, so from where does the traffic coming from?  The data generated by around 5 million business websites highlights that the amount of traffic has been increasing continuously on a per site basis. Further, as per the reports generated by Quantcast Data 24% of the mobile views is coming from in-app browsers running Facebook or Tweeter, while 76% is coming from mobile browsers.

Now what does this mean for app-based startups? Is a single mobile app is all enough to garner the attention of your customers? To answer this question we can better analyze the data provided by SimilarWeb  from June 2014 to November 2014, highlighting the significance of mobile web in the year 2015. The results clearly show that mobile websites will remain important and the release of apps might result in the reduction of traffic, for better or worse. The research also points out some crucial differences between the user engagement between websites browsed through mobile and desktop.

First of all, the traffic data shown by top search engines in the US show that a substantial amount of their traffic comes only through mobile devices. According to Google, almost half of their traffic came from mobile from June to November 2014, 52% comprised of desktop and 48% of mobile. However, by the end of November, mobile traffic leapfrogged desktop, clearly specifying the turning point on the way mobile dominates Google.

However, for Bing, there aren't significant differences in the way mobile visits are done, with 33% of mobile visits against 67% coming from desktop. But for Google, the share of mobile access has remained quite impressive and it is all set to increase in the near future.

Owing to the steady growth of mobile web and the way it influences the user engagement, it can be said that- mobile websites are great in the way they help businesses to connect with their customers in a quick and focused way. For this, it needs to be to-the-point optimized, and lucid.

As a company, you need to go all out to reach where your customers are. Sometimes, it's through a native app, but most often you've got to connect with customers through email, text messages, or through any other social media channel. To do this you need the mobile web. Otherwise, you'll be left with only an app- with no certainties.

About the author: Lucie Kruger is an app developer working with Mobiers  Ltd. You can contact her in order to hire Android app programmers to avail the highly functional mobile app solutions.

Tuesday, January 20, 2015

Android Studio 1.0 : Things App Developers Can Expect

Buoyed up by the success of Android Studio, released by Google in 2013, the company is now all set to offer Android Studio 1.0 to make the app development process easier, faster and better. Android Studio is basically an IDE based ( Integrated Development Environment) made available for free by Google to make Android developers more agile and productive.

Based on IntelliJ IDEA JAVA IDE, Android 1.0 is now available to download from the official Android Developers website. Also, the talks are already on that just like the Chrome release channels, Android Studio will continue receiving updates across multiple release channel partners including: Stable, Beta, Dev, and Canary. These release channels will prove to be a great help for developers in terms of  latest features and options that make Android programming easy and fast.

As Google's first stable release, Android 1.0 is considered to be a monumental effort that aims to provide a better substitute of Eclipse environment, which is quite complicated and cluttered with too many modules and extensions. Google's primary objective with the Android Studio 1.0 is to provide a much improved application development environment with all the bells and whistles to facilitate a highly streamlined development process accompanied by solid OS mobile environment.

Newest Features and Improvements 

Android Studio 1.0 is coming along with a latest set of features and improvements that are sure to provide developers an added edge. The version includes a great deal of features and some of them are worth mentioning such as Intelligent code editing, tools for designing, a better user interface, performance analysis and more.

Before the advent of Android Studio, developers had to use Eclipse IDE and set up the Android SDK along with the other pieces of needed software to perform the development process, which wasn't difficult but a bit time consuming process. But, with Android Studio 1.0 developers can focus more on core development as it simplifies the process of writing, managing, and building apps.

The biggest feature that Android Studio supports is the first-run setup wizard and code templates that allow developers keep producing creative results with minimal efforts. It is also extremely helpful at the time of importing Android code from other applications. As mentioned above, the IDE comes packed with IntelliJ code completion, re factoring, code evaluation and analysis tools.  Android Studio 1.0 might prove fascinating for Eclipse users simply because it is more responsive and demands less computing power than Eclipse.

Secondly, Android Studio 1.0 allows you conveniently handle and manage string translations for a variety of apps you are using. One can easily extract and analyze all the complicated strings in any project. In addition to this, Android Studio 1.0 also gives you facility to edit and preview your Android layouts for a variety of screen sizes, behaviors, languages, and even API versions. Also, the latest Android Studio is also very much compatible across a variety of new hardware platforms that further strengthen the development process. The IDE is designed in such a way that it provides a fine-tuned experience and an optimum set of tools, depending on the orientation and nature of the OS application- from old devices to Android wear and TV, Android Auto and even Google glasses.

The device type and form factors are strategically integrated to ensure a consistent interface and experience as well as debugging with the help of a high performing Virtual Device Manager and emulator. Plus, with Apache Maven, there is no need to depend on the complications thrown by the dependency management.

Also, Android Studio 1.0 also includes a tool known as Memory Monitor. It's a performance evaluating tool that displays the overall usage of your app over time, so that you can plan better approaches to increase the performance of your app.

Android Studio also features a Gradle-based build system that ensures a better level of flexibility and extensibility and allows developers develop applications from within and outside the IDE. Not only this, Android Studio has also been integrated with Google Cloud Platform, allowing developers create backend features and services effectively.

All this and much more comes along with Android Studio 1.0. So, stop battling with Eclipse and better go for Android Studio 1.0 to increase your level of performance and development efficiency.

About the author: Addison Cohen is an application developer for Appsted Ltd, a mobile application development company. He loves sharing latest information on mobile technology.

Monday, January 19, 2015

How to check the command history in Linux

When you are working with Linux it is always useful to track your own actions and even someone else's actions in the terminal. So, here are a few commands to make our life a little bit easier.


Check your own command history

This is the easiest. Just open a terminal and enter: history

You should see something like this:
Command history

Look for entries that contain an specific command

If you need to look for specific commands, enter this in the terminal: history | grep <search_key>

For example, to look for entries that contain the 'sudo' command:

history | grep sudo

The result of that command will be something like this:

sudo command history

Check the 'sudo' operations of another user

Sometimes it's important to trace the actions of another user. Here's a way to do it. Open the terminal and enter: tail /var/log/auth.log | grep <user_name>

For example: tail /var/log/auth.log | grep user2

You should see something like this:

su commands from another user

Although they are simple, these 3 commands can help you a lot when you are working with Linux. Have fun!

Thursday, January 15, 2015

Quick tip: How to create files with a customized size in Windows

Here's a super quick tip. When testing, I usually need files, for example, to be uploaded to a website. A couple of days ago I needed to test a section of a website to upload files. The section only admitted files of 20 MB or less, so finding a .txt of more than 20 MB was not easy. So I solved it this way:

1. Open a command line with administrative privileges
CMD administrative privileges

2. Enter the following command:

fsutil file <path to the file>\newFile <size in bytes>

For example:

fsutil file createnew e:\something.txt 9000000

That will create a text file called something.txt with a size of approximately 9 MB.
New created file
The interesting part is that you can actually create any kind of file by changing the extension. I'll create an .exe file with this command:

fsutil file createnew e:\exeFile.exe 9000000

New exe file

I hope this is useful for somebody!

Wednesday, January 14, 2015

Product Variations- A WooCommerce feature you'd love to use for your e-store

A WooCommerce feature you'd love to use for your e-store
E-Commerce has undoubtedly become one of the most competitive fields of business. If you are about to delve into the world of e-business then ensure to be well acquainted with all the negatives and positives that the industry has in store for you. Simply possessing a fully-functional e-store won't aid you in reaching out to a wider group of targeted audience. You need to add an 'icing on the cake' in order to stand out from your online competitors. Once such approach is to offer variations of a specific product, based on price, available stock quantity and much more. If you've enabled WooCommerce support for your e-store then there is a Product Variations feature which will serve you with this kind of flexibility. I've written this to make you familiar with some interesting insights on this cool and trendy WooCommerce feature which has already started gaining grounds in the world of e-commerce.

Why add variations to products available in your e-store?

Different people have different choices. As an online merchant, you can take advantage of this fact and hence offer variations for your e-store products. For example, if you are selling t-shirts, then you can offer variations in terms of t-shirt sizes, colors, fabric, stock quantity and a lot more.

An outline on how WooCommerce 'Product Variations' feature works

Mentioned below is a step-by-step guideline on offering customers the flexibility to choose from a range of variations available for specific products.

Step 1- Set the product type

Go to your WooCommerce dashboard-> Products-> Add New Product and select the product type as 'Variable' from the available drop-down. On making this selection, the interface would get changed as shown in the below screen-shot:


Step 2- Define attributes for the variable product

Once you're done with defining the variable product, go to 'Attributes' tab under Products option on your WooCommerce dashboard and define specific attributes for the respective product. You can either opt for setting the global attributes or choose to add some custom ones which are related to your variable product. The screen for this will look like:


Here, all the values assigned to attributes for the variable product will become product options for the user in the front-end. Also, ensure to select the 'Variation' checkbox for each attribute. Doing this will inform WooCommerce that the defined attributes are applicable just to the variations.

Step 3- Add variations for the product

After defining the attributes, it’s time to begin the addition of variations. For this, go to WooCommerce dashboard-> Product-> Variations and click on the 'Add Variation' button. On hitting this button, a brand new blank row will appear, allowing you to input the data for the specific variation available for the chosen product. Here is a list of few details that can be assigned to each variation:

- Stock Quantity- Here, you may either input the value for stock available for the respective variation or may leave it blank to fetch the value assigned to the variable product.

- Dimensions- Here, you may either input the dimensions for the variation or may leave it blank to fetch the value assigned to the variable product.

- Weight- Here, you may either input the weight for the variation or may leave it blank to fetch the value assigned to the variable product.

- Price- Here, you need to input a unique 'Basic/Regular' price for the variation.

- Sales Price- Here, you need to input a unique 'Selling Price' for the variation.

- Downloadable check box- Select it in case the variation is a downloadable product. Here, you can even choose to input the file URL along with the permissible download attempts.

- Shipping class- You can either keep it similar to the shipping class defined for the variable product or customize it as per your preference.

- Tax class- You can either keep it similar to the tax class defined for the variable product or customize it in case you are offering variations on an international basis. 
The screen-shot for this step is displayed below:


With that you're done with offering variations for different e-store products.

Wrapping it all up

Product variations have always appeared tempting to customers. As an e-store owner, leveraging 'Product Variations' feature of WooCommerce will aid you in wooing the targeted customers instantly.

About Author: Emily Heming is a professional WordPress developer for a leading Photoshop to Wordpress conversion company. She also provides conversion services like HTML to WordPress theme and many more.

Tuesday, January 13, 2015

Top 5 Linux distros to be released in 2015

Linux has great advantages for Enterprise usage, but it also has weaknesses in the Desktop side and almost no presence in the mobile side (with the honorable exception of Ubuntu Touch). However, I think everyone who likes this great OS are expecting more from it this year. So, here's a list of distros that, in my opinion, will be interesting to try in 2015:

1. elementary OS Freya

Release date: When it's ready (unknown)
Website: http://elementaryos.org/journal

Elementary OS Freya

As a big fan of elementary OS, I've been waiting for this since it was announced. However, this project has had a lot of delays and I'm not sure if we will see it this year. However, there's some hope as the Beta 1 is already available. You can try it here.

2. Ubuntu 15.04

Release date: 4/23/2015
Website: http://www.ubuntu.com/

Ubuntu 15.04 release

Ubuntu has the merit to introduce common users to the Linux world. In my opinion, it's the best attempt to make a usable version of Linux for desktop at a level close to the commercial software. I think Unity is just fine, but it could be enhanced in a lot of ways. Try the latest Beta here.

3. Fedora 22

Release date: 05/19/2015
Website: https://getfedora.org/

Fedora

Fedora has a history of innovation and also it is famous for being used by Linux Torvalds in all his machines. Although it is not as popular as other distros, this will be worth checking out in 2015.

4. SteamOS

Release date: To be announced on 2015
Website: http://store.steampowered.com/livingroom/SteamOS/

Steam OS

This is interesting. This is a Linux distro developed by Valve and it specialized on video games. How cool is that? It will be available only for Steam Machines, a kind of computers built specifically for video games. This could mean the definitive jump for Linux to the gamer world.

5. Evolve OS

Release date: Unknown (let's hope we have something in 2015)
Website: https://evolve-os.com/

Evolve OS

This is interesting. elementary OS has an Apple flavor, and this distro has a Chromebook flavor. This brings the simplicity of Chrome OS with the Budgie desktop. It's still in an early development phase, but it surely will attract a lot of attention when the final version is released. However, you can try the alpha version here.

Sunday, January 11, 2015

How to install dependencies in the local Maven repository

Maven is an interesting tool to manage software projects. I already mentioned it in another article. Also in that article, I mentioned the way to add dependencies. Most of them can be found in the official Maven repository, but what if you need a dependency that is not there? Then you need to manually install that dependency in the local Maven repository for an offline access. To do that, follow these steps:

1. Get the dependency file. For example, the java library to manage SQL Server operations. You can download it here.

2. Place the file somewhere. For example:

Dependency folder
3. Make sure that Maven is installed correctly and that it is added to the System path. Now, open a command line console and enter the following line:

mvn install:install-file -Dfile=C:\dependecy\sqljdbc41.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc41 -Dversion=4.1 -Dpackaging=jar

Of course, I'm using the path where I placed the .jar file.
Command to install dependency
After that, you should see something like this, confirming that the dependency was successfully installed:
Dependency installed
Now, to use the dependency in your project, just add it to the pom.xml as you would normally do:

<dependency>
  <groupId>com.microsoft.sqlserver</groupId>
  <artifactId>sqljdbc41</artifactId>
  <version>4.1</version>
</dependency>

I hope this information is useful!

Friday, January 9, 2015

Solution to: Failed to enumerate objects in the container. Access is denied

Here's the scenario: Imagine that you have a folder that contains a lot of files (e.g., thousands of images). Now, for whatever reason, you need to change the permissions for the whole folder, but when you try it you get this error:

Failed to enumerate objects in the container. Access is denied

The solution could be simple: you could access the folder and change the permissions of each object, one by one. The problem comes when you have thousands of files. I had this problem when I reinstalled my OS. I had a folder with many private documents, and when I tried to change the permissions I found that the files kept the permissions from my user of the former OS. So, here's the solution:

1. Open a command line console with administrative privileges.
2. Enter the following command:

takeown /f folderPath /r /d y

For example: takeown /f E:\testools /r /d y

This will change the owner of the folder and every file inside.

3. Once you enter that, you'll see something like this:
Take ownership
You did it!! Now you can recover that bunch of files and change the permissions as you want.

Thursday, January 8, 2015

How to list the contents of a folder in Windows

Here's a simple tip. maybe you'll need this some day, especially when you want to do an "index" for some folder in a simple text file. So, here's how to do it:

I'm going to use a concrete example for this, but of course you can adapt it to your necessities:

I want to list the contents of the this folder: 
Folder with files
1. Open a Command Line console.
2. Go to the folder with the contents you want to list.
3. Enter the following command:

dir > folder_contents.txt

4. Check the folder again. You'll see a new text file called folder_contents.txt. If you open it, you'll have what you wanted:
Folder contents

Folder contents in a text file
5. And that's it! As a final tip, you can specify the place where the text file will be created. For example:

dir > C:\textFiles\folder_contents.txt