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
func DetectRSSLink(ctx context.Context, URL string, body string) []string { | |
doc, err := html.Parse(strings.NewReader(body)) | |
var candidates []string | |
if err != nil { | |
return candidates | |
} | |
links := FindAll(doc, "link") | |
for _, link := range links { | |
if GetAttr(link, "rel") == "alternate" { | |
attrHref := GetAttr(link, "href") |
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
inp = jnp.array([[[l[x], G[i]][0] for i in range(len(G))] for x in range(len(l))]) | |
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
import pandas as pd | |
from todoist.api import TodoistAPI | |
ASANA_TASKS_CSV_PATH = './asana.csv' | |
# creates this project and import all tasks from asana csv file to this project in todoist | |
TODOIST_PROJECT_NAME = 'Asana Imports' | |
TODOIST_TOKEN = 'REPLACE_YOUR_TODOIST_TOKEN' | |
# read asana tasks |
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
# import required packages | |
import torch | |
import torch.nn.functional as F | |
from torch_geometric.datasets import Planetoid | |
from torch_geometric.data import DataLoader | |
from torch_geometric.nn import GCNConv | |
# load Cora dataset | |
dataset = Planetoid(root='/tmp/Cora', name='Cora') | |
loader = DataLoader(dataset, batch_size=32, shuffle=True) |
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
persian_alphabet = '۱۲۳۴۵۶۷۸۹۰ٸآابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی' | |
def create_persian_sub_mapping(): | |
kaf_alt = 'كڬڬڭګڪ' | |
gaf_alt = 'ڲڳ' | |
ye_alt = 'ۍېيێئ' | |
vav_alt = 'ۅۋۈۉٶۇۆۊؤٶ' | |
hamze_alt = 'ٳٱأٲإ' | |
he_alt = 'ۃۀہةە' |
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
from mininet.topo import Topo | |
class MyTopo( Topo ): | |
"Simple topology example." | |
def __init__( self ): | |
"Create custom topo." | |
# Initialize topology | |
Topo.__init__( self ) |
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
Environment: | |
Request Method: GET | |
Request URL: http://localhost:8000/admin | |
Django Version: 1.6.5 | |
Python Version: 2.7.3 | |
Installed Applications: | |
('django.contrib.admin', |
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
{% load static %} | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Index Page</title> | |
<!-- external scripts --> | |
<!-- jQuery & Bootstrap --> | |
<script type="text/javascript" src="{% static "js/jquery.js" %}"/></script> |