public class ClickListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
e.getSource().setText("Clicked");
}
}
$(document).ready(function() { ... });
.if (window.jQuery) {
...
}
if (typeof jQuery == 'undefined') {
...
}
from xlrd import open_workbook
wb = open_workbook('test.xls', formatting_info=True)
sheet = wb.sheet_by_index(0)
cell = sheet.cell(0, 0)
xf_index = cell.xf_index
xf = wb.xf_list[xf_index]
format_key = xf.format_key
format = wb.format_map[format_key]
format_str = format.format_str
print(format_str)
import javax.swing.UIManager.*;
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
// If Nimbus is not available, you can set the GUI to another look and feel.
}
from bottle import response
@route('/<width:int>/<height:int>')
def index(width, height):
...
image = Cubic(width=width, height=height, filename=randomname, cube_size=90)
image.paint()
img_bytes = open(randomname, 'rb').read()
os.remove(randomname)
response.set_header('Content-type', 'image/png')
return img_bytes