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
l = 'XYZ' | |
#def stringOccurrences(int n, String str): | |
def pandovan(n): | |
p = [] | |
for i in range(0,n): | |
if i<3: |
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
l = 'XYZ' | |
def pandovan(n): | |
p = [] | |
for i in range(0,n): | |
if i<3: | |
p.append(l[i]) | |
else: | |
p.append(p[i-2] + p[i-3]) |
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package pebblemerchant; | |
/** | |
* | |
* @author sunny | |
*/ |
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
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
const { setTimeout } = require('sdk/timers'); | |
const utils = require('sdk/lang/functional'); | |
const { invoke, defer, curry, compose, memoize, once, delay, wrap } = utils; | |
exports['test forwardApply'] = function(assert) { | |
function sum(b, c) this.a + b + c |
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
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
const { setTimeout } = require('sdk/timers'); | |
const utils = require('sdk/lang/functional'); | |
const { invoke, defer, curry, partial, compose, memoize, once, delay, wrap } = utils; | |
const deprecate = require('sdk/util/deprecate'); | |
const { LoaderWithHookedConsole } = require('sdk/test/loader'); |
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
let Histogram = { | |
hgramSamplesCaption: bundle.GetStringFromName("histogramSamples"), | |
hgramAverageCaption: bundle.GetStringFromName("histogramAverage"), | |
hgramSumCaption: bundle.GetStringFromName("histogramSum"), | |
hgramCopyCaption: bundle.GetStringFromName("histogramCopy"), |
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
258 let labelledItemRules = mix(baseItemRules, { | |
259 label: { | |
260 map: stringOrNull, | |
261 is: ["string"], | |
262 ok: function (v) !!v, | |
263 msg: "The item must have a non-empty string label." | |
264 }, | |
265 image: { | |
266 map: stringOrNull, | |
267 is: ["string", "undefined", "null"], |
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
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
'use strict'; | |
module.metadata = { | |
'stability': 'unstable' | |
}; | |
const { Cc, Ci } = require('chrome'); |
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
exports['test new top window with content URI'] = function(assert) { | |
let msg = 'only chrome, resource and data uris are allowed'; | |
assert.throws(function () { | |
open('foo'); | |
}, msg); | |
assert.throws(function () { | |
open('http://foo'); | |
}, msg); | |
assert.throws(function () { | |
open('https://foo'); |
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
let { promise } = require('sdk/window/helpers'); | |
console.log("foo1"); | |
promise(open('chrome://foo/content/'), 'load').then(function(window) { | |
console.log("foo2"); | |
assert.ok(~windows().indexOf(window), 'chrome URI works'); | |
console.log("foo3"); | |
return window; // pass window to next function | |
}).then(close). | |
then(promise.bind(null, 'resource://foo', 'load')).then(function(window) { | |
assert.ok(~windows().indexOf(window), 'resource URI works'); |
OlderNewer