Crowdo (Referral Unique Code: ECF003282)

Why should I invest?

There are a number of reasons you may want to invest in an Offer: 1) To diversify your investment portfolio; 2) To make a return on your investment; 3) To help a friend launch their business; 4) To help small Malaysia businesses. Investors should implement a diversification strategy when building an investment portfolio. Diversification involves spreading your money across multiple investments and will give you, as an investor, greater peace of mind that your investments will sustain in adverse market conditions and cushion losses. However, it will not lessen all types of risk.

https://investment.crowdo.com/

Table To JSON and back to Table TSQL MSSQL

TSQL

CREATE TABLE #TBL_ADM_USER
( user_id INT,
user_name NVARCHAR(1000)
)

INSERT INTO #TBL_ADM_USER
VALUES (1,’NAME1′)
INSERT INTO #TBL_ADM_USER
VALUES (2,’NAME2′)
INSERT INTO #TBL_ADM_USER
VALUES (3,’NAME3′)

DECLARE @XML_STR AS NVARCHAR(MAX)
SET @XML_STR = (SELECT user_id, user_name
FROM #TBL_ADM_USER
FOR XML PATH (‘row’))

SET @XML_STR = ‘
‘ + @XML_STR + ‘
‘;

DECLARE @cars xml;
SET @cars = @XML_STR

