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
INSERT INTO example_table | |
(id, name) | |
SELECT 1, 'John' | |
WHERE | |
NOT EXISTS ( | |
SELECT id FROM example_table WHERE id = 1 | |
); |
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
Root<Employee> empRoot = cq1.from(getEntityManagerFactory().getMetamodel().entity(Employee.class)); | |
Join<Employee, Project> join = empRoot.join("projects"); | |
Path exp = ((Path)join.as(LargeProject.class)).get("budget"); | |
cq1.where(qb1.equal(exp, new Integer(1000)) ); | |
// -------------- | |
Check for type: | |
cb.equal(join.type(), cb.literal(LargeProject.class)) |
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
From http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x/3756686 | |
Setting the environment for new processes started by Spotlight | |
You can set the environment used by launchd (and, by extension, anything started from Spotlight) with launchctl setenv. For example to set the path: | |
launchctl setenv PATH /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin | |
Or if you want to set up your path in .bashrc or similar, then have it mirrored in launchd: | |
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin | |
launchctl setenv PATH $PATH |
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
svn mergeinfo http://[server]/branches/[branch] --show-revs eligible |
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
window.applicationCache.addEventListener('updateready', function(e) { | |
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { | |
// Browser downloaded a new app cache. | |
// Swap it in and reload the page to get the new hotness. | |
window.applicationCache.swapCache(); | |
if (confirm('A new version of this site is available. Load it?')) { | |
window.location.reload(); | |
} | |
} else { | |
// Manifest didn't changed. Nothing new to server. |