MediaWiki category-page relation
Do categories that a page belong to are saved in the MediaWiki schema? I
want fetch all pages that have a specific category.
Thursday, 3 October 2013
Wednesday, 2 October 2013
Can you make Golang drop packets on writes rather than block?
Can you make Golang drop packets on writes rather than block?
Given a channel of length N, I want to write to it only if it is not full.
Else I will drop this packet and process the next one.
Is this possible in GOlang
Given a channel of length N, I want to write to it only if it is not full.
Else I will drop this packet and process the next one.
Is this possible in GOlang
Installing project's dependencies globally and running the project without `node=?iso-8859-1?Q?=5Fmodules/`_=97_how=3F?=
Installing project's dependencies globally and running the project without
`node_modules/` — how?
I decided to try learning DerbyJS and this is my first acquaintance with
NodeJS either.
I create a new Node/Derby project with derby new foo. This also creates a
node_modules/ folder which contains a copy of all packages the project
depends on.
The node_modules/ subdir of a blank Derby project is 144 MB large and
contains 12967 files (sic!). As a person familiar with Ruby's RubyGems,
RVM and Bundler, i find this insane. I can't express how wrong it is
(actually i've got some solid argumentation against that craziness but
StackOverflow is not a place for debate).
I thought that npm's -g flag would help me. I could install all packages
globally, i told myself. So i did:
derby new -n foo
cd foo
sudo npm install -g
Now my project weighs 152 KB and contains 24 files. Now that's reasonable.
But i fail to run it. When i do npm start, i get "Cannot find module
'express'":
lolmaus@sandy:~/hello_derby2$ npm start
> hello_derby2@0.0.0 start /home/lolmaus/hello_derby2
> node server.js
Master pid 29884
module.js:340
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous>
(/home/lolmaus/hello_derby2/lib/server/index.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
So the question is: how do install project's dependencies into a central
local repository and run the project without beating the f#@k out of my
Dropbox account?
`node_modules/` — how?
I decided to try learning DerbyJS and this is my first acquaintance with
NodeJS either.
I create a new Node/Derby project with derby new foo. This also creates a
node_modules/ folder which contains a copy of all packages the project
depends on.
The node_modules/ subdir of a blank Derby project is 144 MB large and
contains 12967 files (sic!). As a person familiar with Ruby's RubyGems,
RVM and Bundler, i find this insane. I can't express how wrong it is
(actually i've got some solid argumentation against that craziness but
StackOverflow is not a place for debate).
I thought that npm's -g flag would help me. I could install all packages
globally, i told myself. So i did:
derby new -n foo
cd foo
sudo npm install -g
Now my project weighs 152 KB and contains 24 files. Now that's reasonable.
But i fail to run it. When i do npm start, i get "Cannot find module
'express'":
lolmaus@sandy:~/hello_derby2$ npm start
> hello_derby2@0.0.0 start /home/lolmaus/hello_derby2
> node server.js
Master pid 29884
module.js:340
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous>
(/home/lolmaus/hello_derby2/lib/server/index.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
So the question is: how do install project's dependencies into a central
local repository and run the project without beating the f#@k out of my
Dropbox account?
linux redhat 6 and installing easy_install
linux redhat 6 and installing easy_install
I'm completely new at this and needed a bit of help.
I've got a hosted server running Linux Redhat 6 and using Python 2.7
(which has just been set as the default from Python 2.6) located at
/usr/local/bin/python2.7
I'm trying to setup easy_install on the server, but I'm not sure if i'm
doing it correctly, on the bash screen i'm running: sudo apt-get install
python-setuptools
But it keeps asking for a sudo password, which i'm assuming is my normal
admin password that i've used to login via SSH? I've used my admin
password and my root password which both don't seem to work, can any one
help? Maybe it's an over sight from my side (being a newbie). Thanks
Gareth
I'm completely new at this and needed a bit of help.
I've got a hosted server running Linux Redhat 6 and using Python 2.7
(which has just been set as the default from Python 2.6) located at
/usr/local/bin/python2.7
I'm trying to setup easy_install on the server, but I'm not sure if i'm
doing it correctly, on the bash screen i'm running: sudo apt-get install
python-setuptools
But it keeps asking for a sudo password, which i'm assuming is my normal
admin password that i've used to login via SSH? I've used my admin
password and my root password which both don't seem to work, can any one
help? Maybe it's an over sight from my side (being a newbie). Thanks
Gareth
Tuesday, 1 October 2013
bootstrap collapse add class for open item
bootstrap collapse add class for open item
I have used bootstrap framework for display collapsible panels in my
webpage. By default the first panel is open. I need to add class to the
opened panel's head on page load. If i click any panel the class should be
removed. How to do this?
I have used bootstrap framework for display collapsible panels in my
webpage. By default the first panel is open. I need to add class to the
opened panel's head on page load. If i click any panel the class should be
removed. How to do this?
DesignTime Data
DesignTime Data
I have an ItemsControl that is bound at runtime to data fetched from the
web. but I'd like to be able to preview its item template in the visual
designer. I'm able to do this in WPF, but not in windows phone.
I've tried to check for DesignerProperties.IsInDesignTool in the
constructor of the page and if true add the items manually to the items
control, but it doesn't work.
I considered having a static resource with a list of items and binding to
it, but there's no <x:Array> in windows phone also.
I also tried setting ItemsSource="{d:DesignInstance
IsDesignTimeCreatable=True, Type=src:MyType, CreateList=True}" but it also
didn't work
I have an ItemsControl that is bound at runtime to data fetched from the
web. but I'd like to be able to preview its item template in the visual
designer. I'm able to do this in WPF, but not in windows phone.
I've tried to check for DesignerProperties.IsInDesignTool in the
constructor of the page and if true add the items manually to the items
control, but it doesn't work.
I considered having a static resource with a list of items and binding to
it, but there's no <x:Array> in windows phone also.
I also tried setting ItemsSource="{d:DesignInstance
IsDesignTimeCreatable=True, Type=src:MyType, CreateList=True}" but it also
didn't work
Thinkpad W530, cannot save to windows partition
Thinkpad W530, cannot save to windows partition
I recently purchased a Thinkpad W530 laptop from Lenovo with Windows 7 on
it. I installed Lubuntu 13.04 on it, and then mounted my OS partition in
Lubuntu 13.04. I have found that whenever I tried to save a file into this
partition (any file, any directory), Lubuntu seems to transfer or save the
files just fine, and I am able to edit them without any apparent errors in
Lubuntu. However, when I shutdown and reboot into Windows, not only are
those files GONE (not even hidden, actually gone) but when I shutdown and
reboot back into Lubuntu the files are gone there as well. In addition,
when I run a chkdsk in Windows, it shows that the files I transferred are
actually corrupted and must be deleted. I should mention that I had also
tried this same test by removing Lubuntu and using Xubuntu, with the same
results.
I have installed Ubuntu, Lubuntu, SUSE, and other distros on my previous
personal computers without any such problems ever arising. So, I am very
confused by this behavior. Does anyone have any advice regarding this
problem, or has anyone solved this problem on their own machines?
I recently purchased a Thinkpad W530 laptop from Lenovo with Windows 7 on
it. I installed Lubuntu 13.04 on it, and then mounted my OS partition in
Lubuntu 13.04. I have found that whenever I tried to save a file into this
partition (any file, any directory), Lubuntu seems to transfer or save the
files just fine, and I am able to edit them without any apparent errors in
Lubuntu. However, when I shutdown and reboot into Windows, not only are
those files GONE (not even hidden, actually gone) but when I shutdown and
reboot back into Lubuntu the files are gone there as well. In addition,
when I run a chkdsk in Windows, it shows that the files I transferred are
actually corrupted and must be deleted. I should mention that I had also
tried this same test by removing Lubuntu and using Xubuntu, with the same
results.
I have installed Ubuntu, Lubuntu, SUSE, and other distros on my previous
personal computers without any such problems ever arising. So, I am very
confused by this behavior. Does anyone have any advice regarding this
problem, or has anyone solved this problem on their own machines?
Help me understand the tensor product
Help me understand the tensor product
I have several books and other literature that define the tensor product,
but I understand none of them. Since this really concerns one topic,
namely understanding the construction of and arithmetic of (with?) tensor
products, I'll pose a few questions here instead of asking them
separately. I don't feel that the specific case of tensoring vector spaces
helps with understanding the general construction, so my questions will
deal with tensoring a right $R$-module with a left $R$-module over the
ring $R$, which we do not assume to be commutative.
1) Now then, the first step is to form the free abelian group $F(M \times
N)$. I've never stumbled upon free abelian groups prior to reading about
the tensor product, but it seems simple enough. Correct me if I'm wrong,
but $F(M \times N) = \{ \sum a_{ij}(m,n) \mid a_{ij} \in \mathbb{Z} \}$,
the sums ranging over all $(m,n) \in M \times N$. But some authors say
something else, which I trust is the same thing but nevertheless confuses
me. Keith Conrad (assuming $R$ is commutative) says $$R=\bigoplus_{(m,n)
\in M \times N} R \delta_{(m,n)}$$ without any mention of what
$\delta_{(m,n)}$ is, but it's probably similar to what I have in a
compendium (which also assumes the ring is commutative), "notation tagging
the component that corresponds to the element $(m,n) \in M \times N$".
What does that even mean, and why is that particular notation only used
when $R$ is assumed commutative?
2) Next define the subgroup $S \subset F(M \times N)$ generated by "all
elements of the following three types" $(a,b+b') - (a,b) - (a,b')$ etc.
Well, what does $-$ mean? Is an equivalence relation meant? If so, when
are they considered equivalent? I've only seen this along the lines of
"define $x,y$ to be equivalent if property $P(x,y)$ holds".
3) $M \otimes N$ is an abelian group. Fine, so how are elements "added"?
No mention of this is made in any of my literature, except that $a \otimes
(b+b') = a \otimes b + a \otimes b'$, but how about $a \otimes b + c
\otimes d$?
4) So-called elementary or pure tensors. Conrad writes "Tensors in $M
\otimes_R N$ that have the form $m \otimes n$ are called elementary
tensors". The elementary tensors span the tensor product (right?), but
what elements of $F(M \times N)$ wind up as elementary tensors? While my
compendium (which, as Conrad, assumes the ring to be commutative) also
makes note of elementary tensors, Rotman ("Introduction to Homological
Algebra"), not assuming commutativity, makes no mention of them, but says:
"Since $A \otimes_R B$ is generated by the elements of the form $a \otimes
b$, every $u \in A \otimes_R B$ has the form $u = \sum_i a_i \otimes b_i$.
This expression is not unique..." The other names for "elementary tensor"
which Conrad lists are not in the index to Rotman's book, so are
elementary tensors only relevant to tensoring over a commutative ring?
Thanks in advance for any help. I've had some homework regarding tensors
and I'm unable to take even a first step in answering the questions, so I
have to learn tensor products somehow.
Conrad: http://www.math.uconn.edu/~kconrad/blurbs/linmultialg/tensorprod.pdf
I have several books and other literature that define the tensor product,
but I understand none of them. Since this really concerns one topic,
namely understanding the construction of and arithmetic of (with?) tensor
products, I'll pose a few questions here instead of asking them
separately. I don't feel that the specific case of tensoring vector spaces
helps with understanding the general construction, so my questions will
deal with tensoring a right $R$-module with a left $R$-module over the
ring $R$, which we do not assume to be commutative.
1) Now then, the first step is to form the free abelian group $F(M \times
N)$. I've never stumbled upon free abelian groups prior to reading about
the tensor product, but it seems simple enough. Correct me if I'm wrong,
but $F(M \times N) = \{ \sum a_{ij}(m,n) \mid a_{ij} \in \mathbb{Z} \}$,
the sums ranging over all $(m,n) \in M \times N$. But some authors say
something else, which I trust is the same thing but nevertheless confuses
me. Keith Conrad (assuming $R$ is commutative) says $$R=\bigoplus_{(m,n)
\in M \times N} R \delta_{(m,n)}$$ without any mention of what
$\delta_{(m,n)}$ is, but it's probably similar to what I have in a
compendium (which also assumes the ring is commutative), "notation tagging
the component that corresponds to the element $(m,n) \in M \times N$".
What does that even mean, and why is that particular notation only used
when $R$ is assumed commutative?
2) Next define the subgroup $S \subset F(M \times N)$ generated by "all
elements of the following three types" $(a,b+b') - (a,b) - (a,b')$ etc.
Well, what does $-$ mean? Is an equivalence relation meant? If so, when
are they considered equivalent? I've only seen this along the lines of
"define $x,y$ to be equivalent if property $P(x,y)$ holds".
3) $M \otimes N$ is an abelian group. Fine, so how are elements "added"?
No mention of this is made in any of my literature, except that $a \otimes
(b+b') = a \otimes b + a \otimes b'$, but how about $a \otimes b + c
\otimes d$?
4) So-called elementary or pure tensors. Conrad writes "Tensors in $M
\otimes_R N$ that have the form $m \otimes n$ are called elementary
tensors". The elementary tensors span the tensor product (right?), but
what elements of $F(M \times N)$ wind up as elementary tensors? While my
compendium (which, as Conrad, assumes the ring to be commutative) also
makes note of elementary tensors, Rotman ("Introduction to Homological
Algebra"), not assuming commutativity, makes no mention of them, but says:
"Since $A \otimes_R B$ is generated by the elements of the form $a \otimes
b$, every $u \in A \otimes_R B$ has the form $u = \sum_i a_i \otimes b_i$.
This expression is not unique..." The other names for "elementary tensor"
which Conrad lists are not in the index to Rotman's book, so are
elementary tensors only relevant to tensoring over a commutative ring?
Thanks in advance for any help. I've had some homework regarding tensors
and I'm unable to take even a first step in answering the questions, so I
have to learn tensor products somehow.
Conrad: http://www.math.uconn.edu/~kconrad/blurbs/linmultialg/tensorprod.pdf
Subscribe to:
Posts (Atom)