DECLARE @json AS NVARCHAR(MAX)
SET @json = (
SELECT Stuff( –we want to snip out the leading comma
(SELECT TheLine from –this is to glue each row into a string
(SELECT ‘,
{‘+ –this is the start of the row, representing the row object in the JSON list
–the local-name(.) is an eXPath function that gives you the name of the node
Stuff((SELECT ‘,”‘+coalesce(b.c.value(‘local-name(.)’, ‘NVARCHAR(255)’),”)+'”:”‘+
b.c.value(‘text()[1]’,’NVARCHAR(MAX)’) +'”‘
— ‘text()[1]’ gives you the text contained in the node
from x.a.nodes(‘*’) b(c) –get the row XML and split it into each node
for xml path(”),TYPE).value(‘(./text())[1]’,’NVARCHAR(MAX)’)
,1,1,”)+’}’–remove the first comma
from @Cars.nodes(‘/root/*’) x(a) –get every row
) JSON(theLine) –each row
for xml path(”),TYPE).value(‘.’,’NVARCHAR(MAX)’ )
,1,1,”)–remove the first leading comma
)

SELECT @json
SELECT * INTO #TBL_JSON FROM parseJSON(@json)

SELECT * FROM #TBL_JSON

DECLARE @SQL_STR AS NVARCHAR(MAX)
SET @SQL_STR = ‘
Select parent_ID,’

CREATE TABLE #TMP_COLUMN
(
ID INT IDENTITY(1,1),
COLUMN_NAME VARCHAR(100)
)

INSERT INTO #TMP_COLUMN (COLUMN_NAME)
SELECT DISTINCT NAME FROM #TBL_JSON
WHERE NAME ‘-‘

DECLARE @START_COLUMN_ID AS INT, @END_COLUMN_ID AS INT
SET @START_COLUMN_ID = 1
SET @END_COLUMN_ID = (SELECT MAX(ID) FROM #TMP_COLUMN)
DECLARE @TBL_COL_NAME AS NVARCHAR(1000)
WHILE @START_COLUMN_ID 0
BEGIN
SELECT @index=0,
–find the next hex escape sequence
@escape=PATINDEX(‘%\x[0-9a-f][0-9a-f][0-9a-f][0-9a-f]%’, @token collate SQL_Latin1_General_CP850_Bin)
IF @escape>0 –if there is one
BEGIN
WHILE @index<4 –there are always four digits to a \x sequence
BEGIN
SELECT –determine its value
@result=@result+POWER(16, @index)
*(CHARINDEX(SUBSTRING(@token, @escape+2+3-@index, 1),
@characters)-1), @index=@index+1 ;

END
— and replace the hex sequence by its unicode value
SELECT @token=STUFF(@token, @escape, 6, NCHAR(@result))
END
END
–now store the string away
INSERT INTO @Strings (StringValue) SELECT @token
— and replace the string with a token
SELECT @JSON=STUFF(@json, @start, @end+1,
'@string'+CONVERT(NVARCHAR(5), @@identity))
END
— all strings are now removed. Now we find the first leaf.
WHILE 1=1 –forever until there is nothing more to do
BEGIN

SELECT @parent_ID=@parent_ID+1
–find the first object or list by looking for the open bracket
SELECT @FirstObject=PATINDEX('%[{[[]%', @json collate SQL_Latin1_General_CP850_Bin)–object or array
IF @FirstObject = 0 BREAK
IF (SUBSTRING(@json, @FirstObject, 1)='{')
SELECT @NextCloseDelimiterChar='}', @type='object'
ELSE
SELECT @NextCloseDelimiterChar=']', @type='array'
SELECT @OpenDelimiter=@firstObject
WHILE 1=1 –find the innermost object or list…
BEGIN
SELECT
@lenJSON=LEN(@JSON+'|')-1
–find the matching close-delimiter proceeding after the open-delimiter
SELECT
@NextCloseDelimiter=CHARINDEX(@NextCloseDelimiterChar, @json,
@OpenDelimiter+1)
–is there an intervening open-delimiter of either type
SELECT @NextOpenDelimiter=PATINDEX('%[{[[]%',
RIGHT(@json, @lenJSON-@OpenDelimiter)collate SQL_Latin1_General_CP850_Bin)–object
IF @NextOpenDelimiter=0
BREAK
SELECT @NextOpenDelimiter=@NextOpenDelimiter+@OpenDelimiter
IF @NextCloseDelimiter<@NextOpenDelimiter
BREAK
IF SUBSTRING(@json, @NextOpenDelimiter, 1)='{'
SELECT @NextCloseDelimiterChar='}', @type='object'
ELSE
SELECT @NextCloseDelimiterChar=']', @type='array'
SELECT @OpenDelimiter=@NextOpenDelimiter
END
—and parse out the list or name/value pairs
SELECT
@contents=SUBSTRING(@json, @OpenDelimiter+1,
@NextCloseDelimiter-@OpenDelimiter-1)
SELECT
@JSON=STUFF(@json, @OpenDelimiter,
@NextCloseDelimiter-@OpenDelimiter+1,
'@'+@type+CONVERT(NVARCHAR(5), @parent_ID))
WHILE (PATINDEX('%[A-Za-z0-9@+.e]%', @contents collate SQL_Latin1_General_CP850_Bin))0
BEGIN
IF @Type=’Object’ –it will be a 0-n list containing a string followed by a string, number,boolean, or null
BEGIN
SELECT
@SequenceNo=0,@end=CHARINDEX(‘:’, ‘ ‘+@contents)–if there is anything, it will be a string-based name.
SELECT @start=PATINDEX(‘%[^A-Za-z@][@]%’, ‘ ‘+@contents collate SQL_Latin1_General_CP850_Bin)–AAAAAAAA
SELECT @token=SUBSTRING(‘ ‘+@contents, @start+1, @End-@Start-1),
@endofname=PATINDEX(‘%[0-9]%’, @token collate SQL_Latin1_General_CP850_Bin),
@param=RIGHT(@token, LEN(@token)-@endofname+1)
SELECT
@token=LEFT(@token, @endofname-1),
@Contents=RIGHT(‘ ‘+@contents, LEN(‘ ‘+@contents+’|’)-@end-1)
SELECT @name=stringvalue FROM @strings
WHERE string_id=@param –fetch the name
END
ELSE
SELECT @Name=null,@SequenceNo=@SequenceNo+1
SELECT
@end=CHARINDEX(‘,’, @contents)– a string-token, object-token, list-token, number,boolean, or null
IF @end=0
SELECT @end=PATINDEX(‘%[A-Za-z0-9@+.e][^A-Za-z0-9@+.e]%’, @Contents+’ ‘ collate SQL_Latin1_General_CP850_Bin)
+1
SELECT
@start=PATINDEX(‘%[^A-Za-z0-9@+.e][A-Za-z0-9@+.e]%’, ‘ ‘+@contents collate SQL_Latin1_General_CP850_Bin)
–select @start,@end, LEN(@contents+’|’), @contents
SELECT
@Value=RTRIM(SUBSTRING(@contents, @start, @End-@Start)),
@Contents=RIGHT(@contents+’ ‘, LEN(@contents+’|’)-@end)
IF SUBSTRING(@value, 1, 7)=’@object’
INSERT INTO @hierarchy
(NAME, SequenceNo, parent_ID, StringValue, Object_ID, ValueType)
SELECT @name, @SequenceNo, @parent_ID, SUBSTRING(@value, 8, 5),
SUBSTRING(@value, 8, 5), ‘object’
ELSE
IF SUBSTRING(@value, 1, 6)=’@array’
INSERT INTO @hierarchy
(NAME, SequenceNo, parent_ID, StringValue, Object_ID, ValueType)
SELECT @name, @SequenceNo, @parent_ID, SUBSTRING(@value, 7, 5),
SUBSTRING(@value, 7, 5), ‘array’
ELSE
IF SUBSTRING(@value, 1, 7)=’@string’
INSERT INTO @hierarchy
(NAME, SequenceNo, parent_ID, StringValue, ValueType)
SELECT @name, @SequenceNo, @parent_ID, stringvalue, ‘string’
FROM @strings
WHERE string_id=SUBSTRING(@value, 8, 5)
ELSE
IF @value IN (‘true’, ‘false’)
INSERT INTO @hierarchy
(NAME, SequenceNo, parent_ID, StringValue, ValueType)
SELECT @name, @SequenceNo, @parent_ID, @value, ‘boolean’
ELSE
IF @value=’null’
INSERT INTO @hierarchy
(NAME, SequenceNo, parent_ID, StringValue, ValueType)
SELECT @name, @SequenceNo, @parent_ID, @value, ‘null’
ELSE
IF PATINDEX(‘%[^0-9]%’, @value collate SQL_Latin1_General_CP850_Bin)>0
INSERT INTO @hierarchy
(NAME, SequenceNo, parent_ID, StringValue, ValueType)
SELECT @name, @SequenceNo, @parent_ID, @value, ‘real’
ELSE
INSERT INTO @hierarchy
(NAME, SequenceNo, parent_ID, StringValue, ValueType)
SELECT @name, @SequenceNo, @parent_ID, @value, ‘int’
if @Contents=’ ‘ Select @SequenceNo=0
END
END
INSERT INTO @hierarchy (NAME, SequenceNo, parent_ID, StringValue, Object_ID, ValueType)
SELECT ‘-‘,1, NULL, ”, @parent_id-1, @type

RETURN
END

TSQL to rename and script new modified stored procedure

SELECT ‘EXEC SP_RENAME ”’ + name + ”’ , ”’ + ‘X_20170223_’ + name + ””
FROM sys.objects
WHERE type = ‘P’
and modify_date > ‘2016-09-09 16:37:38.913’
and name not like ‘X_%’
order by modify_date desc

SELECT M.definition
FROM sys.procedures P WITH(NOLOCK)
INNER JOIN sys.sql_modules M WITH(NOLOCK)ON M.object_id = P.object_id
WHERE EXISTS (SELECT name, create_date, modify_date
FROM sys.objects O
WHERE type = ‘P’
and modify_date > ‘2016-09-09 16:37:38.913’
and name not like ‘X_%’
AND O.name = P.name )

SQL 2014 dont have data tools

Download SQL Server Data Tools (SSDT)

What happened to SQL Server Data Tools in SQL Server 2014?

SQL Server Data Tools in SQL Server 2014I’ve seen this question a few times and it is something that can be very confusing: You’ve installed SQL 2014 (a full version, not Express) and selected all components, yet when you go to your SQL Server 2014 program group, you can’t find SQL Server Data Tools.

In all versions of SQL Server between 2005 and 2012, the IDE for Business Intelligence projects has been included as part of the SQL Server installation. Based on Visual Studio, it gives you the ability to create BI projects in the Visual Studio Environment. In SQL Server versions 2005 through 2008 R2, it was called Business Intelligence Development Studio (BIDS). In SQL Server 2012 it was renamed to SQL Server Data Tools (SSDT) but was basically the same thing.

For some inexplicable reason, in SQL Server 2014 Microsoft decided not to include SSDT as part of the normal SQL Server installation. It is now a separate download. What is even more confusing is that there are different downloads depending on what you already have. If you go to the SQL Server Data Tools download page on MSDN, there are several options for you to choose from.

http://www.sqlsolutionsgroup.com/sql-server-data-tools/

How to connect to TFS through authenticated Web Proxy

To fix this issue you need a custom proxy module that provides the credentials, so I created a simple DLL with this class:

using System;
using System.Net;

namespace Rido.AuthProxy
{
public class AuthProxyModule : IWebProxy
{

ICredentials crendential = new NetworkCredential(“proxy.user”, “password”);

public ICredentials Credentials
{
get
{
return crendential;
}
set
{
crendential = value;
}
}

public Uri GetProxy(Uri destination)
{
return new Uri(“http://proxy:8080&#8221;, UriKind.Absolute);
}

public bool IsBypassed(Uri host)
{
return host.IsLoopback;
}

}
}
You should copy this DLL to the %PROGRAMFILES\Microsoft Visual Studio 10.0\Common7\IDE folder, and update the devenv.exe.config file to include the module:

https://blogs.msdn.microsoft.com/rido/2010/05/06/how-to-connect-to-tfs-through-authenticated-web-proxy/

Debug cordova with visual studio code

Debug using Visual studio Code.

 

Installation Steps:

Open project folder and start set up the launch.JSON setting. Please follow the instruction here to set up the cordova  extension. https://github.com/Microsoft/vscode-cordova

  1. Click the debug icon in the View bar
  2. click the configure gear icon
  3. choose the Cordova debug environment.

The launch configuration file appears. It contains some default configurations

 

Now we need to include adb into your Variable Environment PATH on your Laptop.

Last but not list.. Please reboot you laptop. Then you are ready to debug..

 

https://github.com/Microsoft/vscode-cordova

http://blog.majcica.com/2016/04/07/visual-studio-code-behind-a-proxy/

https://blogs.msdn.microsoft.com/visualstudio/2016/01/28/apache-cordova-development-lands-on-visual-studio-code/

Turn Windows PC into a WiFi Hotspot using Internet Connection Sharing

In this post, we will see how to turn on Internet Connection Sharing & create a WiFi hotspot in Windows 10/8.1/8 using the netsh wlan utility, command prompt, and Wireless Hosted Network or using some free WiFi Hotspot Creator software.

I just bought a Nokia Lumia 920 Windows Phone and found that while downloading apps which were greater than 50MB in size, I either needed Wi-Fi connection or a 3G connection. I was on 2G and I did not have a wireless connection at home.

Turn Windows PC into WiFi Hotspot
While one could always use free WiFi Hotspot creator software like Baidu Wi-Fi Hotspot app, Connectify, Virtual Router Manager, MyPublicWiFi, Bzeek, WiFi Hotspot Creator, MyPublicWiFi, mSpot, etc, to create a WiFi hotspot, I wanted to create one natively in Windows 8/10.

The procedure for creating one on Windows 7 was different. When I tried to do it on my Windows 8 Dell laptop, I found that the settings to Create an ad hoc network via Network and Sharing Center did not exist. The only option then, I thought, seemed to be, by using the netsh utility.

Enable Internet Connection Sharing
To begin, first, make sure that the WiFi is set to ON. Then you will have to open a command prompt as an administrator. Open the WinX menu and select Command Prompt (Admin). The CMD window will open. Type the following and hit Enter:

netsh wlan set hostednetwork mode=allow ssid=DellNet key=asdfg12345
Here DellNet is the name I have chosen and asdfg12345 is the password I have chosen. This has to be at least 8 characters long. You can give your own name and select your own password.

Next, type the following in the CMD window and hit Enter:

netsh wlan start hostednetwork
4

What we have done is started the wireless Hosted Network.

The wireless Hosted Network is a WLAN feature supported on Windows 7, Windows Server 2008 R2 and later with the Wireless LAN Service installed. This feature implements two major functions:

Advt

^

The virtualization of a physical wireless adapter into more than one virtual wireless adapter sometimes referred to as Virtual Wi-Fi.
A software-based wireless access point (AP) sometimes referred to as a SoftAP that uses a designated virtual wireless adapter.
You can get more details about the Wireless Hosted Network and the netsh commands here on MSDN.

Create WiFi hotspot in Windows 10/8
Next, open Control Panel\All Control Panel Items\Network and Sharing Center. Windows 7 offers the Manage wireless networks link on the left side above Change adapter settings. Windows 8/10 does not.

1

Click on Change adapter settings. You will see all your Network Connections.

Create WiFi hotspot in Windows 8

You can see the newly created DellNet (Local Area Connections 12) here. Right-click on the connection you are currently using (in my case Ethernet) to connect to the Internet and select Properties.

connected-wifi

Click on the Sharing tab in the Ethernet Properties box and select Allow other network users to connect through this computer’s Internet connection. Under Home networking connection, from the drop down menu, I selected Local Area Connections 12 and clicked on OK.

That’s it!

You will have allowed Internet sharing and created a Wi-Fi hotspot of your Windows 8 laptop.

To confirm, I opened Settings on my Nokia Lumia 920, selected Wi-Fi, and was able to connect the phone to my laptop, using the set password.

wp8-wifi

Thus, I created WiFi hotspot in Windows and I was able to download large apps too on my Windows Phone.

See how to create a Mobile Hotspot in Windows 10, via its Settings.

http://www.thewindowsclub.com/enable-internet-sharing-wifi-hotspot-windows-8

http://security.baidu.co.th/en/wifi.php

Google Maps – Download areas and navigate offline

Download areas and navigate offline

If you’re going where the Internet is slow, mobile data is expensive, or you can’t get online, you can save an area from Google Maps to your phone or tablet and use it when you’re offline.

Note: Downloading offline areas isn’t available in some regions because of contractual limitations, language support, address formats, or other reasons.

ANDROID IPHONE & IPAD
Download an area to use offline
Note: You can store your offline areas on your device or an SD card. If you change the way you store your offline areas, you’ll have to download your offline areas again.

On your phone or tablet, open the Google Maps app Google Maps.
Make sure you’re connected to the Internet and signed in to Google Maps.
Search for a place, like San Francisco.
At the bottom, tap the name or address of the place. If you search for a place like a restaurant, tap More More.
Select Download Download.
Store offline areas to an SD card
Offline areas are downloaded on your phone or tablet’s internal storage by default, but you can download them on an SD card instead. If your device is on Android 6.0 or higher, you can only save an offline area to an SD card that’s configured for portable storage. Learn how to configure your SD card.

On your phone or tablet, insert an SD card.
Open the Google Maps app Google Maps.
In the top left, tap the Menu Menu and then Offline areas.
In the top right, tap Settings Settings.
Under “Storage preferences,” tap Device and then SD card.
Use offline areas
After you download an area, use the Google Maps app just like you normally would.

Get directions and see routes
Use navigation
Search for locations
If your Internet connection is slow or absent, you’ll see a lightning bolt and Google Maps will use your offline areas to give you directions.

Notes:

You can get driving directions offline, but not transit, bicycling, or walking directions. In your driving directions, you won’t have traffic info, alternate routes, or lane guidance. You also can’t modify routes like avoiding tolls or ferries.
To save cell data and battery life, use “Wi-Fi only” mode. In this mode, when you’re not connected to Wi-Fi, Google Maps will only use data from the offline areas that you’ve downloaded. Before you use this mode, make sure you download offline areas. To turn on this mode, open the Google Maps app Google Maps and then Menu Menu and then Settings and thennext to “Wi-Fi only,” turn the switch on.

https://support.google.com/maps/answer/6291838?co=GENIE.Platform%3DAndroid&hl=en&oco=0

jSignature

jSignature is a JavaScript widget (a jQuery plugin) that simplifies creation of a signature capture field in a browser window, allowing a user to draw a signature using mouse, pen, or finger.
  • Works in all mainstream browsers that support Canvas or Flash
  • Captures signatures as smooth vector images. (Yes, SVG is supported!)
  • Ingenious, super-efficient (i.e. not lagging) real-time curve smoothing.
  • Allows manipulation of signature strokes, like “Undo last stroke”
  • Automatically adapts to your page’s layout and colors.
  • Free and Open Source.

https://willowsystems.github.io/jSignature/#/about/