Microsoft Azure Windows Server Open Port

Categories: Development Notes December 5th, 2015 11:20

Requirement:  open a given port so that it can be accessed from internet. 

Solution: 

1. login to the windows server:
Windows file wall setting:  Windows Firewall with advanced setting > Inbound Rules > Add new rule

2. Enable the port mapping/forwarding:
Azure dashboard: Setting > Endpoints > Add Endport

 

Getting all videos by user name using youtube data API V3

Categories: Development Notes; Tagged with: ; @ November 12th, 2015 22:32

I managed to retrieve all videos by user name using v2:

https://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?alt=json&start-index=1&max-results=50&v=2

I haven’t find an API to get all videos directly, however it can be done by two steps (thanks to http://stackoverflow.com/questions/22613903/youtube-api-v3-get-list-of-users-videos) :

Step 1: get the user’s relatedPlaylist (uploads) id by:

GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=GoogleDevelopers&key={YOUR_API_KEY}

Step 2: get all videos by the id retrieved in step 1:

GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UU_x5XG1OV2P6uZZ5FSM9Ttw&key={YOUR_API_KEY}

One line to share the current folder via HTTP

Categories: Python; Tagged with: ; @ November 7th, 2015 18:23
>python -m SimpleHTTPServer $PORT

Connecting to Azure Windows virtual machine from Mac

Categories: Development Notes; Tagged with: ; @ October 31st, 2015 17:00

Issue

“Cannot verify the identity of the computer that you want to connect to” when I trying to remote login to my Azure virtual machine using ‘Microsoft Remote Desktop Connection Client for Mac 2.1.1’

Solution
You may try another client –  Microsoft Remote Desktop’ from iTunes 

 

Using Event with Polymer

Categories: HTML5; Tagged with: ; @ October 15th, 2015 22:26

Dispatching Event:

<link rel="import" href="../bower_components/polymer/polymer.html" />
<link rel="import" href="../bower_components/iron-icons/iron-icons.html" >
<link rel="import" href="../bower_components/paper-button/paper-button.html" />

<dom-module id="item-detail">
    <template>
        <div id="container">
            <h3>{{item_id}}</h3>
        </div>
        <paper-button on-tap="onAddToCart"><iron-icon icon="icons:shopping-cart"></iron-icon>AddToCart</paper-button>
    </template>

    <script>
        Polymer({
            is: 'item-detail',

            properties: {
                item_id: {
                    type:Number,
                    value:-1
                }
            },
            onAddToCart: function(e) {
                console.log('adding...');
                this.fire('eventAddToCart', {item_id: this.item_id});
            }
        });
    </script>
</dom-module>

Event Listener:

<link rel="import" href="bower_components/polymer/polymer.html" />
<link rel="import" href="element/item-detail.html">

<dom-module id="main-app">
    <template>
        <item-detail id="item_detail" item_id="{{current_detail_id}}"></
    </template>
    <script>
        Polymer({
            is: 'main-app',

            listeners: {
                'item_detail.eventAddToCart': 'onAddToCart'
            },

            onAddToCart: function(e) {
                console.log('Event received' + e.detail.item_id);
                // this.addToCart(e.detail.item_id);
            }
        });
    </script>
</dom-module>

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.