This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT path_overlap_id, overlap_geom, ST_Length(overlap_geom::geography) overlap_length, (ST_Length(overlap_geom::geography)/compare_length)*100 as overlap_percent | |
FROM ( | |
SELECT po.path_overlap_id, | |
CASE WHEN po.bus_sub_path_id IS NULL AND po.other_sub_path_id IS NULL THEN | |
-- WHEN INTERSECT BUS AND BUS | |
ST_AsText(ST_LineMerge(ST_CollectionExtract( | |
ST_Intersection(ST_Buffer( | |
CASE po.path_section WHEN 'D' THEN ST_SetSRID(bp_a.geom_diff, 4326) | |
ELSE ST_SetSRID(bp_a.geom, 4326) | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public UserUnique CreateUserUniqueIfNotExisted(CustomerInsight_DBEntities refDb, Dictionary<int, UserUnique> existedUserUnique) | |
{ | |
UserUnique tmpUu; | |
if (!existedUserUnique.TryGetValue(this.user_unique_id, out tmpUu)) | |
{ | |
tmpUu = UserUnique.CreateUserUniqueFromUui(this.user_unique_id, refDb); | |
existedUserUnique.Add(tmpUu.user_unique_id, tmpUu); | |
} | |
return tmpUu; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Request> | |
<Source> | |
<RequestorID Client="15858" EMailAddress="[email protected]" Password="2KS0JPZT5O"/> | |
<RequestorPreferences Currency="USD" Country="TW"> | |
<RequestMode>SYNCHRONOUS</RequestMode> | |
</RequestorPreferences> | |
</Source> | |
<RequestDetails> | |
<SearchHotelPriceRequest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. set Listener for each filter | |
$("#pokemonTypeFilter").on('change', function(){ | |
var filterPokemonType = this.value; | |
var filterPokemonAtk = $("#pokemonAtkFilter").val(); | |
var filterPokemon = filterPokemonByTypeAndMinAtk(allPokemons, filterPokemonType, filterPokemonAtk); | |
renderPokemonList(filterPokemon); | |
}); | |
$("#pokemonAtkFilter").on('keyup', function(){ | |
var filterPokemonAtk = this.value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2. set render function | |
var renderPokemonList = function(filterPokemon) { | |
$("#filterPokemonCount").html(filterPokemon.length); | |
var liStrings = filterPokemon.map(function (item) { | |
return "<li>" + item.name + " (Atk: " + item.attack + ", Def: " + item.defense + ")</li>"; | |
}); | |
$("#pokemonListUl").html(liStrings); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. set Reducer function to accept store.dispatch() | |
var reducer = function (state, action) { | |
var newState = state; | |
if (typeof state === 'undefined') { | |
return { | |
pokemonType: null, | |
pokemonAtk: null | |
}; | |
} | |
switch (action.type) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3. set render function | |
var render = function() { | |
var filterPokemonType = store.getState().pokemonType; | |
var filterPokemonAtk = store.getState().pokemonAtk; | |
var filterPokemon = filterPokemonByTypeAndMinAtk(allPokemons, filterPokemonType, filterPokemonAtk); | |
ReactDOM.render( | |
<div> | |
<div>--- Total Filter Pokemon: {filterPokemon.length} ---</div> | |
<ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return <PokemonInfo pokemonDetail={item} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Result = React.createClass({ | |
render: function() { | |
return (<div> | |
<div>--- Total Filter Pokemon: {this.props.filterPokemon.length} ---</div> | |
<ul> | |
<li></li> {/* how each pokemon display */} | |
</ul> | |
</div>); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Pokedex = React.createClass({ | |
getInitialState: function() { // 1) Setup initial state | |
return { | |
filterPokemonType: null, | |
filterPokemonAtk: null, | |
}; | |
}, | |
filterPokemonByTypeAndMinAtk: function (allPokemons, filterPokemonType, filterPokemonAtk) { | |
// ... Filter function just like in jQuery | |
}, |
OlderNewer