View polkaDot.css
/**
* Polka dot
*/
body {
background: wheat;
background-image:
radial-gradient(salmon 20%, transparent 0),
radial-gradient(salmon 20%, transparent 0);
background-size: 30px 30px;
View followers.py
import time
import tweepy
auth = tweepy.OAuthHandler("", "")
auth.set_access_token("", "")
api = tweepy.API(auth)
ids = []
for page in tweepy.Cursor(api.followers_ids, screen_name="").pages():
View ProfileSupplierView.java
package com.aripd.ecommerce.view.supplier;
import com.aripd.ecommerce.entity.CityEntity;
import com.aripd.ecommerce.service.UserService;
import com.aripd.ecommerce.entity.UserEntity;
import com.aripd.ecommerce.rest.payment.paypal.PayPalAdapter;
import com.aripd.ecommerce.service.CityService;
import com.aripd.util.locale.LocaleBean;
import com.aripd.util.MessageUtil;
import com.aripd.util.RequestUtil;
View StoreLocator.java
MapModel simpleModel = new DefaultMapModel();
List<Point2D.Double> points = new ArrayList<>();
for (StoreEntity store : stores) {
points.add(new Point2D.Double(store.getLatitude(), store.getLongitude()));
LatLng coord = new LatLng(store.getLatitude(), store.getLongitude());
simpleModel.addOverlay(new Marker(coord, store.getName(), store.getAddress()));
}
Point2D.Double midpoint = SpatialCalculation.midpoint(points);
View CatalogService.java
public void generateCatalog(CatalogEntity catalog) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
try {
// get the JRXML template as a stream
//InputStream is = this.getClass().getResourceAsStream("/reports/Catalog_A4.jrxml");
//JasperReport jasperreport = (JasperReport) JRLoader.loadObject(is);
InputStream is_report = externalContext.getResourceAsStream("/WEB-INF/reports/Catalog_A4.jrxml");
JasperReport jasperReport = JasperCompileManager.compileReport(is_report);
View GithubRestClient.java
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
public class GithubRestClient {
private Client client;
private WebTarget userTarget;
private WebTarget userRepoTarget;
View CartesianProduct.java
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
public class CartesianProduct {
public static void main(String[] args) {
System.out.println(
cartesianProduct(
Arrays.asList(
View MySqlBulkOperation.java
package com.aripd.test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import org.apache.log4j.Logger;
View MongodbBulkOperation.java
package com.aripd.test;
import com.mongodb.*;
import java.util.Date;
import java.util.concurrent.TimeUnit;
public class MongodbBulkOperation {
public static void main(String args[]) {
View primefaces-galleria.xhtml
<h:form>
<p:remoteCommand name="rc" actionListener="#{headlineView.doRedirect}"/>
<p:galleria value="#{headlineView.slider}" var="post"
panelWidth="620" panelHeight="310"
showCaption="true" rendered="#{not empty headlineView.slider}">
<p:graphicImage value="/images/#{post.image.url}" alt="#{post.name}" title="#{post.name}" onclick="rc([{name: 'id', value: '#{post.id}'}, {name: 'slug', value: '#{post.slug}'}])" style="cursor: pointer;"/>
</p:galleria>
</h:form>