Monday, 30 September 2013

Sufficient and necessary conditions to get an infinite fiber $g⁻©รถ(w)$

Sufficient and necessary conditions to get an infinite fiber $g⁻©ö(w)$

I want to verify the proof of this result and get some start ideas to
overcome the different steps of this proof.
Lemma: Let $g$ be a real analytic function. Then we have the equivalence
$((a)¡ü(b))¢¢(c)$, where the statements $(a),(b)$ and $(c)$ are given by:
(a) $g$ has infinitely many real zeros.
(b) $g$ assumes arbitrarily large and arbitrarily small values, i.e., for
all $K>0$, there are $s©û,s©ü$ with $g(s©û)<-K$ and $g(s©ü)>K$,
(c) The fiber $g&#8315;©ö(w)$ is infinite for all $w¡ô&#8477;$.
Proof: (1) To prove that $(a)¡ü(b)¢¡(c)$, assume by contraduction that the
equation $g(s)=w$ has only finitely many solutions $(b_{j})_{1¡Âj¡Âi}$.
That means there are $z©û<z©ü$ such that $g(s)¡Áw$ for $w<z©û$ or $w>z©ü$.
Let $z©ý$ be the largest zero of $g$ smaller than $z©û$, and $z©þ$ the
smallest zero larger than $z©ü$. The exitence of $z©ý$ and $z©þ$ is
guaranteed by the premises that $g$ has infinitely many zeros and the fact
that $g$ is analytic, so $g$ has only finitely many zeros in the compact
interval $[z©û,z©ü]$ (or $g$ is identically $0$, but that has been ruled
out by the premise that it take arbitrarily large values), hence there
must be infinitely many outside the interval. Let
$K=max({|g(s)|:z©ý¡Âs¡Âz©þ})+|w|$. By assumption, there are $s©û,s©ü$ with
$ g(s©û)<-K$ and $g(s©ü)>K$. By the intermediate value theorem, there is
an $s_{w}$ between $z©ý$ or $z©þ$ and $s©û$ or $s©ü$ with $g(s_{w})=w$.
Contradiction.
We note that if $g$ is not analytic then it satisfies conditions (a) and
(b) but does not satisfy (c).
(2) To prove that $(c)¢¡(a)¡ü(b)$, we note first that $g$ has infinitely
many zeros because the fiber $g&#8315;©ö(0)$ is infinite. This proves item
(a). To prove item (b), let $K>0$ and $w=K+¥å,¥å>0$. The fiber
$g&#8315;©ö(K+¥å)$ is nonempty because it is infinite, hence there is
$s©ü$ such that $g(s©ü)=w=K+¥å>K$. By the same method, $g&#8315;©ö(-K-¥å)$
is nonempty, so there is $s©û$ such that $g(s©û)=-K-¥å<-K$.

What is the most elegant way to load a string array into a List=?iso-8859-1?Q?=3F_=96_stackoverflow.com?=

What is the most elegant way to load a string array into a List? –
stackoverflow.com

Say you have a array of strings containing numerical values: string[]
intArray = {"25", "65" , "0"}; What is the most elegant way to load the
numbers into a List<int> without using a for or …

mechanize: first form works, then "unknown GET form encoding type 'utf-8'"

mechanize: first form works, then "unknown GET form encoding type 'utf-8'"

I am trying to fill out 2 forms from the EUR-Lex website in order to
record some data from the generated webpage. I am stuck at form #2. I get
the feeling this should be easy and I've researched a bit, but no luck.
import mechanize
froot = '...'
f = open(froot + 'text.html', 'w')
br = mechanize.Browser()
br.open('http://eur-lex.europa.eu/RECH_legislation.do')
br.select_form(name='form2')
br['T1'] = ['V112']
br['T3'] = ['V2']
br['T2'] = ['V1']
first_page = br.submit()
f.write(first_page.get_data())
up until here everything seems to work, because I get the source of the
correct page saved to the file. But then...
br.select_form(name='form2')
br['typedate'] = ['PD']
br['startaaaa'] = '1960'
br['startmm'] = '01'
br['startjj'] = '01'
br['endaaaa'] = '1960'
br['endmm'] = '12'
br['startjj'] = '31'
next = br.submit()
here everything stops:
ValueError: unknown GET form encoding type 'utf-8'
I checked br.enctype before selecting the first and second forms. What I
get is:
after the first form: application/x-www-form-urlencoded
after the second form: utf-8
I don't know what is going on here.

out of memory exception when reading image from folder

out of memory exception when reading image from folder

i need to read all image files from folder ans save it to another folder
with compressed size.However my code compresses this images very well but
it give error after 695 image files "out of memory exception". This my
code.there are around 2000 images
List<string> files = new List<string>();
files = Directory.GetFiles(Server.MapPath("../imgres") + "\\products\\",
"*.jpg").ToList();
for (int k = 0; k < files.Count; k++)
{
if (File.Exists(files[k].ToString()))
{
string SaveLocation1 = "";
System.Drawing.Image thumbnail;
System.Drawing.Image smallsize;
System.Drawing.Image originalimg;
originalimg = System.Drawing.Image.FromFile(files[k].ToString());
thumbnail = originalimg.GetThumbnailImage(110, 110, new
System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback),
IntPtr.Zero);
smallsize = originalimg.GetThumbnailImage(47, 47, new
System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback),
IntPtr.Zero);
SaveLocation1 = Server.MapPath("../imgres/products") + "\\Thumbnail\\"
+ Path.GetFileName(files[k].ToString());
thumbnail.Save(SaveLocation1);
thumbnail.Dispose();
SaveLocation1 = Server.MapPath("../imgres/products") + "\\smallsize\\"
+ Path.GetFileName(files[k].ToString());
smallsize.Save(SaveLocation1);
smallsize.Dispose();
}
}

Sunday, 29 September 2013

I want to insert to database multiple data codeigniter

I want to insert to database multiple data codeigniter

This is my VIEW:
for ($i=1; $i < $loop_count ; $i++) {
echo $this->formbuilder->text( 'dates[]', 'Set Date '.$i);
}
This is my model:
function add_pm($data) {
$this->db->insert($this->table, $data);
$this->session->set_flashdata("message", "Contract record
successfully created.");
}
And now my question is what will i put in controller and how can i insert
it in database in loop? I wish someone will help me!

Is there a way to show max amount items in masonry?

Is there a way to show max amount items in masonry?

Is there a way to show a max amount of items in jQuery Masonry?
http://masonry.desandro.com/#jquery
We want to show max 12 items on http://denimjacket.nl/voorbeeld-pagina/,
so we would like to hide the rest. We can show max 12 items with a
Wordpress function, but ofcourse the Masonry will then only work on those
12 items, which is not correct. It has to work on all items, but still
show max 12 items.

In UCP, Is SCTS Field is really consistent between ot-51 ack and ot-53 request?

In UCP, Is SCTS Field is really consistent between ot-51 ack and ot-53
request?

I've been trying to implement a mechanism that communicates with smsc
using the ucp(emi) protocol. on top og that, i was trying to implement a
CDR mechanism, based on three steps: tcp ack, ot-51 ack message and ot-53
notification message. According to the EMI documentation, the SCTS field
should be consistent with the timestamp recieved in the ot-51 ack. i've
noticed that those values are not always consistent, did anyone else came
by this problem? can it be an smsc configuration problem?
thanx in advance :)