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 scala.annotation.tailrec | |
import scala.collection.mutable.ListBuffer | |
case class Priceable(id: String,measure:String,value: Double) | |
val results=Seq( | |
Priceable("$APPL","PV",311.0), | |
Priceable("$APPL","Growth",3.0), | |
Priceable("$IBM","PV",100), | |
Priceable("$IBM","Growth",0.5), |
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 e.ename, e.sal, d.dname from emp e,dept d where e.sal in (select max(e.sal) from emp e group by deptno) and e.deptno=d.deptno |
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 empno, deptno, row_number() over (partition by deptno order by 1) sequence_num from scott.emp; |
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
input_records = LOAD 'hdfs://quickstart.cloudera:8020/user/cloudera/pig_word_count/input.txt' as(tweet_text:chararray); | |
filter_words = LOAD 'hdfs://quickstart.cloudera:8020/user/cloudera/pig_word_count/filter_words.txt' as (filter_word:chararray); | |
input_records = FOREACH input_records GENERATE REPLACE(tweet_text,'([^a-zA-Z\\s]+)',' ') as tweet_text; | |
tokenize_words = FOREACH input_records GENERATE flatten(TOKENIZE(LOWER(tweet_text))) as word; | |
--INEFFICIENT BUT NECCESSARY to print filtered_word | |
cleanedData = JOIN filter_words by LOWER((filter_word)) FULL, tokenize_words by LOWER(word); | |
--REMOVE NON MATCHIN WORDS EXCEPT THE ONE IN WHICH THE FILTER WORD IS NOT NULL | |
filtered_data = FILTER cleanedData by ((word IS NULL and filter_word IS NOT NULL ) or word matches LOWER(filter_word) ) ; | |
grouped_words = GROUP filtered_data by filter_word; | |
--GROUP THEM BY group key and only count when the word is not empty, Since null is not counted so it works |
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 static List<Movie> invokeRateLimitedFetch(List<SearchedMovie> searchedMovies,boolean saveFile, File file){ | |
List<Movie> movies=new ArrayList<>(); | |
Observable.zip(Observable.from(searchedMovies), | |
Observable.interval(2, TimeUnit.SECONDS), (obs,timer)->obs) | |
.doOnNext(item -> { | |
Movie movie = movieUtil.getMovieDetails(item.getId()); | |
movies.add(movie); | |
if(saveFile) { | |
writeRecordToFile(file, movie); |
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
/* | |
* Copyright 2014 Alex Curran | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 org.apache.chemistry.opencmis.client.api.*; | |
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl; | |
import org.apache.chemistry.opencmis.commons.SessionParameter; | |
import org.apache.chemistry.opencmis.commons.enums.BindingType; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.util.Calendar; | |
import java.util.HashMap; | |
import java.util.List; |
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
package com.blogspot.ramannanda.apps.simplyread.utils; | |
import android.content.Context; | |
import android.graphics.Typeface; | |
import android.renderscript.Font; | |
import android.util.Log; | |
import java.lang.reflect.Field; | |
public class TypefaceUtil { |
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
package com.blogspot.ramannanda.security.fortress; | |
import java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Set; | |
import oracle.adf.share.logging.ADFLogger; | |
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
package com.blogspot.ramannanda.demos.validationapp.view.backing; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
import javax.el.ELContext; | |
import javax.faces.context.FacesContext; |