SQL和資料庫設計A-#Z™:學習 #MS #SQL #Server + #PostgreSQL

想要進入資料科學與資料分析領域,很難不會接觸到資料庫與 SQL 這個查詢語言,但你真的了解SQL 資料庫嗎? …

Source: SQL和資料庫設計A-Z™:學習 MS SQL Server + PostgreSQL

Python完整中文課程:透過實作 6 個 APP 快速入門

想要把一門程式設計語言學好的方法有很多種,有些書籍或是課程是以基本語法入門,或是也有些以實作一個人機介面程式(…

Source: Python完整中文課程:透過實作 6 個 APP 快速入門

Closed [Mail-for-Good] Create barkinet

Create barkinet
By barkinet
Assigned to barkinet

$(‘.hidden-code’).click(function(e) {
e.preventDefault();
$(this).children(‘.gist’).slideToggle();
});

var originalText;
$(‘.example-grid’).children().hover(
function() {
originalText = $(this).text();
$(this).html($(this).width()+’px’);
},
function() {
$(this).html(originalText);
}
);
// find close to coordinates

function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(UserLocation);

} else {
// loc = “Geolocation is not supported by this browser.”;
NearestCity(38.8951, -77.0367);
}
}
getLocation();

// Callback function for asynchronous call to HTML5 geolocation
function UserLocation(position) {
NearestCity(position.coords.latitude, position.coords.longitude);
}

// Convert Degress to Radians
function Deg2Rad(deg) {
return deg * Math.PI / 180;
}

function PythagorasEquirectangular(lat1, lon1, lat2, lon2) {
lat1 = Deg2Rad(lat1);
lat2 = Deg2Rad(lat2);
lon1 = Deg2Rad(lon1);
lon2 = Deg2Rad(lon2);
var R = 6371; // km
var x = (lon2 – lon1) * Math.cos((lat1 + lat2) / 2);
var y = (lat2 – lat1);
var d = Math.sqrt(x * x + y * y) * R;
return d;
}

var cities = [];
var cityNames = [];

$.getJSON(‘assets/json/campsites2.json’).then(function(data) {
data.forEach(function(loc) {
const coordString = loc.coordinates;
let values = coordString.split(” “);

var lat = ConvertDMSToDD(parseFloat(values[0]));
var lng = ConvertDMSToDD(parseFloat(values[1]));
let coords = [loc.city, loc.state, loc.country, lat, lng];

cities.push(coords);

if(loc.state.length==0){
cityNames.push(loc.city+”, “+loc.country);
} else {
cityNames.push(loc.city+”, “+loc.state+”, “+loc.country);
}

});
});

function ConvertDMSToDD(degrees) {
var dd = degrees;

// if (direction == “S” || direction == “W”) {
// dd = dd * -1;
// } // Don’t do anything for N or E
return dd;
}

function NearestCity(latitude, longitude) {
var mindif = 100;
var closest = [];

for (index = 0; index < cities.length; ++index) {
var dif = PythagorasEquirectangular(latitude, longitude, cities[index][3], cities[index][4]);
if (dif < mindif) {
closest.push({index:index, dist:dif});
}
}

closest = closest.sort(function(a, b){
return a.dist – b.dist;
});

$.getJSON('assets/json/campsites2.json').then(function(data) {
$("#closeCamps").append(
`

The study groups nearest you:

`
);
for (let i = 0; i < closest.length; i++){
let loc = data[closest[i].index];
let img = loc.photoUrl || "http://ift.tt/2p1xKRP",
city = loc.city,
state = loc.state,
country = loc.country,
url = loc.url,
coords = loc.coordinates;
let location = '';
if(state.length==0){
location = city + ", " + country;
} else {
location = city + ", " + state + ", " + country;
}
$("#closeCamps").append(
`

`
);
}
});
}

