New schedule
View all
edit
Dropdown
Daily
Weekly
Month
2 weeks
3 weeks
Show weekends
Start Week on Monday
Narrower than weekdays
Today


--- layout: jsdoc title: "Module: workbox-broadcast-cache-update" jsdocNav: - Modules: - workbox-background-sync - workbox-broadcast-cache-update - workbox-build - workbox-cache-expiration - workbox-cacheable-response - workbox-google-analytics - workbox-precaching - workbox-routing - workbox-runtime-caching - workbox-sw - workbox-webpack-plugin ---
A helper library that uses the Broadcast Channel API to announce when a caches entry is updated with a new response, allowing your web app to listen for these updates and react to them.
Most developers will use this module by instantiating a new
BroadcastCacheUpdatePlugin
and passing it to a
RequestWrapper,
as shown in the first example below.
You can listen for updates from your web app by adding an event listener on
a BroadcastChannel
within a page, using the same channel name as
what's used within the service worker, as shown in the second example.
const requestWrapper = new workbox.runtimeCaching.RequestWrapper({
cacheName: 'text-files',
plugins: [
new workbox.broadcastCacheUpdate.BroadcastCacheUpdatePlugin(
{channelName: 'cache-updates'})
],
});
const route = new workbox.routing.RegExpRoute({
regExp: /\.txt$/,
handler: new workbox.runtimeCaching.StaleWhileRevalidate({requestWrapper}),
});
const router = new workbox.routing.Router();
router.registerRoute({route});
const updateChannel = new BroadcastChannel('cache-updates');
updateChannel.addEventListener('message', event => {
console.log(`Cache updated: ${event.data.payload.updatedUrl}`);
});
This is a static variable for the cache updated message type. Useful for
comparing to the messages type
parameter to identify the kind of message.
// Prints 'CACHE_UPDATED'
console.log(workbox.broadcastCacheUpdate.cacheUpdatedMessageType);


3_AggregatedAmounts - Diagram
WaDE [WaDE2.0_schema_star.xml]
Home
Tables
Schemas
Diagrams
Foreign Keys
Indexes
Diagram: 3_AggregatedAmounts


| Home | Libraries | People | FAQ | More |
While Boost.Atomic strives to implement the atomic operations from C++11 as faithfully as possible, there are a few limitations that cannot be lifted without compiler support:
atomic<T>
results in undefined behavior: This means that any class containing
a constructor, destructor, virtual methods or access control specifications
is not a valid argument in C++98. C++11 relaxes this slightly by allowing
"trivial" classes containing only empty constructors. Advise: Use only POD types.
memory_order_consume
only affects computationally-dependent operations, but in general there
is nothing preventing a compiler from transforming a computation dependency
into a control dependency. A C++11 compiler would be forbidden from such
a transformation. Advise: Use memory_order_consume
only in conjunction
with pointer values, as the compiler cannot speculate and transform these
into control dependencies.
memory_order_acquire
/memory_order_consume
and memory_order_release
need to restrain
reordering of memory operations only in one direction. Since there is no
way to express this constraint to the compiler, these act as "full
compiler barriers" in this implementation. In corner cases this may
result in a less efficient code than a C++11 compiler could generate.
atomic<T>
in shared memory only works correctly, if atomic<T>::is_lock_free() == true
.


{{filterName}}Question 4 of 4
Which route do you want to take?
You can get into jobs in different ways, from studying for formal qualifications to learning on the job. Choose the routes that suit you best. You can choose more than one.
You can get into jobs in different ways, from studying for formal qualifications to learning on the job. Choose the routes that suit you best. You can choose more than one.


