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
# If you are looking for the current User's infos, the one who's currently connected : | |
final String userLogin = SecurityUtils.getCurrentUserLogin(); | |
will get you, by definition, the current user login, then : | |
Optional<User> currentUser = userRepository.findOneByLogin(userLogin); | |
will get you the entity User linked to the login, from which you can access all information with | |
currentUser.get().getEmail() for example |
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
First inject Principal Service in your component | |
this.principal.identity().then((account) => { | |
// get current Account | |
this.currentAccount = account; | |
// get a specific field from account | |
const field = this.currentAccount.field; | |
//call your get method | |
this.getMethod(field); | |
}); |
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
version: "3" | |
services: | |
zookeeper: # the configuration manager | |
hostname: zookeeper | |
container_name: zookeeper | |
image: 'bitnami/zookeeper:latest' | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes | |
nifi: | |
image: apache/nifi:latest |
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 com.tekraze.sparkhipster.config; | |
import org.apache.spark.SparkConf; | |
import org.apache.spark.api.java.JavaSparkContext; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.context.annotation.Bean; | |
import org.apache.spark.sql.SparkSession; |
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
version: "2.2" | |
services: | |
master: | |
image: gettyimages/spark | |
command: bin/spark-class org.apache.spark.deploy.master.Master -h master | |
hostname: master | |
environment: | |
MASTER: spark://master:7077 | |
SPARK_CONF_DIR: /conf | |
SPARK_PUBLIC_DNS: localhost |
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
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-core --> | |
<dependency> | |
<groupId>org.apache.spark</groupId> | |
<artifactId>spark-core_2.11</artifactId> | |
<version>2.3.3</version> | |
<exclusions> | |
<exclusion> | |
<groupId>org.slf4j</groupId> | |
<artifactId>slf4j-log4j12</artifactId> | |
</exclusion> |
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
I had the same problem when playing a MP4 video, totem/gnome-videos displays a purplish corrupted video output and I have done the following: | |
From the terminal sudo apt-get remove gstreamer1.0-vaapi | |
I have done a test and yes, the problem has been fixed now I can see the video correctly. | |
So the problem is gstreamer1.0-vaapi | |
Best Regards, |
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
// Required for Http Request and json management for credentials | |
HttpTransport httpTransport = new NetHttpTransport(); | |
JacksonFactory jsonFactory = new JacksonFactory(); | |
// Go to the Google API Console, open your application's | |
// credentials page, and copy the client ID and client secret. | |
// Then paste them into the following code. | |
String clientId = "YOUR_CLIENT_ID"; | |
String clientSecret = "YOUR_CLIENT_SECRET"; |
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
Url imageUrl = new Url("https://site.com/image.jpeg"); // Sample url, replace with yours | |
String destinationFile = "sample.jpg"; | |
/*******************Multipart Upload Method********************************* | |
** To resources like minio or DB | |
***************************************************************************/ | |
/******** | |
* Step 1 |
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
String completeProfileDetailsUrl = "https://api.linkedin.com/v1/people/~:" + | |
"(id,industry,summary,specialties,headline,public-profile-url," + | |
"first-name,last-name," + | |
"positions:(id,title,summary,start-date,end-date,is-current," + | |
"company:(id,name,type,size,industry,ticker))," + | |
"educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes)," + | |
"interests," + | |
"date-of-birth," + | |
"picture-urls::(original)," + | |
"languages:(id,language:(name),proficiency:(level,name))," + |
OlderNewer