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 random | |
| def icantbelieveitcansort(a: list) -> tuple: | |
| ops = 0 | |
| for i in range(0, len(a)): | |
| for j in range(0, len(a)): | |
| if a[i] < a[j]: | |
| a[i], a[j] = a[j], a[i] | |
| ops += 1 | |
| return (a, ops) |
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
| poller := zmq.NewPoller() | |
| poller.Add(frontend, zmq.POLLIN) | |
| poller.Add(backend, zmq.POLLIN) | |
| for { | |
| var sockets []zmq.Polled | |
| sockets, err := poller.Poll(-1) | |
| if err != nil { | |
| break |
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
| var rules = document.querySelectorAll('*[id^="enable_"]'); | |
| var remove_items = 100; | |
| for (var i = rules.length; i--;) { document.getElementById(rules[i].id).checked = true; remove_items--; if (remove_items < 0) break; } |
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
| # -*- coding: utf-8 -*- | |
| import time | |
| import numpy as np | |
| from random import randint | |
| iou_vals = [] | |
| iou_count = 0 | |
| class Test: |
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
| #include <glm/glm.hpp> | |
| #include <glm/ext.hpp> | |
| int main() { | |
| auto m1 = glm::mat4(1.0f); | |
| auto m2 = glm::mat4(2.0f); | |
| printf("%s\n", glm::to_string(m1 * m2).c_str()); | |
| return 0; |
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 datetime import timedelta | |
| from math import ceil, fabs, acos, sqrt, degrees | |
| import Tkinter as tk | |
| import tkFont | |
| import datetime | |
| import time | |
| from random import randint | |
| def get_chart_segments_from_total_of_days(date_days): | |
| if (date_days <= 31): # format x-axis daily |
NewerOlder