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
PreparedStatement preparedStatement = connection.prepareStatement(sql); | |
for (int i = 0; i < 1000; i++) { | |
preparedStatement.setObject(1, someValue); | |
preparedStatement.addBatch(); | |
if ((i + 1) % 100 == 0) { | |
preparedStatement.executeBatch(); | |
} | |
} | |
preparedStatement.executeBatch(); | |
preparedStatement.close(); |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
# /etc/init.d/mysql stop | |
Shutting down MySQL.. | |
# mysqld_safe --skip-grant-tables --skip-networking & | |
[1] 4983 | |
# Starting mysqld daemon with databases from /var/lib/mysql | |
# mysql mysql | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 1 to server version: 5.0.21-log |
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
export DATABASE_URL=jdbc:postgresql://localhost/$(whoami) | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
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
<NotepadPlus> | |
<UserLang name="Gherkin" ext="feature" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="yes" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00# 01 02 03 04</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
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
/** | |
* call logs | |
*/ | |
public class LogCaller { | |
private static Logger LOG = LoggerFactory.getLogger(LogCaller.class); | |
public void testLogging() { | |
LOG.info("Hello World"); | |
} |
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
select {"artsist": artist, "rating": array rate.rating for rate in ratings end} | |
from couchmusic2 | |
where type = "track" | |
limit 10; | |
select { "title": t.title, "rating": avg(r.rating)} as moy | |
from couchmusic2 as t | |
unnest t.ratings as r | |
group by t.title |
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
public class StopWatch { | |
private static final double NANOS_IN_A_MINUTE = 1000000000000F; | |
private static final double NANOS_IN_A_SECOND = 1000000000F; | |
private static final double NANOS_IN_A_MILLI = 1000000F; | |
private static final double NANOS_IN_A_MICRO = 1000F; | |
private long startTime = -1L; | |
private long startDate = -1L; | |
private long elapsedTime = -1L; |
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
package gca.caps.rh.sourcing.dates | |
import java.time.format.DateTimeFormatter | |
import java.time.{DayOfWeek, LocalDate} | |
import org.slf4j.LoggerFactory | |
/** | |
* Vérification des jours fériés | |
*/ |
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
package io.github.javathought.commons.xml | |
import java.io.StringWriter | |
import javax.xml.bind.JAXBContext | |
import javax.xml.bind.annotation._ | |
import javax.xml.bind.annotation.adapters.{XmlAdapter, XmlJavaTypeAdapter} | |
import io.github.javathought.commons.xml.XmlTypes._ | |
import org.apache.commons.io.IOUtils |
OlderNewer