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
{ | |
"method": "POST", | |
"url": "https://loltelapi.com/api/sms", | |
"httpVersion": "HTTP/1.1", | |
"cookies": [], | |
"headers": [ | |
{ | |
"name": "Content-Type", | |
"value": "application/json" | |
}, |
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
let op: fn(f64, f64) -> f64 = match token { | |
"+" => Add, | |
"-" => Sub, | |
"*" => Mult, | |
_ => panic!("Not yet supported"), | |
}; | |
stack.push(op(left, right)); |
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
getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { | |
@Override | |
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) { | |
new AlertDialog.Builder(getActivity()).setTitle("Delete preset?") | |
.setPositiveButton("Yes", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
presets.remove(position); | |
GhettoORM.getInstance().storePresets(presets); | |
adapter.notifyDataSetChanged(); |
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
queen_overflow_diagonal = 0 | |
for i in range(self.board_size): # Iterate along Y axis | |
row_downwards_left = row_upwards_left = row_downwards_right = row_upwards_right = 0 | |
for j in range(self.board_size): # Iterate along diagonals | |
if 0 <= i + j < self.board_size: | |
row_upwards_left += board_matrix[i+j][j] # This takes care of the upwards diagonals | |
row_downwards_left += board_matrix[self.board_size - i - j - 1][j] # For the downwards diagonals | |
if i != 0: # To prevent double addition in the first iteration | |
row_upwards_right += board_matrix[j][i+j] |