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
$scope.getData = function() { | |
var searchClient = dataClient.getSearchCheckin(angular.lowercase($scope.searchtext)); | |
searchClient.on('data', function(res) { | |
searchedCheckinarray = []; | |
categoryarray = []; | |
places = []; | |
citysearched = angular.lowercase($scope.searchtext); | |
$scope.row = false; //to hide suggestions | |
searchProcess(res); //to fetch the data and to mark it on map | |
}).on('error', function(err) { |
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 realtimeClient = dataClient.getLiveData(); | |
realtimeClient.on('data', function(res) { | |
streamProcess(res); //to fetch the data and to mark it on map | |
}).on('error', function(err) { | |
console.log("caught a stream error", err); | |
}); | |
function streamProcess(response) { | |
if (response._source.latitude != null && response._source.longitude != null) { // Check valid latitude-longitude. | |
var default_arr = helper.getMapArray(response._source); |
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
function dragProcess(response) { | |
if (response.hits) { | |
for (var i = 0; i < response.hits.hits.length; i++) { | |
if (response.hits.hits[i]._source) { | |
if (response.hits.hits[i]._source.latitude && response.hits.hits[i]._source.longitude) { | |
if (citysearched == response.hits.hits[i]._source.city) | |
continue; | |
var default_arr = helper.getMapArray(response.hits.hits[i]._source); | |
var specific_arr = [ | |
'src/assets/img/yellow_marker.png' |
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
$scope.searchquery = function() { | |
try { | |
//searchtext variable referred to the text in the search box | |
if ($scope.searchtext != null && $scope.searchtext.replace(/\s/g, '').length) { //to check if search text is null | |
$scope.activeContainer = 'active'; | |
var suggestClient = dataClient.getSuggestions($scope.searchtext); | |
suggestClient.on('data', function(resp) { | |
//$apply_solve | |
$timeout(function() { | |
$scope.row = true; |
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
<div class="row city-inside"> | |
<div class="input-container col-xs-12"> | |
<i class="fa fa-search input-icon"></i> | |
<input type="text" class="input col-xs-12" placeholder="Search City" ng-model="searchtext" | |
ng-keyup="searchquery()"/> | |
<a href="javascript:void(0);" class="input-button" ng-click="getData()"> Plot it </a> | |
</div> | |
</div> | |
<div class="col-xs-12 padding0 city-box" id="city-suggest" ng-show="row"> |
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
drop schema acad cascade; | |
create schema acad; | |
SET search_path TO acad; | |
create table Program( | |
ProgID varchar(2) primary key, | |
ProgName varchar(20) | |
); | |
create table Student( |
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
int * getBuckets(uint32_t key, struct Table *td) { | |
static int bucketID[TABLE_SIZE]; | |
uint32_t out; | |
MurmurHash3_x86_32((const void *)&key, sizeof(uint32_t), SEED, &out); //calculate the hash value for each subtables, | |
for (int i = 0; i < TABLE_SIZE; i++) { | |
if (td->subtables[i].buckets[out % SUBTABLE_SIZE].counter == 0) { | |
bucketID[i] = -1; | |
continue; | |
} | |
bucketID[i] = out % SUBTABLE_SIZE; // Then divide hash value by subtable size |
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
import java.util.*; | |
import java.lang.*; | |
class Main | |
{ | |
public static void main (String[] args) throws java.lang.Exception | |
{ | |
Scanner s=new Scanner(System.in); | |
int num = s.nextInt(); |
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 pipeline = Source({name:"kinesisstream").save({name:"appbaseapp") |
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 pipeline = Source({name:"kinesisstream"}) | |
pipeline = pipeline.transform("filename: "transformers/json_converter.js", namespace: "kinesis.appbase_test", debug: true") | |
pipeline.save({name:"appbaseapp", namespace:"test_123.appbase_test", debug:true}); |