openwrt mkfs.ext4 fails on huawei hg556a [migrated]
i am trying to create a partition on an external disk and format it using
mkfs.ext4, but i am receiving the following error:
root@OpenWrt:/# mkfs.ext4 /dev/sda4
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4784128 inodes, 19109334 blocks
955466 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
584 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208,
4096000, 7962624, 11239424
Allocating group tables: done
mkfs.ext4: Operation not supported while zeroing block 19109312 at end of
filesy
stem
Writing inode tables: done
Creating journal (32768 blocks): mkfs.ext4: Operation not supported
while trying to create journal
Saturday, 17 August 2013
Calculating limits (with working)
Calculating limits (with working)
Let f(x) = sqrt x^2-3x and g(x) = x. calculate the following limits,
showing all working.
I've done the first two -
lim f(x) x ¡æ 0
= lim f(x) = ¡î(x©÷ -3x) = 0 x ¡æ 0
lim f (x) / g (x) x ¡æ−¡Ä
= lim f (x) / g (x) = [{¡î(x©÷ -3x)}/x] = [¡î{(1 -(3/x)}] = 1 x ¡æ−¡Ä
How do I calculate this one?
lim (f(x) - g(x)) x ¡æ¡Ä
Let f(x) = sqrt x^2-3x and g(x) = x. calculate the following limits,
showing all working.
I've done the first two -
lim f(x) x ¡æ 0
= lim f(x) = ¡î(x©÷ -3x) = 0 x ¡æ 0
lim f (x) / g (x) x ¡æ−¡Ä
= lim f (x) / g (x) = [{¡î(x©÷ -3x)}/x] = [¡î{(1 -(3/x)}] = 1 x ¡æ−¡Ä
How do I calculate this one?
lim (f(x) - g(x)) x ¡æ¡Ä
Friday, 16 August 2013
Force Close in use "ContactsContract.CommonDataKinds.StructuredName"
Force Close in use "ContactsContract.CommonDataKinds.StructuredName"
I want to get first name and last name separately from contacts.
But when I use the following procedure, the program has a run time error.
(Unfortunately, XXX has stopped.)
Where is the problem?
thanks.
private void PrintContacts(Cursor c){
if(c.moveToFirst()){
do{
String contactID =
c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));
**String contactGivenName =
c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME));**
Toast.makeText(this, contactGivenName,
Toast.LENGTH_SHORT).show();
}while(c.moveToNext());
}
}
I want to get first name and last name separately from contacts.
But when I use the following procedure, the program has a run time error.
(Unfortunately, XXX has stopped.)
Where is the problem?
thanks.
private void PrintContacts(Cursor c){
if(c.moveToFirst()){
do{
String contactID =
c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));
**String contactGivenName =
c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME));**
Toast.makeText(this, contactGivenName,
Toast.LENGTH_SHORT).show();
}while(c.moveToNext());
}
}
Saturday, 10 August 2013
For what $n$ is it true that $(1+\sum_{k=0}^{\infty}x^{2^k})^n+(\sum_{k=0}^{\infty}x^{2^k})^n\equiv1\mod2$
For what $n$ is it true that
$(1+\sum_{k=0}^{\infty}x^{2^k})^n+(\sum_{k=0}^{\infty}x^{2^k})^n\equiv1\mod2$
Let $A:=\sum_{k=0}^{\infty}x^{2^k}$. For what $n$ is it true that
$(A+1)^n+A^n\equiv1\mod2$ (here we are basically working in $\mathbb{F}_2$.)
The answer is all powers of 2, and it's fairly simple to see why they
work, but the hard part is proving all non-powers of 2 don't work. In the
solution, it says
"If $n$ is not a power of 2, say $n=2^i(2j+1),j\ge1$, then the smallest m
for which $\binom{n}{m}$ is odd is $2^j$."
I don't see why. I know the highest power of $2$ in $\binom{n}{m}$ is
$\sum_{k\ge1}[n/2^k]-[m/2^k]-[(n-m)/2^k]$ where $[.]$ is the greatest
integer function. Also each summand is 0 or 1. It's 1 when the sum of
fractional parts $\{m/2^k\} + \{(n-m)/2^k\}\ge1$, and 0 otherwise.
$(1+\sum_{k=0}^{\infty}x^{2^k})^n+(\sum_{k=0}^{\infty}x^{2^k})^n\equiv1\mod2$
Let $A:=\sum_{k=0}^{\infty}x^{2^k}$. For what $n$ is it true that
$(A+1)^n+A^n\equiv1\mod2$ (here we are basically working in $\mathbb{F}_2$.)
The answer is all powers of 2, and it's fairly simple to see why they
work, but the hard part is proving all non-powers of 2 don't work. In the
solution, it says
"If $n$ is not a power of 2, say $n=2^i(2j+1),j\ge1$, then the smallest m
for which $\binom{n}{m}$ is odd is $2^j$."
I don't see why. I know the highest power of $2$ in $\binom{n}{m}$ is
$\sum_{k\ge1}[n/2^k]-[m/2^k]-[(n-m)/2^k]$ where $[.]$ is the greatest
integer function. Also each summand is 0 or 1. It's 1 when the sum of
fractional parts $\{m/2^k\} + \{(n-m)/2^k\}\ge1$, and 0 otherwise.
Volumes of solids of revolution
Volumes of solids of revolution
I need to find how to calculate the volume of the solid obtained by
rotating the region bounded by $$ y=2\csc\left(\frac { x }{ 2 } \right)-2
$$ and $y=5$ about the line $$x=\pi$$
so like in the picture below.
Please help thanks!!
I need to find how to calculate the volume of the solid obtained by
rotating the region bounded by $$ y=2\csc\left(\frac { x }{ 2 } \right)-2
$$ and $y=5$ about the line $$x=\pi$$
so like in the picture below.
Please help thanks!!
Friday, 9 August 2013
How do the pre-signals work in OpenTTD?
How do the pre-signals work in OpenTTD?
I'm reading their Signals article on their wiki, and it's still not 100%
clear to me.
I'm trying to (and failing) to understand the Entry signal, (and
subsequently, the Exit and Combo signals, because Exit "Works the same as
Entry but..." and Combo "Combines Entry and Exit").
So here's what it says on Entry signals:
Block Entry Pre-signal
An entry pre-signal prevents trains from entering the following block,
unless there is at least one green exit signal on the opposite side of the
block. This prevents trains from entering the block until there is an
available exit and obstructing it. Note that depots have a built-in two
way signal (it works as an entry pre-signal in a pre-signal set). If there
are no signals designated as exits on the block directly behind the entry
pre-signal, it behaves as a normal block signal. This is convenient for
bi-directional pre-signals where only one direction needs pre-signal
functionality.
Can anyone please provide a clearer explanation, and perhaps tell me how
do Exit and Combo relate to it?
I'm reading their Signals article on their wiki, and it's still not 100%
clear to me.
I'm trying to (and failing) to understand the Entry signal, (and
subsequently, the Exit and Combo signals, because Exit "Works the same as
Entry but..." and Combo "Combines Entry and Exit").
So here's what it says on Entry signals:
Block Entry Pre-signal
An entry pre-signal prevents trains from entering the following block,
unless there is at least one green exit signal on the opposite side of the
block. This prevents trains from entering the block until there is an
available exit and obstructing it. Note that depots have a built-in two
way signal (it works as an entry pre-signal in a pre-signal set). If there
are no signals designated as exits on the block directly behind the entry
pre-signal, it behaves as a normal block signal. This is convenient for
bi-directional pre-signals where only one direction needs pre-signal
functionality.
Can anyone please provide a clearer explanation, and perhaps tell me how
do Exit and Combo relate to it?
External variables in lambda functions in Python
External variables in lambda functions in Python
Inspired by the construction in this answer, I am trying to do the following:
values = range(3)
vector = np.random.randint(3, size=(5,))
f = lambda x: x in values
result = [f(a) for a in values]
but I get global name 'values' is not defined.
I get the same error if I try the solution that I linked to above, i.e.:
A = [[0,1,2], [1,2,3], [2,3,4]]
v = [1,2]
B = [map(lambda val: val in v) for a in A]
Did Python change since that solution was posted? (I am working with
2.7.4). If so, how can I access an external variable within a lambda
function? Should I declare it as global? pass it as another input?
Update 1:
I am only noticing this problem within an embedded shell in IPython (1.0).
I will keep investigating
Update 2:
I am unable reproduce the problem at the moment. I will look deeper into
it and update/close accordingly.
Inspired by the construction in this answer, I am trying to do the following:
values = range(3)
vector = np.random.randint(3, size=(5,))
f = lambda x: x in values
result = [f(a) for a in values]
but I get global name 'values' is not defined.
I get the same error if I try the solution that I linked to above, i.e.:
A = [[0,1,2], [1,2,3], [2,3,4]]
v = [1,2]
B = [map(lambda val: val in v) for a in A]
Did Python change since that solution was posted? (I am working with
2.7.4). If so, how can I access an external variable within a lambda
function? Should I declare it as global? pass it as another input?
Update 1:
I am only noticing this problem within an embedded shell in IPython (1.0).
I will keep investigating
Update 2:
I am unable reproduce the problem at the moment. I will look deeper into
it and update/close accordingly.
Subscribe to:
Posts (Atom)