In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
import com.sun.javafx.application.PlatformImpl; | |
import java.awt.BorderLayout; | |
import java.awt.Dimension; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import javafx.application.Platform; | |
import javafx.collections.ObservableList; | |
import javafx.embed.swing.JFXPanel; | |
import javafx.scene.Group; | |
import javafx.scene.Node; |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.jsoup.nodes.Element; | |
import org.jsoup.select.Elements; | |
import java.io.File; | |
import java.io.IOException; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.util.HashSet; |
package net.javafun.example.atmstatusfsm; | |
import java.awt.BorderLayout; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.util.List; | |
import javax.swing.JButton; | |
import javax.swing.JComboBox; | |
import javax.swing.JFrame; |
// Apache 2.0 licensed. | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
/** An implementation of {@link BaseAdapter} which uses the new/bind pattern for its views. */ | |
public abstract class BindableAdapter<T> extends BaseAdapter { |
function(doc){ | |
// handle a custom format using methods in the date object | |
var format = "{getFullYear}/{getMonth}/{getDate}", | |
date = new Date(doc.created_at), | |
// use a regular expression to replace parts of our format string | |
formatted_date = format.replace(/\{(\w+)\}/g, function(str, func){ | |
var time = date[func](); | |
// if `func` is `getMonth` we must offset by one | |
if(func === 'getMonth'){ | |
time += 1; |
public class MyApp extends Application { | |
@Override | |
public void onCreate() { | |
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf | |
} | |
} |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)Hibernate documentation - https://docs.jboss.org/hibernate/core/4.2/devguide/en-US/html/ch16.html#d5e4669
Multi-Tenant Data Architecture - http://msdn.microsoft.com/en-us/library/aa479086.aspx
Hibernate: Discriminator based multi tenancy using filter? - http://stackoverflow.com/questions/12894357/hibernate-discriminator-based-multi-tenancy-using-filter
Manage Connection Pooling in multi-tenant web app with Spring, Hibernate and C3P0 - http://stackoverflow.com/questions/21223894/manage-connection-pooling-in-multi-tenant-web-app-with-spring-hibernate-and-c3p
Using Hibernate to Implement Multi-tenant Cloud Architecture - http://www.devx.com/Java/Article/47817
package kannellogsparser; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.StringTokenizer; | |
/** |