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 torch | |
| print(f"PyTorch version: {torch.__version__}") | |
| # Check PyTorch has access to MPS (Metal Performance Shader, Apple's GPU architecture) | |
| print(f"Is MPS (Metal Performance Shader) built? {torch.backends.mps.is_built()}") | |
| print(f"Is MPS available? {torch.backends.mps.is_available()}") | |
| # Set the device | |
| device = "mps" if torch.backends.mps.is_available() else "cpu" | |
| print(f"Using device: {device}") |
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
| // c includes | |
| #include <stdio.h> | |
| #include <string.h> | |
| // cpp includes | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <sstream> | |
| // lib includes |
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 <stdlib.h> | |
| #include <stdio.h> | |
| #include <fcntl.h> | |
| #include <libtar.h> | |
| int main(int argc, char *argv[]) { | |
| TAR *tar = NULL; | |
| int ret = 0; | |
| int exitcode = 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
| import requests | |
| import json | |
| from datetime import date | |
| # Refer Meta data apis to get district ids https://apisetu.gov.in/public/api/cowin#/Metadata%20APIs | |
| districts = [ | |
| 294, # BBMP | |
| 265, # Bangalore Urban | |
| ] |
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
| Reference : https://groups.google.com/a/chromium.org/d/msg/chromium-hterm/XZtSm6P0acw/Ww4UCE1b-I0J | |
| Configure to open the app in new tab instead of seperate window. | |
| Once it is open in new tab, open developer tools and follow steps below. | |
| If you know the index of the offending host entry (it's usually reported | |
| by ssh if the connection fails) you can open the JavaScript console and | |
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
| // bits and pieces of map in 'go' | |
| package main | |
| import ( | |
| "fmt" | |
| "regexp" | |
| "log" | |
| ) | |
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
| //##Gets x days Ago## | |
| Date.prototype.daysAgo = function (days) { | |
| if (isNaN(days) || (days ==0)) { | |
| return; | |
| } | |
| this.setDate(this.getDate() - days); | |
| } | |
| //##Gets x weeks Ago## | |
| Date.prototype.weeksAgo = function (weeks) { |
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
| <style> | |
| nav > ul > li { /* Main menu float left */ | |
| float : left; | |
| } | |
| nav ul ul li { /* Position Sub menu and Details menu relative */ | |
| position: relative; | |
| } |