Monday, 30 September 2013

HD player in Ubuntu 13.04

HD player in Ubuntu 13.04

I want to play the videos with HD content in Ubuntu 13.04. What should i
do? Kindly tell me the terminal commands to handle the problem.

Why is a vector space equal to its tangent space for any point?

Why is a vector space equal to its tangent space for any point?

I'm self-studying Guillemin and Pollack, but I'm stuck on Problem 3 of
section 2. It says that if $V$ is a vector subspace of $\mathbb{R}^N$,
then $T_x(V)=V$ if $x\in V$.
If $x\in V$, then since $V$ is a manifold, there is a local
parametrization $\phi: U\to V$ where $U$ is open in $\mathbb{R}^k$.
Without loss of generality, we can require $\phi(0)=x$. Then $T_x(V)$ is
defined to be the image of $d\phi_0$ on $\mathbb{R}^k$.
An arbitrary element of $T_x(V)$ looks like $$ d\phi_0(v)=\lim_{t\to
0}\frac{\phi(0+tv)-\phi(0)}{t}=\lim_{t\to 0}\frac{\phi(tv)-x}{t} $$
but this doesn't seem very useful to show $T_x(V)=V$. What is the right
approach?

Floated element must never get out of the div

Floated element must never get out of the div

Following my code:
HTML:
<div>aaaaaaaaaaaaaaa
<span>test</span>
</div>
CSS:
div{
width: 60px;
border-bottom: 1px solid red;
word-break:break-all;
}
span{
float: right
}
I would get this result: http://oi41.tinypic.com/2py25w1.jpg
I would like the text right-floated should not have to get out the div, so
it must go to a new line inside the div when needed, as in the code that I
posted. In this case, for example, there is no need to let go of the text
in a new line, because the text fits on the right of the text:
http://jsfiddle.net/3kRan/2/

Assigning event TextChanged to all textboxes in Form

Assigning event TextChanged to all textboxes in Form

Hello I was wondering how can I keep an eye on all textboxes in Form
whether in any of them was changed value. I saw some code here
private void Form1_Load(object sender, EventArgs e)
{
foreach (Control ctrl in this.Controls)
{
if (ctrl is TextBox)
{
TextBox tb = (TextBox)ctrl;
tb.TextChanged += new EventHandler(tb_TextChanged);
}
}
}
void tb_TextChanged(object sender, EventArgs e)
{
TextBox tb = (TextBox)sender;
tb.Tag = "CHANGED"; // or whatever
}
And a guy who wrote this code says that it can`t be assigned to textboxes
in Panels and Grouboxes.
So my answer is as I have almost every textbox in groubox or panel, how
can I see whether change was made for textboxes in panels or groupbox?
Thank you for your time.

Sunday, 29 September 2013

RegEx validation for numbers only with a minimum length

RegEx validation for numbers only with a minimum length

so i have this reg ex
0*[0-9]\d*
which accepts numbers only how would i, make it to accepts numbers only
but have a minimum input of 5 numbers?

using variable to define json object name

using variable to define json object name

I'm having a problem that I think is very easy to solve, but I can't seem
to find an answer for it in my searches.
I have a bunch of json objects that I'm using. Right now I get at the info
like so for example:
for(image in data.everfi_commons.images) {
alert(data.everfi_commons.images[image]);
}
what I'd like to do instead is instead of having the name 'everfi_commons'
I'd like to just use a javascript variable that I've set up like so:
current_project = $(this).attr("id"); // this value is 'everfi_commons'
and then I thought you could just do data.current_project.images[image]
but this doesn't seem to work and I don't really understand why, any
insight would be helpful!

Python unserialize PHP session

Python unserialize PHP session

I have been trying to unserialize PHP session data in Python by using
phpserialize and a serek's modules(got it from Unserialize PHP data in
python), but it seems like impossible to me.
Both modules expect PHP session data to be like:
a:2:{s:3:"Usr";s:5:"AxL11";s:2:"Id";s:1:"2";}
But the data stored in the session file is:
Id|s:1:"2";Usr|s:5:"AxL11";
Any help would be very much appreciated.