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.sql.Timestamp; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| public class TimeStampExample { | |
| private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss"); | |
| public static void main(String[] args) { |
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
| Scanner sc = new Scanner(System.in); | |
| sc.nextLine(); | |
| sc.close(); |
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
| System.out.println(Arrays.toString(list.toArray())); |
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 sqlite3 | |
| path = "test.sqlite" | |
| conn = sqlite3.connect(path) | |
| c = conn.cursor() | |
| c.execute("insert into post(msg) values('Salut')") | |
| c.execute("select * from post") |
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.util.ArrayList; | |
| import java.util.List; | |
| import java.sql.DriverManager; | |
| import java.sql.PreparedStatement; | |
| import java.sql.Connection; | |
| import java.sql.ResultSet; | |
| import java.sql.SQLException; | |
| import java.sql.Statement; | |
| /** |
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 org.json.*; | |
| public class App | |
| { | |
| public static void main( String[] args ) | |
| { | |
| JSONObject jo = new JSONObject(); | |
| jo.put("name", "jon doe"); | |
| jo.put("age", "22"); | |
| jo.put("city", "chicago"); |
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 json | |
| def encode(dic): | |
| # Marche aussi avec des listes, des listes et dictionnaires imbriqués, etc ... | |
| return json.dumps(dic) | |
| def encode_pretty(dic): | |
| return json.dumps(dic, sort_keys=True, indent=4, separators=(',', ': ')) | |
| def encode_compact(dic): |
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
| python -m cProfile -s cumtime script_a_analyser.py |
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
| sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xmlout | |
| sudo apt install imagemagick | |
| convert *.jpg result.pdf |
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 pickle | |
| class A: | |
| def __init__(self, item): | |
| self.item = item | |
| b = 5 | |
| if __name__ == "__main__": |