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 problem31 { | |
final static int TOTAL = 200; | |
public static void main(String[] args) { | |
int[] coins = {1, 2, 5, 10, 20, 50, 100, 200}; | |
int[] ways = new int[TOTAL + 1]; | |
ways[0] = 1; | |
for(int coin: coins) | |
for(int j = coin; j <= TOTAL; j++) |
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
src/backend/access/transam/README | |
The Transaction System | |
====================== | |
PostgreSQL's transaction system is a three-layer system. The bottom layer | |
implements low-level transactions and subtransactions, on top of which rests | |
the mainloop's control code, which in turn implements user-visible | |
transactions and savepoints. |
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
// YOU SHALL NOT PASS! | |
configurations { | |
all*.exclude module: 'commons-logging' | |
} |
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
# install latest version of jsvc package from yum | |
rpm_package "jakarta-commons-daemon-jsvc-1.0.1-8.9.el6.x86_64.rpm" do | |
action :install | |
source "/tmp/#{JSVC}" | |
options "--nodeps" | |
end |
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
It is a bit complicated ... | |
Java tries to use the default character encoding to return bytes using String.getBytes(). | |
The default charset is provided by the system file.encoding property. | |
This is cached and there is no use in changing it via the System.setProperty(..) after the JVM starts. | |
If the file.encoding property does not map to a known charset, then the UTF-8 is specified. | |
.... Here is the tricky part (which is probably never going to come into play) .... | |
If the system cannot decode or encode strings using the default charset (UTF-8 or another one), then there will be a fallback to ISO-8859-1. If the fallback does not work ... the system will fail! |
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
#!/bin/bash | |
case $1 in | |
tags) | |
# extract tags | |
cat $2 | cut -d '|' -f 8 | sed "y/;/\n/;" | sed -e '/ | |
/d' | sort | uniq > tags | |
;; | |
movies) | |
# extract movie details |
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 d.datname AS Name, pg_catalog.pg_get_userbyid(d.datdba) AS Owner, | |
CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') | |
THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) | |
ELSE 'No Access' | |
END AS Size | |
FROM pg_catalog.pg_database d | |
ORDER BY | |
CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') | |
THEN pg_catalog.pg_database_size(d.datname) | |
ELSE NULL |
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
/* Flatten das boostrap */ | |
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid { | |
-moz-box-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
box-shadow: none !important; | |
-webkit-border-radius: 0px !important; | |
-moz-border-radius: 0px !important; | |
border-radius: 0px !important; | |
border-collapse: collapse !important; | |
background-image: none !important; |
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
// invalidate the session | |
session.invalidate(); | |
// redirect the user to where they were, so normal login process can kick in | |
HttpServletResponse response = (HttpServletResponse) servletResponse; | |
HttpServletRequest request = (HttpServletRequest) servletRequest; | |
StringBuffer requestUrl = request.getRequestURL(); | |
// by default all GET params from query string will be missing from getRequestURL, let's reconstruct it | |
if (request.getQueryString() != null) { |
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
DS.RESTAdapter.registerTransform('raw', { | |
deserialize: function(serialized) { | |
return serialized; | |
}, | |
serialize: function(deserialized) { | |
return deserialized; | |
} | |
}); | |
App.Movie = DS.Model.extend({ |
OlderNewer