Skip to content

Instantly share code, notes, and snippets.

@jjgod
jjgod / rt.py
Last active August 29, 2015 14:06
from urllib2 import Request, urlopen, URLError
from bottle import route, run
import math
import json
import sys
import utm
import urllib
import datetime
import dateutil.parser
function queryDone(queryResult) {
    $.each(queryResult, function(i, Line){
        $("<li>").addClass("StopName").text(Line.StopName).appendTo("#stops");
        var ul = $("<ul>");
        ul.appendTo("#stops");
        $.each(Line.Table, function(i, arrival){
arrivalListItem = $("<li>");
$("<span>").addClass("LineName").text(arrival.LineName).appendTo(arrivalListItem);
            $("<span>").addClass("ArrivalTime").text(arrival.ExpectedTime).appendTo(arrivalListItem);
arrivalListItem.appendTo(ul);
from urllib2 import Request, urlopen, URLError
import json
import sys
import utm
utm_data = utm.from_latlon(59.948845,10.772473)
data = "coordinates=(x={0},y={1})&proposals={2}&maxdistance={3}".format(int(utm_data[0]), int(utm_data[1]), 10, 1400)
request = Request('http://reisapi.ruter.no/Place/GetClosestStops?{0}'.format(data))
../../content/common/gpu/media/vt_video_decode_accelerator.cc:321:42: error: use of undeclared identifier 'GL_TEXTURE_RECTANGLE_ARB'
kNumPictureBuffers, texture_size_, GL_TEXTURE_RECTANGLE_ARB);
^
../../content/common/gpu/media/vt_video_decode_accelerator.cc:356:12: error: use of undeclared identifier 'GL_TEXTURE_RECTANGLE_ARB'
glEnable(GL_TEXTURE_RECTANGLE_ARB);
^
../../content/common/gpu/media/vt_video_decode_accelerator.cc:366:24: error: use of undeclared identifier 'GL_TEXTURE_RECTANGLE_ARB'
texture_binder(GL_TEXTURE_RECTANGLE_ARB, texture_ids_[picture_id]);
^
../../content/common/gpu/media/vt_video_decode_accelerator.cc:369:9: error: use of undeclared identifier 'GL_TEXTURE_RECTANGLE_ARB'
solutions=[
{
"name": "src",
"url": "https://chromium.googlesource.com/chromium/src.git",
"managed": False,
"deps_file": ".DEPS.git",
"custom_deps": {
'src/chrome/test/data/extensions/api_test/permissions/nacl_enabled/bin': None,
'src/chrome/tools/test/reference_build/chrome_linux': None,
'src/chrome/tools/test/reference_build/chrome_mac': None,
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
index e0b9bee..00d97c2 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -401,7 +401,8 @@ void PasswordManager::CreatePendingLoginManagers(
// relevant tags anyways (7/11/2014).
// http://crbug.com/178358
PasswordStore::AuthorizationPromptPolicy prompt_policy =
- PasswordStore::DISALLOW_PROMPT;
+ iter->scheme == PasswordForm::SCHEME_HTML
From 6d8ad63addd9a384c036b6b9a8f6711512534667 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <gzjjgod@gmail.com>
Date: Sun, 3 Aug 2014 19:53:45 +0200
Subject: [PATCH 1/2] Fix ToUnicode stream creation for non-subst glyphs
non-subst glyphs generated with Unicode -> CID CMap are now properly
handled by storing the correct GID used and match them with the CMAP
in the fonts.
subst glyphs (the ones when OpenType features have been applied) can
@jjgod
jjgod / r34757.patch
Created August 3, 2014 10:10
Possible fix to r34757
diff --git a/texk/dvipdfm-x/cff.c b/texk/dvipdfm-x/cff.c
index 596b1cc..5ffedac 100644
--- a/texk/dvipdfm-x/cff.c
+++ b/texk/dvipdfm-x/cff.c
@@ -1119,7 +1119,7 @@ cff_charsets_lookup_inverse (cff_font *cff, card16 gid)
ERROR("Charsets data not available");
}
- if (gid == 0) {
+ if (gid == 0 || gid - 1 >= cff->charsets->num_entries) {
From 9f094a6f42418cd0c23fabfc7cf0b2e89f3d62d6 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <gzjjgod@gmail.com>
Date: Mon, 28 Jul 2014 09:01:02 +0200
Subject: [PATCH] Correct release of retained cff_charsets
The cff_charsets we retained is owned and cached by cid_opt struct
thus should be released in release_opt() instead of pdf_close_device().
---
texk/dvipdfm-x/ChangeLog | 4 ++++
texk/dvipdfm-x/cid.c | 4 ++++
@jjgod
jjgod / fallback.m
Last active August 29, 2015 14:04
Test Core Text fallback line height.
// Compile with: clang fallback.m -framework CoreGraphics -framework CoreText -framework Foundation -o fallback
// Run with: ./fallback "Fallback Font Family" "Text to Typeset"
#import <ApplicationServices/ApplicationServices.h>
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
if (argc != 3)
return 0;