Skip to content

Instantly share code, notes, and snippets.

$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) {
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);
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'
$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;
<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">
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(
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
@rishiloyola
rishiloyola / game.java
Created May 28, 2016 07:03
Games - How many games ( spoj question).
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();
var pipeline = Source({name:"kinesisstream").save({name:"appbaseapp")
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});