This file contains hidden or 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
| city,pop,state | |
| AGAWAM,15338,MA | |
| CUSHMAN,36963,MA | |
| BARRE,4546,MA | |
| BELCHERTOWN,10579,MA | |
| BLANDFORD,1240,MA | |
| BRIMFIELD,3706,MA | |
| CHESTER,1688,MA | |
| CHESTERFIELD,177,MA | |
| CHICOPEE,23396,MA |
This file contains hidden or 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
| val words = Array("one", "two", "two", "three", "three", "three") | |
| val wordPairsRDD = sc.parallelize(words).map(word => (word, 1)) | |
| val wordCountsWithGroup = wordPairsRDD | |
| .groupByKey() | |
| .map(t => (t._1, t._2.sum)) | |
| .collect() |
This file contains hidden or 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
| Ejercicio 3 | |
| scala> Seq(0,1,3,6,5,4,-1,2,1).sorted.reverse | |
| scala> Seq(0,1,3,6,5,4,-1,2,1).sortBy(_>_) | |
| Ejercicio 4 | |
| scala> Seq("a","a","v","v","b").groupBy(identity).mapValues(_.size) | |
| scala> Seq("a","a","v","v","b").groupBy( t=> t).mapValues(_.size) | |
| scala> Seq("a","a","v","v","b").groupBy(l => l).map(t => (t._1, t._2.length)) | |
This file contains hidden or 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
| def isPar(x: Int) = if(x % 2 == 0 ) true else false | |
| def positive(x: Int) = if(x > 0) true else false | |
| def ejercicio(size: Int, fn: Int => Boolean ) = { | |
| val list = genera(size) | |
| list.filter(fn) | |
| } | |
| def genera(size: Int) = { |
This file contains hidden or 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 { Observable } from 'rxjs/Observable'; | |
| import { Injectable } from '@angular/core'; | |
| import { HttpClient } from '@angular/common/http'; | |
| import 'rxjs/add/operator/map'; | |
| import { Film } from '../../model/Film'; | |
| /* | |
| Generated class for the NetflixProvider provider. | |
| See https://angular.io/guide/dependency-injection for more info on providers |
This file contains hidden or 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
| wget https://services.gradle.org/distributions/gradle-3.4.1-bin.zip | |
| sudo mkdir /opt/gradle | |
| sudo unzip -d /opt/gradle gradle-3.4.1-bin.zip | |
| export PATH=$PATH:/opt/gradle/gradle-3.4.1/bin | |
| gradle -v |
This file contains hidden or 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
| <!-- | |
| Licensed to the Apache Software Foundation (ASF) under one | |
| or more contributor license agreements. See the NOTICE file | |
| distributed with this work for additional information | |
| regarding copyright ownership. The ASF licenses this file | |
| to you 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 |
This file contains hidden or 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
| #!/bin/bash | |
| hiveDBName=testdbname; | |
| showcreate="show create table " | |
| showpartitions="show partitions " | |
| terminate=";" | |
| tables=`hive -e "use $hiveDBName;show tables;"` | |
| tab_list=`echo "${tables}"` | |
This file contains hidden or 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 { Observable } from 'rxjs/Observable'; | |
| import { Film } from './../model/film'; | |
| import { Injectable } from '@angular/core'; | |
| import { Http, Response } from '@angular/http'; | |
| import 'rxjs/add/operator/map'; | |
| /* | |
| Generated class for the Netflix provider. | |
| See https://angular.io/docs/ts/latest/guide/dependency-injection.html |
This file contains hidden or 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 org.apache.flink.quickstart; | |
| public class Picture { | |
| private String name; | |
| private String year; | |
| private String nominations; | |
| private String rating; | |
| private String duration; | |
| private String genre1, genre2; |
NewerOlder