//full list of locations
$.getJSON(‘assets/json/campsites2.json’).then(function(data) {

data.forEach(function(loc) {
const img = loc.photoUrl || “http://ift.tt/2p1xKRP”,
city = loc.city,
state = loc.state,
country = loc.country,
url = loc.url;
let location = ”;

if(state.length==0){
location = city + “, ” + country;
} else {
location = city + “, ” + state + “, ” + country;
}

$(“#camps”).append(
`

  • `
    );

    });
    });
    var typing_timer;
    //search
    $(‘#search’).on(‘keyup’, function () {
    var li = [];
    var valThis = this.value.toLowerCase();
    valThis = valThis.toLowerCase();
    valThis = valThis.replace(/\s+/g, ”);

    var searchFunc = function(){
    $(‘.city’).each(function() {
    var currentLiText = $(this).text(),
    showCurrentLi = ((currentLiText.toLowerCase()).replace(/\s+/g, ”)).indexOf(valThis) !== -1;
    $(this).parent().parent().toggle(showCurrentLi);

    if(showCurrentLi==true){
    li.push(showCurrentLi);

    }
    setTimeout(function(){
    $(‘.loader’).hide();
    }, 250);
    });
    var size = $(‘#camps’).find(‘li’).length;
    $(“#res”).html(li.length);
    }

    clearTimeout(this.typing_timer);

    this.typing_timer = setTimeout(searchFunc, 250)
    $(‘.loader’).show();

    });

    // responsive 16×9 iframe – restricted by parent’s width
    var resizeIframe = function() {
    $(‘.responsive-iframe iframe’).each(function(index, iframe) {
    var parentWidth = $(iframe).parent().width();
    $(iframe).width(parentWidth);
    $(iframe).height(parentWidth / 16 * 9);
    });
    };
    $(window).on(‘resize’, resizeIframe);
    resizeIframe();

    Labeled:

    April 21, 2017 at 04:20AM
    via GitHub http://ift.tt/2pJkXkM

    Closed [Mail-for-Good] Create barkinet

    Create barkinet
    By barkinet
    Assigned to barkinet

    $(‘.hidden-code’).click(function(e) {
    e.preventDefault();
    $(this).children(‘.gist’).slideToggle();
    });

    var originalText;
    $(‘.example-grid’).children().hover(
    function() {
    originalText = $(this).text();
    $(this).html($(this).width()+’px’);
    },
    function() {
    $(this).html(originalText);
    }
    );
    // find close to coordinates

    function getLocation() {
    if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(UserLocation);

    } else {
    // loc = “Geolocation is not supported by this browser.”;
    NearestCity(38.8951, -77.0367);
    }
    }
    getLocation();

    // Callback function for asynchronous call to HTML5 geolocation
    function UserLocation(position) {
    NearestCity(position.coords.latitude, position.coords.longitude);
    }

    // Convert Degress to Radians
    function Deg2Rad(deg) {
    return deg * Math.PI / 180;
    }

    function PythagorasEquirectangular(lat1, lon1, lat2, lon2) {
    lat1 = Deg2Rad(lat1);
    lat2 = Deg2Rad(lat2);
    lon1 = Deg2Rad(lon1);
    lon2 = Deg2Rad(lon2);
    var R = 6371; // km
    var x = (lon2 – lon1) * Math.cos((lat1 + lat2) / 2);
    var y = (lat2 – lat1);
    var d = Math.sqrt(x * x + y * y) * R;
    return d;
    }

    var cities = [];
    var cityNames = [];

    $.getJSON(‘assets/json/campsites2.json’).then(function(data) {
    data.forEach(function(loc) {
    const coordString = loc.coordinates;
    let values = coordString.split(” “);

    var lat = ConvertDMSToDD(parseFloat(values[0]));
    var lng = ConvertDMSToDD(parseFloat(values[1]));
    let coords = [loc.city, loc.state, loc.country, lat, lng];

    cities.push(coords);

    if(loc.state.length==0){
    cityNames.push(loc.city+”, “+loc.country);
    } else {
    cityNames.push(loc.city+”, “+loc.state+”, “+loc.country);
    }

    });
    });

    function ConvertDMSToDD(degrees) {
    var dd = degrees;

    // if (direction == “S” || direction == “W”) {
    // dd = dd * -1;
    // } // Don’t do anything for N or E
    return dd;
    }

    function NearestCity(latitude, longitude) {
    var mindif = 100;
    var closest = [];

    for (index = 0; index < cities.length; ++index) {
    var dif = PythagorasEquirectangular(latitude, longitude, cities[index][3], cities[index][4]);
    if (dif < mindif) {
    closest.push({index:index, dist:dif});
    }
    }

    closest = closest.sort(function(a, b){
    return a.dist – b.dist;
    });

    $.getJSON('assets/json/campsites2.json').then(function(data) {
    $("#closeCamps").append(
    `

    The study groups nearest you:

    `
    );
    for (let i = 0; i < closest.length; i++){
    let loc = data[closest[i].index];
    let img = loc.photoUrl || "http://ift.tt/2p1xKRP",
    city = loc.city,
    state = loc.state,
    country = loc.country,
    url = loc.url,
    coords = loc.coordinates;
    let location = '';
    if(state.length==0){
    location = city + ", " + country;
    } else {
    location = city + ", " + state + ", " + country;
    }
    $("#closeCamps").append(
    `

    `
    );
    }
    });
    }

    //full list of locations
    $.getJSON(‘assets/json/campsites2.json’).then(function(data) {

    data.forEach(function(loc) {
    const img = loc.photoUrl || “http://ift.tt/2p1xKRP”,
    city = loc.city,
    state = loc.state,
    country = loc.country,
    url = loc.url;
    let location = ”;

    if(state.length==0){
    location = city + “, ” + country;
    } else {
    location = city + “, ” + state + “, ” + country;
    }

    $(“#camps”).append(
    `

  • `
    );

    });
    });
    var typing_timer;
    //search
    $(‘#search’).on(‘keyup’, function () {
    var li = [];
    var valThis = this.value.toLowerCase();
    valThis = valThis.toLowerCase();
    valThis = valThis.replace(/\s+/g, ”);

    var searchFunc = function(){
    $(‘.city’).each(function() {
    var currentLiText = $(this).text(),
    showCurrentLi = ((currentLiText.toLowerCase()).replace(/\s+/g, ”)).indexOf(valThis) !== -1;
    $(this).parent().parent().toggle(showCurrentLi);

    if(showCurrentLi==true){
    li.push(showCurrentLi);

    }
    setTimeout(function(){
    $(‘.loader’).hide();
    }, 250);
    });
    var size = $(‘#camps’).find(‘li’).length;
    $(“#res”).html(li.length);
    }

    clearTimeout(this.typing_timer);

    this.typing_timer = setTimeout(searchFunc, 250)
    $(‘.loader’).show();

    });

    // responsive 16×9 iframe – restricted by parent’s width
    var resizeIframe = function() {
    $(‘.responsive-iframe iframe’).each(function(index, iframe) {
    var parentWidth = $(iframe).parent().width();
    $(iframe).width(parentWidth);
    $(iframe).height(parentWidth / 16 * 9);
    });
    };
    $(window).on(‘resize’, resizeIframe);
    resizeIframe();

    Labeled:

    April 21, 2017 at 04:20AM
    via GitHub http://ift.tt/2pJkXkM

    #Found #you… by @barkinet #fcc

    Meeting you was like a dream come true Spending every single moment with you Was like a beautiful fairytale Smiling and laughing with you made my day I didn’t know it before but now I do You …

    Source: Found you…

    #History #Repeating – #Ahead #of #French #Election #Facebook #Blocks 30,000 #Accounts…

    A report surfaces today that Facebook has shut down 30,000 user accounts from France. The French election is in 10 days and given the nature of Facebook’s political activity in shaping nation…

    Source: History Repeating – Ahead of French Election Facebook Blocks 30,000 Accounts…

    The American Civil War Begins

    This week marks the anniversary of the start of the Civil War. The bloodiest war in American history began on April 12, 1861, when Confederate forces, under the command of General P.G.T. Beauregard…

    Source: The American Civil War Begins