This file contains hidden or 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
import sys | |
with open('ch7.bin') as f: | |
data = "".join(f.readlines()) | |
for shift in range(0, 255): | |
sys.stdout.write('%d >>> ' % shift) | |
for i in range(0, len(data)): | |
sys.stdout.write(chr((ord(data[i])+shift) % 255)) | |
sys.stdout.write('\n') |
This file contains hidden or 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
def _get_lines(self, form): | |
res = [] | |
move_state = ['draft','posted'] | |
if self.target_move == 'posted': | |
move_state = ['posted'] | |
self.cr.execute('SELECT DISTINCT res_partner.id AS id,\ | |
res_partner.name AS name \ | |
FROM res_partner,account_move_line AS l, account_account, account_move am\ | |
WHERE (l.account_id=account_account.id) \ | |
AND (l.move_id=am.id) \ |
This file contains hidden or 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 s in Sprint, | |
join: i in assoc(s, :issues), | |
select: (sum(i.original_estimate) - sum(i.remaining_estimate)) / sum(i.original_estimate) |
This file contains hidden or 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
for { | |
user <- RequestHelper.User.register(email, password) | |
_ <- Toast.makeToast(self, user, Toast.LONG_LENGTH).show() | |
resp <- enterWithUser(user, email) | |
} yield resp |
This file contains hidden or 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
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Name=IntelliJ IDEA | |
Icon=/opt/idea-IU-141.713.2/bin/idea.png | |
Exec="/opt/idea-IU-141.713.2/bin/idea.sh" %f | |
Comment=Develop with pleasure! | |
Categories=Development;IDE; | |
Terminal=false | |
StartupWMClass=jetbrains-idea |
This file contains hidden or 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
barchart | |
char | |
char_domain | |
checkbox | |
date | |
float_time | |
gauge | |
handle | |
handler |
This file contains hidden or 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
import java.io.*; | |
import java.security.MessageDigest; | |
public class MD5Checksum { | |
public static byte[] createChecksum(String filename) throws | |
Exception | |
{ | |
InputStream fis = new FileInputStream(filename); |
This file contains hidden or 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
class Player implements Restricted<Player> { | |
@Getter | |
final Permission<Player> permission = | |
Alpha.let("connect").raiseIf("You are banned", this::isBanned) | |
.raiseIf("Already playing", this::isAlreadyPlaying) | |
.let("move").raiseIf("You are jailed", this::isJailed) | |
.raiseIf("Too heavy", this::isTooHeavy) | |
.let("move:teleport").raiseUnless("You are not an admin", this::isAdmin) | |
; | |
; |
This file contains hidden or 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
@Listen | |
public Future<Unit> knownNotifications(ChoosePlayerEvent evt) { | |
return notifs.findAll(evt.getPlayer().getId()).map(array -> | |
client.write(new NotificationListMessage( | |
NotificationConverter.compressNotifications(array)) | |
) | |
); | |
} |
This file contains hidden or 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
if (!rset.last()) { | |
return new int[0]; | |
} | |
int[] ids = new int[rset.getRow()]; | |
rset.beforeFirst(); | |
for (int i = 0; i < ids.length; i++) { | |
rset.next(); | |
ids[i] = rset.getInt(1); | |
} |