?Ánm
E
ISSI
_WM
pbiiidll
>iČ]
>VJ
Kl
s
[>
i
ni
initiŽ
1
‰jjn-tp
,
01529972
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


- Card - Class in javax.smartcardio
-
A Smart Card with which a connection has been established.
- Card() - Constructor for class javax.smartcardio.Card
-
Constructs a new Card object.
- CardChannel - Class in javax.smartcardio
-
A logical channel connection to a Smart Card.
- CardChannel() - Constructor for class javax.smartcardio.CardChannel
-
Constructs a new CardChannel object.
- CardException - Exception in javax.smartcardio
-
Exception for errors that occur during communication with the
Smart Card stack or the card itself.
- CardException(String) - Constructor for exception javax.smartcardio.CardException
-
Constructs a new CardException with the specified detail message.
- CardException(Throwable) - Constructor for exception javax.smartcardio.CardException
-
Constructs a new CardException with the specified cause and a detail message
of (cause==null ? null : cause.toString())
.
- CardException(String, Throwable) - Constructor for exception javax.smartcardio.CardException
-
Constructs a new CardException with the specified detail message and cause.
- CardNotPresentException - Exception in javax.smartcardio
-
Exception thrown when an application tries to establish a connection with a
terminal that has no card present.
- CardNotPresentException(String) - Constructor for exception javax.smartcardio.CardNotPresentException
-
Constructs a new CardNotPresentException with the specified detail message.
- CardNotPresentException(Throwable) - Constructor for exception javax.smartcardio.CardNotPresentException
-
Constructs a new CardNotPresentException with the specified cause and a detail message
of (cause==null ? null : cause.toString())
.
- CardNotPresentException(String, Throwable) - Constructor for exception javax.smartcardio.CardNotPresentException
-
Constructs a new CardNotPresentException with the specified detail message and cause.
- CardPermission - Class in javax.smartcardio
-
A permission for Smart Card operations.
- CardPermission(String, String) - Constructor for class javax.smartcardio.CardPermission
-
Constructs a new CardPermission with the specified actions.
- CardTerminal - Class in javax.smartcardio
-
A Smart Card terminal, sometimes referred to as a Smart Card Reader.
- CardTerminal() - Constructor for class javax.smartcardio.CardTerminal
-
Constructs a new CardTerminal object.
- CardTerminals - Class in javax.smartcardio
-
The set of terminals supported by a TerminalFactory.
- CardTerminals() - Constructor for class javax.smartcardio.CardTerminals
-
Constructs a new CardTerminals object.
- CardTerminals.State - Enum in javax.smartcardio
-
Enumeration of attributes of a CardTerminal.
- close() - Method in class javax.smartcardio.CardChannel
-
Closes this CardChannel.
- CommandAPDU - Class in javax.smartcardio
-
A command APDU following the structure defined in ISO/IEC 7816-4.
- CommandAPDU(byte[]) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from a byte array containing the complete
APDU contents (header and body).
- CommandAPDU(byte[], int, int) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from a byte array containing the complete
APDU contents (header and body).
- CommandAPDU(ByteBuffer) - Constructor for class javax.smartcardio.CommandAPDU
-
Creates a CommandAPDU from the ByteBuffer containing the complete APDU
contents (header and body).
- CommandAPDU(int, int, int, int) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from the four header bytes.
- CommandAPDU(int, int, int, int, int) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from the four header bytes and the expected
response data length.
- CommandAPDU(int, int, int, int, byte[]) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from the four header bytes and command data.
- CommandAPDU(int, int, int, int, byte[], int, int) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from the four header bytes and command data.
- CommandAPDU(int, int, int, int, byte[], int) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from the four header bytes, command data,
and expected response data length.
- CommandAPDU(int, int, int, int, byte[], int, int, int) - Constructor for class javax.smartcardio.CommandAPDU
-
Constructs a CommandAPDU from the four header bytes, command data,
and expected response data length.
- connect(String) - Method in class javax.smartcardio.CardTerminal
-
Establishes a connection to the card.
- getActions() - Method in class javax.smartcardio.CardPermission
-
Returns the canonical string representation of the actions.
- getATR() - Method in class javax.smartcardio.Card
-
Returns the ATR of this card.
- getBasicChannel() - Method in class javax.smartcardio.Card
-
Returns the CardChannel for the basic logical channel.
- getBytes() - Method in class javax.smartcardio.ATR
-
Returns a copy of the bytes in this ATR.
- getBytes() - Method in class javax.smartcardio.CommandAPDU
-
Returns a copy of the bytes in this APDU.
- getBytes() - Method in class javax.smartcardio.ResponseAPDU
-
Returns a copy of the bytes in this APDU.
- getCard() - Method in class javax.smartcardio.CardChannel
-
Returns the Card this channel is associated with.
- getChannelNumber() - Method in class javax.smartcardio.CardChannel
-
Returns the channel number of this CardChannel.
- getCLA() - Method in class javax.smartcardio.CommandAPDU
-
Returns the value of the class byte CLA.
- getData() - Method in class javax.smartcardio.CommandAPDU
-
Returns a copy of the data bytes in the command body.
- getData() - Method in class javax.smartcardio.ResponseAPDU
-
Returns a copy of the data bytes in the response body.
- getDefault() - Static method in class javax.smartcardio.TerminalFactory
-
Returns the default TerminalFactory instance.
- getDefaultType() - Static method in class javax.smartcardio.TerminalFactory
-
Get the default TerminalFactory type.
- getHistoricalBytes() - Method in class javax.smartcardio.ATR
-
Returns a copy of the historical bytes in this ATR.
- getINS() - Method in class javax.smartcardio.CommandAPDU
-
Returns the value of the instruction byte INS.
- getInstance(String, Object) - Static method in class javax.smartcardio.TerminalFactory
-
Returns a TerminalFactory of the specified type that is initialized
with the specified parameters.
- getInstance(String, Object, String) - Static method in class javax.smartcardio.TerminalFactory
-
Returns a TerminalFactory of the specified type that is initialized
with the specified parameters.
- getInstance(String, Object, Provider) - Static method in class javax.smartcardio.TerminalFactory
-
Returns a TerminalFactory of the specified type that is initialized
with the specified parameters.
- getName() - Method in class javax.smartcardio.CardTerminal
-
Returns the unique name of this terminal.
- getNc() - Method in class javax.smartcardio.CommandAPDU
-
Returns the number of data bytes in the command body (Nc) or 0 if this
APDU has no body.
- getNe() - Method in class javax.smartcardio.CommandAPDU
-
Returns the maximum number of expected data bytes in a response
APDU (Ne).
- getNr() - Method in class javax.smartcardio.ResponseAPDU
-
Returns the number of data bytes in the response body (Nr) or 0 if this
APDU has no body.
- getP1() - Method in class javax.smartcardio.CommandAPDU
-
Returns the value of the parameter byte P1.
- getP2() - Method in class javax.smartcardio.CommandAPDU
-
Returns the value of the parameter byte P2.
- getProtocol() - Method in class javax.smartcardio.Card
-
Returns the protocol in use for this card.
- getProvider() - Method in class javax.smartcardio.TerminalFactory
-
Returns the provider of this TerminalFactory.
- getSW() - Method in class javax.smartcardio.ResponseAPDU
-
Returns the value of the status bytes SW1 and SW2 as a single
status word SW.
- getSW1() - Method in class javax.smartcardio.ResponseAPDU
-
Returns the value of the status byte SW1 as a value between 0 and 255.
- getSW2() - Method in class javax.smartcardio.ResponseAPDU
-
Returns the value of the status byte SW2 as a value between 0 and 255.
- getTerminal(String) - Method in class javax.smartcardio.CardTerminals
-
Returns the terminal with the specified name or null if no such
terminal exists.
- getType() - Method in class javax.smartcardio.TerminalFactory
-
Returns the type of this TerminalFactory.


Drop the Triples
问题描述 :
The game is played between two players, with a set of standard playing cards. Cards are distinguished only by their values, from 1 (Ace) to 13 (King). The cards are shuffled and placed as a pile in the center of the table, face down. This pile is called the stock. The two players take turns at playing. At each turn, a player
●draws the top card from the stock, adding it to her/his hand; and
●decides whether she/he wants to "drop some triples"
Dropping a triple consists of choosing three cards (a triple) from the hand and placing them on the table, face up. The dropped triples stay on the table until the end of the game.
Only some sets of three cards form a valid triple. There are two types of valid triples:
●Perfect triples are made of three cards whose values represent the length of sides of an equilateral triangle;
●Common triples are made by three cards whose values represent the length of sides of any other (not equilateral) triangle.
The figure below shows examples of perfect triples (a), common triples (b), and invalid triples(c).
Only valid triples can be dropped, but a player may drop any number of triples at a given turn. In particular, since players know the number of cards in the stock at every turn, a player may decide to drop all triples in her/his last turn. Some players, however, normally drop some triples during the game, to maintain as few cards in their hands as possible.
The game finishes when the stock is empty. The winner is the player that dropped the largest number of perfect triples. If both players dropped the same number of perfect triples, the winner is the player that dropped the largest number of common triples. If both players dropped the same number of perfect triples and the same number of common triples, the result is a tie.
Given the description of the cards in the stock, write a program that determines the winner of a game of Triples, considering both players play as best as possible.
输入:
输出:
样例输入:
7 5 6 5 6 5 6 8 12 13 13 13 13 13 13 1 3 2 9 3 9 12 1 2 1 2 1 2 3 1 4 2 5 3 0
样例输出:
0 2 1
贴的有些代码的头文件不见了，这是为啥
排版
这是往年的笔试题，非在线，主要考察基础，Java会在面试时问到
这个方法是错的，不信你试试：
20 5
1 A:9
1 A:9
1 A:9
1 A:6
1 A:4
正确答案应该是19，这个答案是18
学算法中的数据结构学到一定程度会乐此不疲的，比如其中的2－3树，类似的红黑树，我甚至可以自己写个逻辑文件系统结构来。
a是根先忽略掉，递归子树。剩下前缀bejkcfghid和后缀jkebfghicd，分拆的原则的是每个子树前缀和后缀的节点个数是一样的，根节点出现在前缀的第一个，后缀的最后一个。根节点b出现后缀的第四个位置，则第一部分为四个节点，前缀bejk，后缀jkeb，剩下的c出现在后缀的倒数第2个，就划分为cfghi和 fghic，第3部分就为c、c
不错的代码！
为什么for循环找到的i一定是素数叻，而且约数定理说的是n=p1^a1*p2^a2*p3^a3*…*pk^ak，而你每次取余都用的是原来的m，也就是n
这个差别应该不会太大，或许编辑器就自动优化成内联函数了


Please download https://bit.ly/xw19-python
The interpreter acts as a simple calculator: you can type an expression in it and it will write the value. Expression syntax is straightforward: the operators +, -, * and / work just like in most other languages (for example, Pascal or C); parentheses (()) can be used for grouping.
For example:
8 / 5
8 % 5
8 / 5.0
8 / 2.0
round(8/5.0)
int(round(8/5.0))
type(5)
type(5.0)
The equal sign (=) is used to assign a value to a variable. Afterwards, no result is displayed before the next interactive prompt.
If a variable is not “defined” (assigned a value), trying to use it will give you an error:
a_list = [1, 2, 3, 45]
a_list[0]
a_list[-1]
a_list[1:3]
for item in a_list:
print(item)
mixed = [4, "Tony's", 3.14, True, 'bees']
for thing in mixed:
print (thing, type(thing))
show = 'My quote has it\'s text: "strings are good"'
print(show)
show2 = "My quote has it's text: \"strings are good\""
print(show2)
| command | description |
|---|---|
| ipython | run IPython |
| jupyter qtconsole | runs ipython in QT window |
| jupyter notebook | runs the IPython notebook server |
| ipython –help | IPython man page |
def
keywordreturn
keywordCall external system commands
who
from os.path import *
who
exists(silverlight_plugin_path)
isdir(silverlight_plugin_path)
islink("/etc")
headers = {'Accept': 'application/json'}
r = requests.get(url, headers=headers)
r.text
r.json()
r.json()['joke']
url = 'https://api.openbrewerydb.org/breweries?by_city=new_york'
r = requests(url)
r.json()
for brewery in r.json():
print(brewery['name'], "Street: ", brewery['street'])
url = 'https://api.openbrewerydb.org/breweries'
query = {'by_city': 'new_york'}
r = requests.get(url, params=query)
r.json()
r.url
auth=('xworld', 'passwd')
base_url=('https://twxworld.jamfcloud.com/JSSResource/')
url = base_url + 'categories'
cat = requests.get(url, auth=auth)
cat.text
cat.xml
import xml.etree.ElementTree as ET
root = ET.fromstring(cat.text)
categories = root.findall('category')
for i in categories:
print(i.find('id').text, i.find('name').text)
url = base_url + 'categories/id/3'
cat = requests.get(url, auth=auth)
root = ET.fromstring(cat.text)
root.find('name').text
root.find('name').text = "Changed"
new = ET.tostring(root)
ret = requests.put(url, auth=auth, data=new)
ret.status_code
ret.text
root.find('name').text = 'Inserted'
root.find('id').text = '0'
new = ET.tostring(root)
url = base_url + 'categories/id/0'
ret = requests.post(url, auth=auth, data=new)
ret.status_code
ret.text


Ryan Munge
Student at Moringa
Hey there,
So about me is that am student at moringa doing prep.Joined because I feel
what i've been doing for the past one year hasn't been of much help.
I feel moringa school
will help me in acquiring the practical skills of the computer world.Being 19 feels like there's
the pressure of having to do big things like coding, programming and other computer things.


Last week I worked on implementing LU decomposition on GPGPU using SYCL DPC++. Being a pretty useful method for solving system of linear equations, finding determinant & inverse of matrix, I thought it is worth taking a look at this problem, where I attempt to implement its SIMD form, capable of running in high throughput machine --- GPGPUs. My objective will be to split a given matrix AN x N into lower & upper triangular matrices LN x N, UN x N respectively such that
I'll start working with an example, where I go through steps of algorithm while talking about its respective SIMD implementation. I choose to work with following matrix.
As I know I've to split A into L & U, I start by taking two square matrices, initially setting L = IN x N & U = A.
As LU decomposition is just forward elimination step of Gauss-Jordan method, used for solving system of linear equations, while recording elementary row operation's in LN x N --- I start working on column0, hoping to zero out all cells below pivot U0, 0. First I record these elementary row operations in LN x N, which has all pivots set to 1.
Resulting LN x N looks like below
Now I zero out all elements below U0, 0 while applying row operation across whole rows of submatrix of UN x N. I can express it in following snippet of pseudocode.
Resulting UN x N must look like below, where marked submatrix was operated on.
From first iteration of elimination step, where I worked to zero out elements below U0, 0 , it can clearly understood updation of L & U can go side by side. After each round of elimination where Ui, i is chosen to be pivot of interest, original matrix A can be updated by content of updated U as my interest during next iteration ( when Ui+1, i+1 becomes pivot ) will be to clean up cells below chosen pivot Ui+1, i+1, while recording elementary row operations in LN x N.
Current pivot is U1, 1 & I record elimination steps in LN x N, resulting into following L.
In parallel I also update marked submatrix of UN x N, resulting into following.
After copying UN x N into AN x N, I select U2, 2 as pivot in final elimination step. In parallel updation of both L & U results into following matrices.
There's one more pivot in U i.e. U3, 3, which doesn't need to be processed anyhow as there's no forward elimination step which can be performed with this pivot. Also both L & U are in desired triangular form. Just to assert that LU decomposition worked, I do L x U, resulting into A.
As LU decomposition has data dependency on previous iterations, I have to offload computation
into GPGPU in multiple iterations. Selecting each pivot is done on host machine, while processing
of selected pivot i.e. forward elimination in U & recording of respective elementary row operations in L
are performed on GPGPU. Another thing to notice, in each iteration during elimination of cells below selected pivot,
dimension of submatrix under operation keeps decreasing.
I can express scope of parallelism in LU decomposition using following diagram.
SIMD LU decomposition's performance turns out to be satisfactory. I was expecting better performance with a 1024 x 1024 random dense matrix. I note, one definite reason behind not-so-good performance is after each iteration I'm performing large copy from UN x N to AN x N. Also as dimension of operable sub-matrix keeps decreasing after each iteration, lots of work items are just doing nothing useful --- huge loss !
My interest in coming days will be to figure out a way to reduce lost computation cycles, where lots of work items are doing nothing as they're pointing to cell
which doesn't belong to current operable sub-matrix.
I'll also like to take a look at how I can reduce amount of back and forth memcpy(s), which are expensive. I keep current SIMD implementation of LU factorization
here for future reference.
Have a great time !


git checkout -- this is the easy way
Hard way (site):
Use GitTools
Some typical default files in a git directory:
HEAD
objects/info/packs
description
config
COMMIT_EDITMSG
index
packed-refs
refs/heads/master
refs/remotes/origin/HEAD
refs/stash
logs/HEAD
logs/refs/heads/master
logs/refs/remotes/origin/HEAD
info/refs
info/exclude
Have to essentially guess, hash and request files while rebuilding the structure of the repo
These files either refer an object by its hash or another file referencing an object and so on. Thus the easiest way is to start with downloading and parsing the aforementioned files. We need to parse these to continue to download the object files.
So for example, we have downloaded the refs/heads/master file:
cat .git/refs/heads/master
6916ae52c0b20b04569c262275d27422fc4fcd34
The reference master points to a commit with the hash 6916ae52c0b20b04569c262275d27422fc4fcd34. After downloading the commit-object from the server (note the url should be .git/objects/69/16ae52c0b20b04569c262275d27422fc4fcd34), we can analyse it further:
git cat-file -t 6916ae52c0b20b04569c262275d27422fc4fcd34
commit
This tells us, that the downloaded object is indeed a commit. Let’s get some details about it:
git cat-file -p 6916ae52c0b20b04569c262275d27422fc4fcd34
tree fa3887a0b798346c122afdd7c5ecc605bf3c18c0
parent 9264d57c621f66208d689ef653ce8a62c3bccfae
author XY <foo@bar><PHONE_NUMBER> +0200
committer XY <foo@bar><PHONE_NUMBER> +0200
Added another readme file
Okay, now we know the hash of the related tree and parent object as well as some information about the author, the committer and the commit message.
We download the tree-object and analyse it:
git cat-file -p fa3887a0b798346c122afdd7c5ecc605bf3c18c0
040000 tree 532fc6055e09e0a2d5602f4b84c0dbadce1b5f3e Dumper
040000 tree 077ce769dedcf19d0f063246256e8ae0394fd8df Extractor
040000 tree d6e1bd4677a256e760cce5ddaa7db7ea6f9a8900 Finder
100644 blob 9670cf17dfeec351c395493058044b9f9dadbe2a README.md
This tells us which files are stored in that tree. Note that Dumper, Extractor and Finder are also trees (directories). The final step is to download the README.md blob object and cat its content:
git cat-file -p 9670cf17dfeec351c395493058044b9f9dadbe2a
Git Tools
=============
[...]
We need to take special care of packed files. We can find a list of all packs in .git/objects/info/packs
cat .git/objects/info/packs
P pack-e38660e6be24bb79d8d929ddea3d194e0dd3cd13.pack
The appropiate pack file is stored in .git/objects/pack/:
/usr/bin/ls .git/objects/pack/
pack-e38660e6be24bb79d8d929ddea3d194e0dd3cd13.idx
pack-e38660e6be24bb79d8d929ddea3d194e0dd3cd13.pack
In that case, we need to download both files and then run the following command to extract the packed data:
git unpack-objects -r < .git/objects/pack/pack-e38660e6be24bb79d8d929ddea3d194e0dd3cd13.pack
Unpacking objects: 100% (15/15), done.
As you can see, by doing this procedure recursively and for every possible hash, which we find in the already downloaded files, we can slowly restore the repository and extract the contents.
Sometimes downloading a specific object will fail, leaving us with an incomplete repository. In that case, we can use git fsck command to search for these missing/broken object files.


Preparation time
less than 30 mins
Cooking time
no cooking required
Serves
Serves 6
Serve these dumplings either with the beetroot sauce suggested, or you could use a shop-bought relish.
For the dumplings, beat the eggs and milk together in a bowl. Add the chopped ham and pork, breadcrumbs and parmesan, mix until well combined and mould into six small balls.
Place the balls on a plate or tray and chill the dumplings in the fridge for 20 minutes.
Heat the oil and butter in a frying pan and fry the dumplings for eight minutes, turning regularly, until golden-brown all over. Remove from the pan and set aside to drain on kitchen paper. Keep warm.
Fry the black pudding in the same pan for 2-3 minutes on each side, or until crisp, then set aside to drain on kitchen paper. Keep warm.
Meanwhile, for the red wine sauce, heat the oil in a frying pan and fry the onion for 4-5 minutes, or until softened. Add the beetroot, wine, stock and thyme.
Bring the mixture to the boil and cook for 20 minutes, then blend with a hand-held blender to a purée. Pass the sauce through a fine sieve, then return to the pan and heat until the volume of the liquid has reduced by half. Whisk in the butter.
To serve, place a spoonful of sauce onto serving plates, top with a slice of black pudding followed by a dumpling.


Kirkland Lake Gold to buy Detour Gold for $4.89 billion
The deal is expected to generate pre-tax savings of about $75 to $100 million per year
by ReutersCanadian miner Kirkland Lake Gold Ltd said on Monday it would buy smaller rival Detour Gold Corp for about $4.89 billion in an all-stock deal, as it looks to scale up its mining operations and boost reserves.
Kirkland Lake Gold offered 0.4343 shares to Detour Gold shareholders for each share held.
Acquisitions in the sector have been scarce in recent years as miners focused on cost cutting, but the need to bolster shrinking reserves to boost growth and take advantage of rising gold prices are providing the impetus for consolidation.
The deal, representing a premium of 23.8 per cent as on Friday’s close, is expected to generate pre-tax savings of about $75 to $100 million per year, the companies said in a statement.
On completion of the deal, Kirkland Lake Gold and Detour Gold shareholders will own about 73 per cent and 27 per cent, respectively, of the merged company.
RBC Capital Markets was financial adviser to Kirkland Lake Gold and BMO Capital Markets to Kirkland Lake Gold.
© Thomson Reuters 2019


1.When does JavaScript code appear inline within an HTML file?
2.What will be done if more than one page requires a file of JavaScript code?
3.Which object is the main entry point to all client-side JavaScript features and APIs?
4.Which built-in method returns the characters in a string beginning at the specified location?
5. The behaviour of the instances present of a class inside a method is defined by
6. The basic difference between JavaScript and Java is
7. The keyword or the property that you use to refer to an object through which they were invoked is
8. What is the default value of the type attribute?
9. How many default number methods are available in JavaScript?
10. Which of the following attribute of form tag is not set by using document object in JavaScript?
GET RESULT:


Skip to main content
Accessible Checkbox Cookie Consent
Full name
User name
I agree to the Privacy Policy


Flutter App designed in Figma developed in dart.
This page will get your geo location and will give information about your current weather situation.
I have designed and developed a service providing website using technologies like HTML, CSS, Bootstrap, JavaScript etc.
JavaScript based Palindrome Game where players have to guess palindrome words 1st one to score 5 points wins the game.
This SEO based website helped the company to gain 20% more production.
I am a hard working problem solver and innovator with leadership skills who loves to design, develop and build responsive websites as well as mobile apps other than that I love to learn new things, new technologies, new opportunities so to challenge myself to solve problems also I love to interact with others. I have experience in both website as well as flutter apps designing & development. I have developed and launched websites as well as apps for companies.
Download CVI have developed responsive websites and apps for the companies which led their production rate incresased by more than 20%.
I also love to design and develop flutter apps and use figma to design the layout and prototype of the app first then build the responsive app for web as well as phones.
I can write articles for SEO blogs, proofread it, edit images as well as videos using Adobe softwares and can provide high quality fast work in minimun time possible.


Fill in and submit the form, then reload the page, start to fill in the form again - and see how autocomplete works.
Then, try to set autocomplete to "off".
Note: The autocomplete attribute of the form element is not supported in Opera 12 and earlier versions.


Participated in the International Collegiate Programming contest two years in a row. Namely the 2015 ICPC WF in Morocco, and the ICPC WF in Thailand.
Took many roles in local and regional ACM ICPC contests including Coach, Problem setter, Judge and Volunteer, and conducted many training camps for other local universities.
Candidate Master of Codeforces, Top 10% rating, Also contributed with some contests to the training gym.
Designed and Developed Systems with various technologies, for various platforms, and for various clients. My experience is still building, I've come a long way but I still have so much to learn!
I like solving puzzles, math problems, playing Computer Games (Who doesn't xD) Tomb Raider is one of my favorites!
I love playing Volleyball, swimming, hiking trips. I hate politics, religion and war.
I'd like to call myself an ambitious young engineer looking to make the next big thing!


Pitso Hints At Zwane & Sirino Return Date
by Soccer LadumaWhile he did not give a conclusive medical report on his Mamelodi Sundowns midfield duo, coach Pitso Mosimane this week suggested a likely return date for the injured pair of Themba Zwane and Gaston Sirino.
They both sat out Sundowns’ 3-2 defeat against Golden Arrows in an Absa Premiership clash played at a rain-soaked Sugar Ray Xulu Stadium as the weekend.
Read: Pitso's Plight - 'Four Provinces In Five Days'
Zwane was also forced to withdraw from the Bafana Bafana squad that travelled to Ghana for an Africa Cup of Nations qualifier on tonight.
“We refreshed the team and kept (Tiyani) Mabunda and (Hlompho) Kekana out as well as (Lebo) Maboe. We needed to freshen up the team. And we also had (Sibusiso) Vilakazi on the bench because we believed in the team that played could beat Arrows, and the first half said that,” Mosimane told reporters.
The coach added that he expected them to return after the Fifa international break – ahead of Downs returning to the same venue for the Telkom Knockout semifinal clash on November 23.
“We need to keep our players ready for the programme that’s coming – obviously the Fifa break will give us some time to get Themba Zwane back and Gaston Sirino back, hopefully. When we come back here next time we will be at full force. We controlled the match and we believed that the players we fielded can do the job,” Mosimane said.
Read: Strong Advice For Keeper Who Snubbed Bafana


Welcome all music lovers, give yourself a chance to discover lyrics from songs which can open your eyes towards a greater artist horizon with the same taste in music. This project will provide all kinds of artist that are mutual towards the lyrics being searched. N0teDr0p - It only takes one drop to produce strings to call the correct function for your music passion.
Troy Berentsen
Wendy Hintzen
Kouassi Kevin Kouadio
Rociorios
Christopher Crook


Functions | |
| FX_EXPORT const char * | fx_get_usr_uid (void) |
| get a current user is uid | |
| FX_EXPORT const char * | fx_get_usr_passwd (void) |
| get a current user is passwd | |
| FX_EXPORT const char * | fx_get_usr_show_name (void) |
| get a current user is name | |
| FX_EXPORT const char * | fx_get_usr_uri (void) |
| get a current user is uir | |
| FX_EXPORT const char * | fx_get_usr_mobilenum (void) |
| get a current user is mobile number | |
| FX_EXPORT int | fx_get_usr_score (void) |
| get the user is score | |
| FX_EXPORT int | fx_set_user_state (int state, char *desc, EventListener func, void *args) |
| set the user state. | |
| FX_EXPORT int | fx_get_user_state (void) |
| get the user state. | |
| FX_EXPORT int | fx_set_user_impresa (const char *impresa, EventListener func, void *args) |
| set the user impresa. | |
| FX_EXPORT int | fx_set_user_nickname (const char *nickname, EventListener func, void *args) |
| set the user nickname. | |
| FX_EXPORT int | fx_get_user_refuse_sms_day (void) |
| get the user how long day to receive the sms message. | |
| FX_EXPORT int | fx_set_user_refuse_sms_day (int day, EventListener func, void *args) |
| set the user how long day to receive the sms message. | |
| FX_EXPORT int | fx_get_expirestime (void) |
| get the expires time of the fetion. | |
| FX_EXPORT const Fetion_Personal * | fx_data_get_PersonalInfo (void) |
| get a current user is personal info |
| const Fetion_Personal * fx_data_get_PersonalInfo | ( | void | ) |
get a current user is personal info
| int fx_get_expirestime | ( | void | ) |
get the expires time of the fetion.
you should once the expires time to invoke the fetion_keep_alive functions to keep your fetion alive.
| int fx_get_user_refuse_sms_day | ( | void | ) |
get the user how long day to receive the sms message.
This function get the usr fetion day.
| int fx_get_user_state | ( | void | ) |
get the user state.
This function get the usr fetion state.
| const char * fx_get_usr_mobilenum | ( | void | ) |
get a current user is mobile number
| const char * fx_get_usr_passwd | ( | void | ) |
get a current user is passwd
| int fx_get_usr_score | ( | void | ) |
get the user is score
| const char * fx_get_usr_show_name | ( | void | ) |
get a current user is name
| const char * fx_get_usr_uid | ( | void | ) |
get a current user is uid
| const char * fx_get_usr_uri | ( | void | ) |
get a current user is uir
| int fx_set_user_impresa | ( | const char * | impresa, | |
| EventListener | func, | |||
| void * | args | |||
| ) |
set the user impresa.
| impresa | The impresa which you want to set. |
| int fx_set_user_nickname | ( | const char * | nickname, | |
| EventListener | func, | |||
| void * | args | |||
| ) |
set the user nickname.
| nickname | The nickname which you want to set. |
| int fx_set_user_refuse_sms_day | ( | int | day, | |
| EventListener | func, | |||
| void * | args | |||
| ) |
set the user how long day to receive the sms message.
| day | The day which you want to set, if day = 0, show will receive sms, or it is the refuse sms days. . |
| int fx_set_user_state | ( | int | state, | |
| char * | desc, | |||
| EventListener | func, | |||
| void * | args | |||
| ) |
set the user state.
This function set the usr fetion state.
| state | The state which you want to set. | |
| desc | If you set the state is by your self define, set the connect of desc. |


What makes a good question a good question?
Good question. Of course, this question is being asked in the context of app/software/web development. So far, I've picked up the following keys to a good question:
Give all the info needed to answer the question. This seems to be a big one in the development world. But this goes for all types of questions. I try to anticipate being on the other end of the question, asking myself "What would I need to know to answer this question?" Sometimes, a lot. Here is a question on Stack Overflow in which the questioner includes a whole bunch of information from the start. (Note also that no one had to ask this person for more info to answer the question.)
Give all the ways you already tried to answer the question. This helps others know what you already did, thus avoiding the "Did you try this yet?" "Yes, I tried that already, it doesn't work" exchange, which is a waste of everyone's time. If you already tried a few ways to solve the issue, let everyone else know so they don't waste time trying the same thing. Also, this helps others learn your train of thought on how to solve this question, and the avenues you already tried, giving others the opportunity to try something completely different (since you already tried the most obvious ways to solve the issue). The above linked Stack Overflow questioner also does this.
State the question using correct names for each part of the question. This can require a lot of thinking and perhaps research. Often we may not be aware of the correct name for something, especially in development, since there are so many pieces to the puzzle. Also our questions can get quite dense, again because there are so many pieces. But the work put into wording the question with correct names will pay off with answers that actually answer your issue.
State the ultimate goal in your question. Sometimes we box ourselves in by assuming there is only one way to get where we want to go, so we ask questions to get that one way, instead of asking how to get to the ultimate goal. When we do this, we are handcuffing everyone else from thinking through various ways to the ultimate goal, since we only asked about how we could attain to a specific way toward that ultimate goal. Many questioners never indicate what they are ultimately after, and are only focused on a specific way to get there.
Hopefully this helps us ask better questions!


aria2 provides JSON-RPC over HTTP and XML-RPC over HTTP interfaces that offer basically the same functionality. aria2 also provides JSON-RPC over WebSocket. JSON-RPC over WebSocket uses the same method signatures and response format as JSON-RPC over HTTP, but additionally provides server-initiated notifications. See JSON-RPC over WebSocket section for more information.
The request path of the JSON-RPC interface (for both over HTTP and over
WebSocket) is /jsonrpc
. The request path of the XML-RPC interface is
/rpc
.
The WebSocket URI for JSON-RPC over WebSocket is
ws://HOST:PORT/jsonrpc
. If you enabled SSL/TLS encryption, use
wss://HOST:PORT/jsonrpc
instead.
The implemented JSON-RPC is based on JSON-RPC 2.0 <http://jsonrpc.org/specification>, and supports HTTP POST and GET (JSONP). The WebSocket transport is an aria2 extension.
The JSON-RPC interface does not support notifications over HTTP, but the RPC server will send notifications over WebSocket. It also does not support floating point numbers. The character encoding must be UTF-8.
When reading the following documentation for JSON-RPC, interpret structs as JSON objects.
GID
The GID (or gid) is a key to manage each download. Each download will be assigned a unique GID. The GID is stored as 64-bit binary value in aria2. For RPC access, it is represented as a hex string of 16 characters (e.g.,2089b05ecca3d829
). Normally, aria2 generates this GID for each download, but the user can specify GIDs manually using the--gid
option. When querying downloads by GID, you can specify only the prefix of a GID as long as it is unique among others.
All code examples are compatible with the Python 2.7 interpreter. For information on the secret parameter, see RPC authorization secret token.
aria2.
addUri
([secret, ]uris[,
options[, position]])This method adds a new download. uris is an array of HTTP/FTP/SFTP/BitTorrent URIs (strings) pointing to the same resource. If you mix URIs pointing to different resources, then the download may fail or be corrupted without aria2 complaining. When adding BitTorrent Magnet URIs, uris must have only one element and it should be BitTorrent Magnet URI. options is a struct and its members are pairs of option name and value. See Options below for more details. If position is given, it must be an integer starting from 0. The new download will be inserted at position in the waiting queue. If position is omitted or position is larger than the current size of the queue, the new download is appended to the end of the queue. This method returns the GID of the newly registered download.
JSON-RPC Example
The following example adds http://example.org/file
:
>>> import urllib2, json >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.addUri', ... 'params':[['http://example.org/file']]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
XML-RPC Example
The following example adds http://example.org/file
:
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.addUri(['http://example.org/file']) '2089b05ecca3d829'
The following example adds a new download with two sources and some options:
>>> s.aria2.addUri(['http://example.org/file', 'http://mirror/file'], dict(dir="/tmp")) 'd2703803b52216d1'
The following example adds a download and inserts it to the front of the queue:
>>> s.aria2.addUri(['http://example.org/file'], {}, 0) 'ca3d829cee549a4d'
[, uris[, options[, position]]])
This method adds a BitTorrent download by uploading a ".torrent" file.
If you want to add a BitTorrent Magnet URI, use the aria2.addUri()
method instead. torrent must be a base64-encoded string containing the
contents of the ".torrent" file.
uris is an array of URIs (string). uris is used for
Web-seeding. For single file torrents, the URI can be a complete URI
pointing to the resource; if URI ends with /, name in torrent file
is added. For multi-file torrents, name and path in torrent are
added to form a URI for each file.
options is a struct and its members are pairs of option name and value.
See Options below for more details.
If position is given, it must be an integer starting from 0. The new
download will be inserted at position in the waiting queue. If
position is omitted or position is larger than the current size of the
queue, the new download is appended to the end of the queue.
This method returns the GID of the newly registered download.
If --rpc-save-upload-metadata
is true
, the
uploaded data is saved as a file named as the hex string of SHA-1 hash of
data plus ".torrent" in the directory specified by --dir
option. E.g. a
file name might be
0a3893293e27ac0490424c06de4d09242215f0a6.torrent
. If a file with the
same name already exists, it is overwritten! If the file cannot be saved
successfully or --rpc-save-upload-metadata
is false
,
the downloads added by this method are not saved by --save-session
.
The following examples add local file file.torrent
.
JSON-RPC Example
>>> import urllib2, json, base64 >>> torrent = base64.b64encode(open('file.torrent').read()) >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'asdf', ... 'method':'aria2.addTorrent', 'params':[torrent]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) '2089b05ecca3d829'
[, options[, position]])
This method adds a Metalink download by uploading a ".metalink" file.
metalink is a base64-encoded string which contains the contents of the
".metalink" file.
options is a struct and its members are pairs of option name and value.
See Options below for more details.
If position is given, it must be an integer starting from 0. The new
download will be inserted at position in the waiting queue. If
position is omitted or position is larger than the current size of the
queue, the new download is appended to the end of the queue.
This method returns an array of GIDs of newly registered downloads.
If --rpc-save-upload-metadata
is true
, the uploaded data
is saved as a file named hex string of SHA-1 hash of data plus
".metalink" in the directory specified by --dir
option. E.g. a file name might be
0a3893293e27ac0490424c06de4d09242215f0a6.metalink
. If a file with the
same name already exists, it is overwritten! If the file cannot be saved
successfully or --rpc-save-upload-metadata
is false
,
the downloads added by this method are not saved by
--save-session
.
The following examples add local file file.meta4.
JSON-RPC Example
>>> import urllib2, json, base64 >>> metalink = base64.b64encode(open('file.meta4').read()) >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.addMetalink', ... 'params':[metalink]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}'
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4', mode='rb').read())) ['2089b05ecca3d829']
aria2.
remove
([secret, ]gid)This method removes the download denoted by gid (string). If the specified
download is in progress, it is first stopped. The status of the removed
download becomes removed
.
This method returns GID of removed download.
The following examples remove a download with GID#2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.remove', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.remove('2089b05ecca3d829') '2089b05ecca3d829'
)
This method removes the download denoted by gid. This method
behaves just like aria2.remove()
except that this method removes
the download without performing any actions which take time, such as
contacting BitTorrent trackers to unregister the download first.
aria2.
pause
([secret, ]gid)This method pauses the download denoted by gid (string). The status of
paused download becomes paused
. If the download was active, the download
is placed in the front of waiting queue. While the status is paused
,
the download is not started. To change status to waiting
, use the
aria2.unpause()
method.
This method returns GID of paused download.
aria2.
pauseAll
([secret])This method is equal to calling aria2.pause()
for every
active/waiting
download. This methods returns OK
.
)
This method pauses the download denoted by gid. This method
behaves just like aria2.pause()
except that this method pauses
downloads without performing any actions which take time, such as contacting
BitTorrent trackers to unregister the download first.
aria2.
forcePauseAll
([secret])This method is equal to calling aria2.forcePause()
for
every
active/waiting download. This methods returns OK
.
)
This method changes the status of the download denoted by gid (string) from
paused
to waiting
, making the download eligible to be restarted.
This method returns the GID of the unpaused download.
aria2.
unpauseAll
([secret])This method is equal to calling aria2.unpause()
for every
paused
download. This methods returns OK
.
[, keys])
This method returns the progress of the download denoted by gid (string).
keys is an array of strings. If specified, the response contains only keys
in the keys array. If keys is empty or omitted, the response contains all
keys. This is useful when you just want specific keys and avoid unnecessary
transfers.
For example, aria2.tellStatus("2089b05ecca3d829", ["gid", "status"])
returns the gid and status keys only. The response is a struct and
contains following keys. Values are strings.
gid
status
active
for currently downloading/seeding downloads.
waiting
for downloads in the queue; download is not started.
paused
for paused downloads.
error
for downloads that were stopped because of error.
complete
for stopped and completed downloads.
removed
for the downloads removed by user.totalLength
completedLength
uploadLength
bitfield
downloadSpeed
uploadSpeed
infoHash
numSeeders
seeder
true
if the local endpoint is a seeder. Otherwise false
.
BitTorrent only.pieceLength
numPieces
connections
errorCode
errorMessage
errorCode
.followedBy
--follow-metalink
option). This value is useful to track
auto-generated downloads. If there are no such downloads, this key will not
be included in the response.following
followedBy
. A download included in
followedBy
has this object's GID in its following
value.belongsTo
dir
files
aria2.getFiles()
method.bittorrent
Struct which contains information retrieved from the .torrent (file). BitTorrent only. It contains following keys.
announceList
announce
and no announce-list
, announce
is converted to the
announce-list
format.comment
comment.utf-8
is used if available.creationDate
mode
single
or multi
.info
Struct which contains data from Info dictionary. It contains following keys.
name
name.utf-8
is used if available.verifiedLength
verifyIntegrityPending
true
if this download is waiting for the hash check in a
queue. This key exists only when this download is in the queue.JSON-RPC Example
The following example gets information about a download with GID#2089b05ecca3d829:
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.tellStatus', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'bitfield': u'0000000000', u'completedLength': u'901120', u'connections': u'1', u'dir': u'/downloads', u'downloadSpeed': u'15158', u'files': [{u'index': u'1', u'length': u'34896138', u'completedLength': u'34896138', u'path': u'/downloads/file', u'selected': u'true', u'uris': [{u'status': u'used', u'uri': u'http://example.org/file'}]}], u'gid': u'2089b05ecca3d829', u'numPieces': u'34', u'pieceLength': u'1048576', u'status': u'active', u'totalLength': u'34896138', u'uploadLength': u'0', u'uploadSpeed': u'0'}}
The following example gets only specific keys:
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.tellStatus', ... 'params':['2089b05ecca3d829', ... ['gid', ... 'totalLength', ... 'completedLength']]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'completedLength': u'5701632', u'gid': u'2089b05ecca3d829', u'totalLength': u'34896138'}}
XML-RPC Example
The following example gets information about a download with GID#2089b05ecca3d829:
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.tellStatus('2089b05ecca3d829') >>> pprint(r) {'bitfield': 'ffff80', 'completedLength': '34896138', 'connections': '0', 'dir': '/downloads', 'downloadSpeed': '0', 'errorCode': '0', 'files': [{'index': '1', 'length': '34896138', 'completedLength': '34896138', 'path': '/downloads/file', 'selected': 'true', 'uris': [{'status': 'used', 'uri': 'http://example.org/file'}]}], 'gid': '2089b05ecca3d829', 'numPieces': '17', 'pieceLength': '2097152', 'status': 'complete', 'totalLength': '34896138', 'uploadLength': '0', 'uploadSpeed': '0'}
The following example gets only specific keys:
>>> r = s.aria2.tellStatus('2089b05ecca3d829', ['gid', 'totalLength', 'completedLength']) >>> pprint(r) {'completedLength': '34896138', 'gid': '2089b05ecca3d829', 'totalLength': '34896138'}
)
This method returns the URIs used in the download denoted by gid (string). The response is an array of structs and it contains following keys. Values are string.
uri
status
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getUris', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'status': u'used', u'uri': u'http://example.org/file'}]}
XML-RPC Example
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getUris('2089b05ecca3d829') >>> pprint(r) [{'status': 'used', 'uri': 'http://example.org/file'}]
)
This method returns the file list of the download denoted by gid (string). The response is an array of structs which contain following keys. Values are strings.
index
path
length
completedLength
completedLength
is less than the
completedLength
returned by the aria2.tellStatus()
method.
This is because completedLength
in
aria2.getFiles()
only includes completed pieces. On the other hand, completedLength
in aria2.tellStatus()
also includes partially completed
pieces.selected
true
if this file is selected by --select-file
option. If
--select-file
is not specified or this is single-file torrent or
not a torrent download at all, this value is always true
. Otherwise
false
.uris
aria2.getUris()
method.JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getFiles', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'index': u'1', u'length': u'34896138', u'completedLength': u'34896138', u'path': u'/downloads/file', u'selected': u'true', u'uris': [{u'status': u'used', u'uri': u'http://example.org/file'}]}]}
XML-RPC Example
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getFiles('2089b05ecca3d829') >>> pprint(r) [{'index': '1', 'length': '34896138', 'completedLength': '34896138', 'path': '/downloads/file', 'selected': 'true', 'uris': [{'status': 'used', 'uri': 'http://example.org/file'}]}]
)
This method returns a list peers of the download denoted by gid (string). This method is for BitTorrent only. The response is an array of structs and contains the following keys. Values are strings.
peerId
ip
port
bitfield
amChoking
true
if aria2 is choking the peer. Otherwise false
.peerChoking
true
if the peer is choking aria2. Otherwise false
.downloadSpeed
uploadSpeed
seeder
true
if this peer is a seeder. Otherwise false
.JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getPeers', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'amChoking': u'true', u'bitfield': u'ffffffffffffffffffffffffffffffffffffffff', u'downloadSpeed': u'10602', u'ip': u'<IP_ADDRESS>', u'peerChoking': u'false', u'peerId': u'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6', u'port': u'6881', u'seeder': u'true', u'uploadSpeed': u'0'}, {u'amChoking': u'false', u'bitfield': u'ffffeff0fffffffbfffffff9fffffcfff7f4ffff', u'downloadSpeed': u'8654', u'ip': u'<IP_ADDRESS>', u'peerChoking': u'false', u'peerId': u'bittorrent client758', u'port': u'37842', u'seeder': u'false', u'uploadSpeed': u'6890'}]}
XML-RPC Example
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getPeers('2089b05ecca3d829') >>> pprint(r) [{'amChoking': 'true', 'bitfield': 'ffffffffffffffffffffffffffffffffffffffff', 'downloadSpeed': '10602', 'ip': '<IP_ADDRESS>', 'peerChoking': 'false', 'peerId': 'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6', 'port': '6881', 'seeder': 'true', 'uploadSpeed': '0'}, {'amChoking': 'false', 'bitfield': 'ffffeff0fffffffbfffffff9fffffcfff7f4ffff', 'downloadSpeed': '8654', 'ip': '<IP_ADDRESS>', 'peerChoking': 'false', 'peerId': 'bittorrent client758', 'port': '37842', 'seeder': 'false, 'uploadSpeed': '6890'}]
)
This method returns currently connected HTTP(S)/FTP/SFTP servers of the download denoted by gid (string). The response is an array of structs and contains the following keys. Values are strings.
index
servers
A list of structs which contain the following keys.
uri
currentUri
downloadSpeed
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getServers', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'index': u'1', u'servers': [{u'currentUri': u'http://example.org/file', u'downloadSpeed': u'10467', u'uri': u'http://example.org/file'}]}]}
XML-RPC Example
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getServers('2089b05ecca3d829') >>> pprint(r) [{'index': '1', 'servers': [{'currentUri': 'http://example.org/dl/file', 'downloadSpeed': '20285', 'uri': 'http://example.org/file'}]}]
aria2.
tellActive
([secret][,
keys])This method returns a list of active downloads. The response is an array of
the same structs as returned by the aria2.tellStatus()
method.
For the keys parameter, please refer to the aria2.tellStatus()
method.
[, keys])
This method returns a list of waiting downloads, including paused
ones.
offset is an integer and specifies the offset from
the download waiting at the front.
num is an integer and specifies the max. number of downloads to be returned.
For the keys parameter, please refer to the aria2.tellStatus()
method.
If offset is a positive integer, this method returns downloads in the range of [offset, offset + num).
offset can be a negative integer. offset == -1 points last download in the waiting queue and offset == -2 points the download before the last download, and so on. Downloads in the response are in reversed order then.
For example, imagine three downloads "A","B" and "C" are waiting
in this order. aria2.tellWaiting(0, 1)
returns
["A"]
. aria2.tellWaiting(1, 2)
returns ["B", "C"]
.
aria2.tellWaiting(-1, 2)
returns ["C", "B"]
.
The response is an array of the same structs as returned by
aria2.tellStatus()
method.
[, keys])
This method returns a list of stopped downloads.
offset is an integer and specifies the offset from the least recently
stopped download.
num is an integer and specifies the max. number of downloads to be returned.
For the keys parameter, please refer to the aria2.tellStatus()
method.
offset and num have the same semantics as described in the
aria2.tellWaiting()
method.
The response is an array of the same structs as returned by the
aria2.tellStatus()
method.
aria2.
changePosition
([secret, ]gid, pos,
how)This method changes the position of the download denoted by
gid in the queue.
pos is an integer.
how is a string. If how is POS_SET
, it moves the download to a
position relative to the beginning of the queue. If how is POS_CUR
, it
moves the download to a position relative to the current position. If how is
POS_END
, it moves the download to a position relative to the end of the
queue. If the destination position is less than 0 or beyond the end of
the queue, it moves the download to the beginning or the end of the
queue respectively. The response is an integer denoting the resulting
position.
For example, if GID#2089b05ecca3d829 is currently in position 3,
aria2.changePosition('2089b05ecca3d829', -1, 'POS_CUR')
will
change its position to 2. Additionally
aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET')
will
change its position to 0 (the beginning of the queue).
The following examples move the download GID#2089b05ecca3d829 to the front of the queue.
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.changePosition', ... 'params':['2089b05ecca3d829', 0, 'POS_SET']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': 0}
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET') 0
aria2.
changeUri
([secret, ]gid, fileIndex,
delUris, addUris[, position])This method removes the URIs in delUris from and appends the URIs in
addUris to download denoted by gid. delUris and addUris are
lists of strings. A download can contain multiple files and URIs are
attached to each file. fileIndex is used to select which file to
remove/attach given URIs. fileIndex is 1-based. position is used
to specify where URIs are inserted in the existing waiting URI
list. position is 0-based. When position is omitted, URIs are
appended to the back of the list. This method first executes the removal
and then the addition. position is the position after URIs are removed,
not the position when this method is called. When removing an URI, if
the same URIs exist in download, only one of them is removed for each URI
in delUris. In other words, if there are three URIs
http://example.org/aria2
and you want remove them all, you have to
specify (at least) 3 http://example.org/aria2
in delUris. This
method returns a list which contains two integers. The first integer is
the number of URIs deleted. The second integer is the number of URIs
added.
The following examples add the URI http://example.org/file
to the
file whose index is 1
and belongs to the download
GID#2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.changeUri', ... 'params':['2089b05ecca3d829', 1, [], ['http://example.org/file']]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [0, 1]}
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.changeUri('2089b05ecca3d829', 1, [], ['http://example.org/file']) [0, 1]
)
This method returns options of the download denoted by gid. The response is a struct where keys are the names of options. The values are strings. Note that this method does not return options which have no default value and have not been set on the command-line, in configuration files or RPC methods.
The following examples get options of the download GID#2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getOption', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'allow-overwrite': u'false', u'allow-piece-length-change': u'false', u'always-resume': u'true', u'async-dns': u'true', ...
XML-RPC Example
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getOption('2089b05ecca3d829') >>> pprint(r) {'allow-overwrite': 'false', 'allow-piece-length-change': 'false', 'always-resume': 'true', 'async-dns': 'true', ....
)
This method changes options of the download denoted by gid (string) dynamically. options is a struct. The options listed in Input File subsection are available, except for following options:
Except for the following options, changing the other options of active download makes it restart (restart itself is managed by aria2, and no user intervention is required):
bt-max-peers
bt-request-peer-speed-limit
bt-remove-unselected-file
force-save
max-download-limit
max-upload-limit
This method returns OK
for success.
The following examples set the max-download-limit
option to 20K
for the download
GID#2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.changeOption', ... 'params':['2089b05ecca3d829', ... {'max-download-limit':'10K'}]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.changeOption('2089b05ecca3d829', {'max-download-limit':'20K'}) 'OK'
aria2.
getGlobalOption
([secret])This method returns the global options. The response is a struct. Its keys
are the names of options. Values are strings.
Note that this method does not return options which have no default
value and have not been set on the command-line, in configuration
files or RPC methods. Because global options are used as a template
for the options of newly added downloads, the response contains keys
returned by the aria2.getOption()
method.
)
This method changes global options dynamically. options is a struct. The following options are available:
bt-max-open-files
download-result
keep-unfinished-download-result
log
log-level
max-concurrent-downloads
max-download-result
max-overall-download-limit
max-overall-upload-limit
optimize-concurrent-downloads
save-cookies
save-session
server-stat-of
In addition, options listed in the Input File subsection
are available, except for following options:
checksum
,
index-out
,
out
,
pause
and
select-file
.
With the log
option, you can dynamically start logging or
change log file. To stop logging, specify an empty string("") as the parameter
value. Note that log file is always opened in append mode. This method
returns OK
for success.
aria2.
getGlobalStat
([secret])This method returns global statistics such as the overall download and upload speeds. The response is a struct and contains the following keys. Values are strings.
downloadSpeed
uploadSpeed
numActive
numWaiting
numStopped
--max-download-result
option.numStoppedTotal
--max-download-result
option.JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getGlobalStat'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'downloadSpeed': u'21846', u'numActive': u'2', u'numStopped': u'0', u'numWaiting': u'0', u'uploadSpeed': u'0'}}
XML-RPC Example
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getGlobalStat() >>> pprint(r) {'downloadSpeed': '23136', 'numActive': '2', 'numStopped': '0', 'numWaiting': '0', 'uploadSpeed': '0'}
aria2.
purgeDownloadResult
([secret])This method purges completed/error/removed downloads to free memory.
This method returns OK
.
)
This method removes a completed/error/removed download denoted by gid
from memory. This method returns OK
for success.
The following examples remove the download result of the download GID#2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.removeDownloadResult', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.removeDownloadResult('2089b05ecca3d829') 'OK'
aria2.
getVersion
([secret])This method returns the version of aria2 and the list of enabled features. The response is a struct and contains following keys.
version
enabledFeatures
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getVersion'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'enabledFeatures': [u'Async DNS', u'BitTorrent', u'Firefox3 Cookie', u'GZip', u'HTTPS', u'Message Digest', u'Metalink', u'XML-RPC'], u'version': u'1.11.0'}}
XML-RPC Example
>>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getVersion() >>> pprint(r) {'enabledFeatures': ['Async DNS', 'BitTorrent', 'Firefox3 Cookie', 'GZip', 'HTTPS', 'Message Digest', 'Metalink', 'XML-RPC'], 'version': '1.11.0'}
aria2.
getSessionInfo
([secret])This method returns session information. The response is a struct and contains following key.
sessionId
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getSessionInfo'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'sessionId': u'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}}
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.getSessionInfo() {'sessionId': 'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}
aria2.
forceShutdown
([secret])This method shuts down aria2()
. This method behaves like
:func:'aria2.shutdown` without performing any actions which take time,
such as contacting BitTorrent trackers to unregister downloads first.
This method returns OK
.
aria2.
saveSession
([secret])This method saves the current session to a file specified by the
--save-session
option. This method returns OK
if it
succeeds.
system.
multicall
(methods)This methods encapsulates multiple method calls in a single request.
methods is an array of structs. The structs contain two keys:
methodName
and params
. methodName
is the
method name to call and params
is array containing parameters to the
method call. This method returns an array of responses. The elements
will be either a one-item array containing the return value of the
method call or a struct of fault element if an encapsulated method call
fails.
In the following examples, we add 2 downloads. The first one is
http://example.org/file
and the second one is file.torrent
.
JSON-RPC Example
>>> import urllib2, json, base64 >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'system.multicall', ... 'params':[[{'methodName':'aria2.addUri', ... 'params':[['http://example.org']]}, ... {'methodName':'aria2.addTorrent', ... 'params':[base64.b64encode(open('file.torrent').read())]}]]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [[u'2089b05ecca3d829'], [u'd2703803b52216d1']]}
JSON-RPC additionally supports Batch requests as described in the JSON-RPC 2.0 Specification:
>>> jsonreq = json.dumps([{'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.addUri', ... 'params':[['http://example.org']]}, ... {'jsonrpc':'2.0', 'id':'asdf', ... 'method':'aria2.addTorrent', ... 'params':[base64.b64encode(open('file.torrent').read())]}]) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) [{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'2089b05ecca3d829'}, {u'id': u'asdf', u'jsonrpc': u'2.0', u'result': u'd2703803b52216d1'}]
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> mc = xmlrpclib.MultiCall(s) >>> mc.aria2.addUri(['http://example.org/file']) >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) >>> r = mc() >>> tuple(r) ('2089b05ecca3d829', 'd2703803b52216d1')
system.
listMethods
()This method returns all the available RPC methods in an array of string. Unlike other methods, this method does not require secret token. This is safe because this method just returns the available method names.
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'system.listMethods'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [u'aria2.addUri', u'aria2.addTorrent', ...
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.system.listMethods() ['aria2.addUri', 'aria2.addTorrent', ...
system.
listNotifications
()This method returns all the available RPC notifications in an array of string. Unlike other methods, this method does not require secret token. This is safe because this method just returns the available notifications names.
JSON-RPC Example
>>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'system.listNotifications'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [u'aria2.onDownloadStart', u'aria2.onDownloadPause', ...
XML-RPC Example
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.system.listNotifications() ['aria2.onDownloadStart', 'aria2.onDownloadPause', ...
Over JSON-RPC, aria2 returns a JSON object which contains an error code in
code
and the error message in message
.
Over XML-RPC, aria2 returns faultCode=1
and the error message in
faultString
.
The same options as for --input-file
are available. See the
Input File subsection for a complete list of options.
In the option struct, the name element is the option name (without the preceding
--
) and the value element is the argument as a string.
{'split':'1', 'http-proxy':'http://proxy/'}
<struct> <member> <name>split</name> <value><string>1</string></value> </member> <member> <name>http-proxy</name> <value><string>http://proxy/</string></value> </member> </struct>
The header
and index-out
options are allowed multiple times on the command-line. Since the name should be
unique in a struct (many XML-RPC library implementations use a hash or dict for
struct), a single string is not enough. To overcome this limitation, you may use
an array as the value as well as a string.
{'header':['Accept-Language: ja', 'Accept-Charset: utf-8']}
<struct> <member> <name>header</name> <value> <array> <data> <value><string>Accept-Language: ja</string></value> <value><string>Accept-Charset: utf-8</string></value> </data> </array> </value> </member> </struct>
The following example adds a download with two options: dir
and header
.
The header
option requires two values, so it uses a list:
>>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> opts = dict(dir='/tmp', ... header=['Accept-Language: ja', ... 'Accept-Charset: utf-8']) >>> s.aria2.addUri(['http://example.org/file'], opts) '1'
The JSON-RPC interface also supports requests via HTTP GET. The encoding scheme in GET parameters is based on JSON-RPC over HTTP Specification [2008-1-15(RC1)]. The encoding of GET parameters are follows:
/jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS
The method
and id
are always treated as JSON string and their
encoding must be UTF-8.
For example, The encoded string of
aria2.tellStatus('2089b05ecca3d829')
with id='foo'
looks like
this:
/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
The params
parameter is Base64-encoded JSON array which usually
appears in params
attribute in JSON-RPC request object. In the
above example, the params is ["2089b05ecca3d829"]
, therefore:
["2089b05ecca3d829"] --(Base64)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0= --(Percent Encode)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
The JSON-RPC interface also supports JSONP. You can specify the callback
function in the jsoncallback
parameter:
/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb
For Batch requests, the method
and id
parameters must not be specified.
The whole request must be specified in the params
parameter. For example,
a Batch request:
[{'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.getVersion'}, {'jsonrpc':'2.0', 'id':'asdf', 'method':'aria2.tellActive'}]
must be encoded like this:
/jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D
JSON-RPC over WebSocket uses same method signatures and response format as JSON-RPC over HTTP. The supported WebSocket version is 13 which is detailed in RFC 6455.
To send a RPC request to the RPC server, send a serialized JSON string in a Text frame. The response from the RPC server is delivered also in a Text frame.
The RPC server might send notifications to the client. Notifications is unidirectional, therefore the client which receives the notification must not respond to it. The method signature of a notification is much like a normal method request but lacks the id key. The value of the params key is the data which this notification carries. The format of the value varies depending on the notification method. Following notification methods are defined.
aria2.
onDownloadStart
(event)This notification will be sent when a download is started. The event is of type struct and it contains following keys. The value type is string.
gid
aria2.
onDownloadPause
(event)This notification will be sent when a download is paused. The event
is the same struct as the event argument of
aria2.onDownloadStart()
method.
aria2.
onDownloadStop
(event)This notification will be sent when a download is stopped by the user.
The event is the same struct as the event argument of
aria2.onDownloadStart()
method.
aria2.
onDownloadComplete
(event)This notification will be sent when a download is complete. For
BitTorrent downloads, this notification is sent when the download is
complete and seeding is over. The event is the same struct of the
event argument of
aria2.onDownloadStart()
method.
aria2.
onDownloadError
(event)This notification will be sent when a download is stopped due to an error.
The event is the same struct as the event argument of
aria2.onDownloadStart()
method.
aria2.
onBtDownloadComplete
(event)This notification will be sent when a torrent download is complete but seeding
is still going on. The event is the same struct as the event argument of
aria2.onDownloadStart()
method.
The following Ruby script adds http://localhost/aria2.tar.bz2
to
aria2c (running on localhost) with option --dir=/downloads
and
prints the RPC response:
#!/usr/bin/env ruby require 'xmlrpc/client' require 'pp' client=XMLRPC::Client.new2("http://localhost:6800/rpc") options={ "dir" => "/downloads" } result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options) pp result
If you are a Python lover, you can use xmlrpclib (Python3 uses xmlrpc.client instead) to interact with aria2:
import xmlrpclib from pprint import pprint s = xmlrpclib.ServerProxy("http://localhost:6800/rpc") r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"}) pprint(r)


| DOSE: T+ 0:00 |
9.0 g |
oral |
Kratom |
(plant material) |
| T+ 2:00 |
1 repeated |
smoked |
Cannabis |
(plant material) |
| T+ 2:00 |
1 repeated |
inhaled |
Cannabis |
(plant material) |
This will be a pretty brief report, but it was abnormal and interesting so I will relay my experience nonetheless.
For the sake of completion, I should mention that two days ago, I ingested a combination of 2C-T-21 and 2C-C. I don't feel this had anything to do with my experience, but I thought I'd mention it.
At 7:00pm, I ingested 9 grams of kratom after not having had it for longer than usual.  Anyway, the kratom hit me much harder and with greater euphoria than it has in a long time, another perk to cutting way back. I settled down with my girlfriend to watch some TV. As it happens, I was watching a Roseanne marathon (again).
At about 9:00, or T+2:00, I decided to smoke some cannabis. I had smoked it once earlier that day, around 6:30, but it had mostly worn off. The kratom was still in effect but no longer at peak. I took three vaporizer pulls as well as shared a bowl with my girlfriend, in rapid succession. Both devices had a mixture of very high quality White Widow and L.S.D. (a very good newish strain by BOG seeds) in them, and the bowl additionally had a thin layer of pure kief on top. I hit the vaporizer first, and after finishing the bowl next, I laid back and continued to watch TV.
I noticed that I was becoming extremely high, moreso than usual. I find that kratom adds a very good element to marijuana. The combination of the two can be pretty psychedelic. Kratom primarily enhances the physical buzz of cannabis by making me more able to feel my field of energy. Cannabis on its own causes this effect moreso than almost anything else I've used, which is in my opinion why it is so synergistic with psychedelics and almost any other drug. It is a very physically psychedelic substance, even after I become used to it and the mental elements become routine. With kratom added, it feels as if waves of electrical energy are running up and down my body and leaping outward, forming loops which reconnect with my body elsewhere. The patterns of energy roughly form the visual of a group of closed rings of energy that sprout from my body randomly and reconnect somewhere else, surrounding me in a sort of cocoon.
Anyway, I felt so good and psychedelic that I closed my eyes for a bit, as doing so, I've found, can dramatically increase the physical and mental aspects of any high by dissociating me from my surroundings and focusing me entirely upon the aspects of my high. This time was more dramatic than it has ever been without being in a partial sleep state.
I quickly dissociated from where I really was. The body high grew and grew exponentially until it felt nearly salvia-like, with points of great gravity or pressure running around my body, especially my legs - down, down, down, light speed, even faster. I gradually lost awareness of the sounds of the TV and began to realize I was somewhere else. At this point I was unaware I had taken any drugs, but wide awake. I was still aware I was laying down. I began to feel a great pressure on my chest, and I began struggling to breathe. It felt like my throat was extremely narrow and I had to force air to pass through it into my lungs. I was slightly alarmed but I was able to continue breathing so I rode it out. And besides, this was my reality at the moment and I felt I had no choice.
I knew I was me, but I didn't know who 'me' was other than this nexus of perceptions I was experiencing. I became aware of some sort of entity that was communicating with me. I can't remember what was being communicated anymore, although I was very aware at the time and right after I regained awareness of my surroundings. It felt very important though. We were in disagreement but the entity was clearly a figure of authority of some sort. My feeling was one of wariness and sheepish acceptance of what the entity was saying. I was not able to actually physically see anything during this experience, as I had my eyes closed, but nevertheless I was able to perceive information about where I was. I was in some sort of room, laying down on my back (in reality I was on my side). I was unable to move but was fully conscious and awake. I felt no fear but the experience was not really enjoyable either. It felt very serious and slightly alarming due to the difficulty in breathing effectively.
After some communication and some other significant events that I cannot recall anymore, I felt as if I was receiving energy from somewhere. My body felt charged and was buzzing extremely strongly, to the point of producing a soundless but still very loud 'noise'. I was buzzing so hard it tickled, and at that point I became aware once again that I was laying down with my eyes closed, and that I was this guy named Xorkoth and so forth. I opened my eyes and immediately I was totally out of the state I had been in. I looked at the clock and realized I'd only been away for about a minute. Subjectively it felt longer, but only maybe about 10 minutes long, not an eternity or anything. I immediately told my girlfriend about it in more detail than I was able to here, since I had more of it in my memory then.
The experience was very odd and similar to another experience I had with kratom and weed a while back, where I was repeatedly thrown into lucid dreams that were indistinguishable from reality in every way, where I was embedded 3 to 4 layers deep in those dreams. I then woke up and had sleep paralysis for several minutes where I couldn't move at all and found it very hard to breathe. This experience was similar, but it was a total removal of consensual reality into a very psychedelic state, whereas the previous experience was just like reality, only it wasn't. The difficulty breathing was identical, but it seemed to be a perceived difficulty in breathing rather than an actual one, because in both cases, the instant I snapped out, I was able to breathe normally.
The speed and total removal of the state really took me by surprise. It reaffirms to me the psychedelic power of marijuana, when used properly. If one wills themselves into altered states with it, it's possible to have some pretty profound experiences with it, even when you use it every day like I do.
When I get home later today I'll ask my girlfriend what I said to her about it right afterwards, and perhaps she'll be able to refresh me somewhat. If that's the case, I'll add to this.
Just wanted to share because I found it interesting. Has anyone else had any experiences like this?
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Who am I?
University Education
Born in Strasbourg (France) in 1989, I grew up and made all my education in Alsace. After my school certificate at the Notre-Dame de Sion middle school (Strasbourg) and my high school diploma at the Louis Couffignal high school (Strasbourg), I have joined the University of Strasbourg in 2007.Son of an accountant and of a teacher of accounting, brother of an accounter, it was natural for me to study chemical physics. I started with a Bachelor in Mathematics, Physics, and Chemistry (2007-2011), and continued with a Master degree in Physics and Chemistry, with a specialisation in Teaching science (2011-2013) in order to prepare the French habilitation for teaching Physics and Chemistry in middle and high schools. I went on with a second Master degree, in Material Physics and Nanoscience (2013-2014), to gather more knowledge on Physics and prepare myself for a PhD.
Top of the year, I've made both of my internships and Master theses at the Institut Charles Sadron (Strasbourg), first under the supervision of Prof. Thierry CHARITAT then with Dr. Fouzia BOULMEDAIS. After getting the French habilitation for teaching in middle and high schools (CAPES, 2014) and a grant from the French government, I started my PhD in Biophysics under the supervision of Dr. Carlos MARQUES at the Institut Charles Sadron; and successfully defended my thesis in 2017.
Research Interest
My current interests in research are mostly revolving around the lipids and lipid membranes physics and chemical physics, and their interactions with biomolecules and macromolecules. I use for my research multiple techniques, from optical microscopy to molecular dynamics simulations. After working a while with fluorescence microscopy, both epi- and confocal laser scanning microscopy, I started to work with interferometric microscopy, notably interferometric scattering microscopy (iSCAT). In the same time, I gained an increasing interest in numerical simulations, and I started learning Gromacs to run my own personal project on lipid phase transitions.A key part of my research is programmation. It is indeed critical for me to interface the microscope I am using with a computer, using LabVIEW for instance; but also to process and analyse all the data collected in microscopy and through numerical simulations, which I often do with Python or Java (for ImageJ). I also use other common or uncommon languages, such as Bash, C, C++, HTML, CSS or Ti-Basic. Knowing so many different languages is possible thanks to my curiosity and dedication, but mostly for my passion for algorithmic on which depend all programmation languages. Together with my other passion for statistics and Machine Learning, my programmation skills built my dedication to Data Science.
Hobbies and passions
I sustain a huge interest in art in general: writing, painting/drawing, music, movie, etc.My interest for illustrations and drawings is perfectly integrated in my research activites. Using softwares for illustrations, such as Adobe Photoshop, Adobe Illustrator, Gimp or Inkscape, I always look forward to realise my own diagrams, illustrations and templates for my presentations, articles, and many more. Of course, I also create illustrations without any relation to my work. Besides creating paintings (acrylic paint, pastel, charchoal, etc.) and portraits, I used my spare time as an undergrad making a webcomic in collaboration with students from the USA.
Still during my time at the University, I started getting a lot of interests in creating videos, and specifically short movies. I took part for 6 years to short movies festivals and contests, in particular the Marathon Video of Strasbourg (1st price in amateur category). I used my skills in video-making to make a short movie for a CNRS-hosted contest in 2015.
After learning music theory and trombon in my youth, I learnt how to play bass guitar by myself when I went to the College, and joined a heavy metal band until I started my PhD. It allowed me to go on tour in France and Europe and had a lot of fun.
Resume
If you want to know what are my current work experience and what was my academic formation, you will find all the information here. For more details on my CV, feel free to download the pdf version below.Work Experience
-
PostDoctoral Research Associate — 2018 - present
King's College London ( London (UK) ) -
PostDoctoral Research Associate — 2017 - 2018
Institut Charles Sadron ( Strasbourg (FR) ) -
Ph.D. Student & Teaching Assistant — 2014 - 2017
Institut Charles Sadron ( Strasbourg (FR) )
Academic Formation
-
Ph.D. in Biophysics — 2014 - 2017
Institut Charles Sadron ( Strasbourg (FR) ) -
M.Sc. in Physics of Materials — 2013 - 2014
Universite de Strasbourg ( Strasbourg (FR) ) -
M.Sc. in Physics & Chemistry — 2011 - 2013
Universite de Strasbourg ( Strasbourg (FR) ) -
B.Sc. in Maths, Physics & Chemistry — 2007 - 2011
Universite de Strasbourg ( Strasbourg (FR) )
COMPLETE RESUME
Contact
I am currently based at the Department of Chemistry of the King's College London (London, UK). To contact me, you can use any of the links you can find on this page on the Follow me sections, or just simply use my email address.If you are interested to work with me, please contact the group leader Prof. Mark I Wallace to discuss the opportunities currently available.
Outreach and Work experience
As a former teacher, I have a natural interest in outreach activities to share my research with a wide audience. This include participation to the Science Week at the Science Museum of London or to the Big Bang Day at the The City Academy in Hackney. I am always looking for new opportunities to go out of the lab and present my research or just science in general. If you are looking for a volunteer, feel free to contact me.Inside the lab, my interest for outreach is expressed both by my involvement in public relations, for instance by designing and creating Research Postcards to present the projects of all the researchers working at the Department of Chemistry. I am also in charge of taking students for week-long work experiences to present the job of a researcher in Academia.


Python packages should (must?) have a version. It would be best if that
version string was a semantic version, but this article
is not about how your version string should look like. It's about how to have
a consistent version string on PyPI and accessible via
[yourpackage].__version__
- and preferably make sure it is the same as used
in git tag
.
setup.py
should have the version string in the setup function:
from setuptools import setup
setup(version=__version__)
Having this makes sure that the correct version is on PyPI and you can work
with that version via pip (e.g. pip freeze
). But if you import the package
via import [yourpackage]
and execute [yourpackage].__version__
it might not
be present. Also, if you have a command line application, you have to make sure
yourself that there is a --version
command. And you definitely should do
that; it comes in handy.
There is an official guide for "single-sourcing the package version". So it is a know problem with known solutions. I only wrap them up here.
The Manual Approach
setup.py:
from setuptools import setup
setup(version="0.1.2")
[yourpackage]/init.py:
__version__ = "0.1.2"
Positive:
- No new dependencies
- It is super simple to understand
Negative:
- You can easily get inconsistencies by forgetting something
Version Python File
setup.py:
from setuptools import setup
exec(open("[yourpackage]/_version.py").read())
setup(version=__version__)
[yourpackage]/init.py:
from yourpackage._version import __version__
[yourpackage]/_version.py:
__version__ = "0.1.2"
Positive:
- No new dependencies
- Relatively simple
- Consistent
Negative:
- You use
exec
, about which linters complain as it is a security risk if used wrong. mypy
cannot know that the__version__
variable is set in thesetup.py
. It will giveerror: Name '__version__' is not defined
.
Version Text File
Similar to the solution above, we use a text file which only contains the version string.
setup.py:
from setuptools import setup
def read(file_name):
"""Read a text file and return the content as a string."""
with io.open(
os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8"
) as f:
return f.read()
setup(version=read("[yourpackage]/version.txt"))
[yourpackage]/init.py:
from yourpackage._version import __version__
[yourpackage]/_version.py:
__version__ = "0.1.2"
Reading setup.py
This approach is so bad that I don't want to post an example here. The idea
is that you can have the version in the setup(version='fooversion')
and read
that within the package to set the __version__
.
Reasons why I strongly suggest not to do so:
- Your package source could be simply copied, not installed. For example, if
things run on AWS Lambda. In this case, there is not
setup.py
file. So all solutions with this break. - You have to write rather complex parsers to be robust to changes in
setup.py
External Build Tools
There are bumpversion,
changes and zest.releaser.
I don't have experience with those tools, but from a very quick first look I
don't think they the first two look reliable enough to give them a try. And
zest.releaser
looks a bit complicated.
Package import
setup.py:
from setuptools import setup
import yourpackage
setup(version=yourpackage.__version__)
[yourpackage]/init.py:
yourpackage._version = "0.1.2"
Positive:
- No new dependencies
- Very simple simple
- Consistent
Negative:
- Fails, if you import a dependency in the
__init__.py
.
Version Control Integration
You can use setuptools_scm
and do the following:
setup.py:
from setuptools import setup
setup(..., use_scm_version=True, setup_requires=["setuptools_scm"], ...)
[yourpackage]/init.py:
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass
Positive:
- git tags: You might have to / be able to use git tags to keep consistent versions. I'm not sure if this is the case, though.
Negative:
- Your package source could be simply copied, not installed. For example, if
things run on AWS Lambda. In this case, there is not
setup.py
file. So all solutions with this break.
Reading Version String Management in Python: Introducing python-versioneer, I want to highlight some parts:
Thinking about how I use git these days, I realized that I want my release process to have one step: “git tag” (well, and a “git push” to tell the world about it). Everything else should be automated: building tarballs, uploading them to a release server, updating a web page, sending an announcement email, pypi registration, etc. What really matters is the release manager making the decision to bless some well-tested revision id with a public name of some sort.
What others do
| Package | setup.py | package | Versioning Scheme |
|---|---|---|---|
| Scipy | Manual | ? | Semantic |
| Numpy | Manual | ? | Semantic |
| Pillow | exec py | manual | Semantic |
| boto3 | regex `__init__.py` | manual | Semantic |
| natsort | manual | manual | semantic |
| mantplotlib | versioneer | ? | ? |
| Pandas | versioneer | ? | ? |
| scikit-learn | import of sklearn.__version__ | manual | semantic |
| tensorflow | ? | ? | ? |
| pytorch | manual | ? | ? |
| seaborn | manual | manual | semantic |
| Flask | regex `__init__.py` | manual | semantic |
| Django | import of django.__version__ | manual | semantic |
| pytest | `use_scm_version` | ? | ? |
| tox | `use_scm_version` | pluggy |


|
|
|---|
|
|
|---|
|
Variable Name
|
|---|
| Gene: |
Recent Genes:
Group
Foreground
Background
Exclude genes expressed in
less than m cells:
less than m cells:
m =
Max Size =


15 June 2006
The Ministry of Health in Indonesia has confirmed the country’s 50th case of human infection with the H5N1 avian influenza virus.
The case, which was fatal, occurred in a 7-year-old girl from Tangerang district, Banten Province. She developed symptoms on 26 May, was hospitalized on 30 May, and died on 1 June. Her 10-year-old brother died of respiratory disease on 29 May, but no specimens were taken for testing and the cause of his death cannot be determined.
An investigation found a history of chicken deaths in the household and neighbourhood prior to symptom onset. Laboratory testing of surviving family members and close contacts has been conducted and no further cases were found.
Of the 50 cases confirmed to date in Indonesia, 38 have been fatal.


Updated to Office 2007. Outlook's startup time seems abysmal, but instant search is a godsend.
10/27/2008, 12:33:17 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Updated to Office 2007. Outlook's startup time seems abysmal, but instant search is a godsend.
10/27/2008, 12:33:17 PM
Favs: 0
Retweets: 0
link