How to custom a datepiker in my language
I have a webpage which contains a date field and need to have a datepicker
so that user can easyly choose a date. I wonder if there is an easy way to
make my own custom datepicker (changing text, styles). Thanks for suggest
your idea.
Sunday, 15 September 2013
Qt Application Icon doesn't work
Qt Application Icon doesn't work
I created a small .ico for my program. Now I want Qt to set it as the
applications icon.
I found this documentation but it doesn't seem to work :
http://qt-project.org/doc/qt-4.8/appicon.html
I did exactly what they want me to do.
Create an myapp.rc file and write IDI_ICON102 ICON DISCARDABLE
"Movie-World.ico" into it. -> Did that.
Write RC_FILE += myapp.rc into your .pro file.
-> Did that.
When I compile and run, it doesn't work. I deleted the realese folder but
still no changes. I restarted Qt but still no changes.
I even added win32: before RC_FILE += myapp.rc but it did not work...
I don't understand why. My files are all in the same directory.
I created a small .ico for my program. Now I want Qt to set it as the
applications icon.
I found this documentation but it doesn't seem to work :
http://qt-project.org/doc/qt-4.8/appicon.html
I did exactly what they want me to do.
Create an myapp.rc file and write IDI_ICON102 ICON DISCARDABLE
"Movie-World.ico" into it. -> Did that.
Write RC_FILE += myapp.rc into your .pro file.
-> Did that.
When I compile and run, it doesn't work. I deleted the realese folder but
still no changes. I restarted Qt but still no changes.
I even added win32: before RC_FILE += myapp.rc but it did not work...
I don't understand why. My files are all in the same directory.
submit button arrays in PHP
submit button arrays in PHP
<div id='Descp'><?php echo $rows['productName'];?></div><!--decpx-->
<div id='buynow'><input type='submit' name='buyNow[]' id='buyNow'
class='buynow' value='Buy' /></div>
My question is, is it possible to create arrays of submit buttons like
above? Simply the need is to assign a submit button to capture the product
type user picks and then redirect to another page to buy.
Second point is using foreach will be a good method to capture the clicked
button response?
Thanks
<div id='Descp'><?php echo $rows['productName'];?></div><!--decpx-->
<div id='buynow'><input type='submit' name='buyNow[]' id='buyNow'
class='buynow' value='Buy' /></div>
My question is, is it possible to create arrays of submit buttons like
above? Simply the need is to assign a submit button to capture the product
type user picks and then redirect to another page to buy.
Second point is using foreach will be a good method to capture the clicked
button response?
Thanks
Saturday, 14 September 2013
Android Virual Device manager can't run application
Android Virual Device manager can't run application
I just followed this tutorial here
http://mobile.tutsplus.com/tutorials/android/android-sdk-create-a-drawing-app-interface-creation/
and i created just the graphic view of the app as u can see here
http://gyazo.com/9d168d5c4c2cdc9a5853daa9e55d1a63
but when i try to run it as app and test in avd it shows error ?
I just followed this tutorial here
http://mobile.tutsplus.com/tutorials/android/android-sdk-create-a-drawing-app-interface-creation/
and i created just the graphic view of the app as u can see here
http://gyazo.com/9d168d5c4c2cdc9a5853daa9e55d1a63
but when i try to run it as app and test in avd it shows error ?
Can jQuery promises be chained with Ember.RSVP.Promise's?
Can jQuery promises be chained with Ember.RSVP.Promise's?
I need help to understand some promises logic. Here is what I want to
achieve - with jQuery I make get request, then I chain it with my promise
which makes some checks, my code:
http://jsbin.com/UVEpurU/1/edit
function checkInfoPromise(r) {
var ok = true,
promise = Ember.RSVP.Promise(function(resolve, reject) {
if(ok) {
return resolve(r);
}
else {
return reject(r);
}
});
return promise;
}
var requestPromise = $.get('/')
.then(function(r){
return checkInfoPromise(r);
});
requestPromise.then(function(r) {
console.log(r);
}).fail(function(r) {
console.log('fail');
});
and it doesn't work as I expect. Documentation says they should work fine
with each other, but they don't or my code is incorrect.
Same logic with jQuery+jQuery works fine:
http://jsbin.com/AYeyaxO/1/edit
And Ember+Ember works:
http://jsbin.com/iMUgiDo/1/edit
I need help to understand some promises logic. Here is what I want to
achieve - with jQuery I make get request, then I chain it with my promise
which makes some checks, my code:
http://jsbin.com/UVEpurU/1/edit
function checkInfoPromise(r) {
var ok = true,
promise = Ember.RSVP.Promise(function(resolve, reject) {
if(ok) {
return resolve(r);
}
else {
return reject(r);
}
});
return promise;
}
var requestPromise = $.get('/')
.then(function(r){
return checkInfoPromise(r);
});
requestPromise.then(function(r) {
console.log(r);
}).fail(function(r) {
console.log('fail');
});
and it doesn't work as I expect. Documentation says they should work fine
with each other, but they don't or my code is incorrect.
Same logic with jQuery+jQuery works fine:
http://jsbin.com/AYeyaxO/1/edit
And Ember+Ember works:
http://jsbin.com/iMUgiDo/1/edit
PHP multi curl works on one machine, fails on another
PHP multi curl works on one machine, fails on another
I am trying to run a parallel image downloading with multi curl. I have a
short script that works fine for me on my laptop (php 5.3.10-1) but fails
on my server (PHP 5.5.3-1).
When I run this script on my server the target files are being created (I
guess that curl opens the handle successfully) but the files are empty,
there is no warning or error that I could see on my server to indicate any
issue.
Following is a sample of the original POC code I wrote/found online and
runs perfectly on my laptop but fails as is on my server. I would
appreciate your thoughts. Thank you.
<?php
$urls = array(
'http://static.php.net/www.php.net/images/php.gif',
'http://p.ebaystatic.com/aw/pics/globalheader/spr9.png'
);
$save_to = '/tmp/';
function add_file_to_curl($save_to, $mh, $url, $i){
global $conn, $fp;
$g=$save_to.basename($url);
if(is_file($g)){
unlink($g);
}
$conn[$i]=curl_init($url);
$fp[$i]=fopen ($g, "w");
curl_setopt ($conn[$i], CURLOPT_FILE, $fp[$i]);
curl_setopt ($conn[$i], CURLOPT_HEADER ,0);
curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,60);
curl_multi_add_handle ($mh,$conn[$i]);
}
$conn="";
$fp="";
$mh = curl_multi_init();
foreach ($urls as $i => $url) {
add_file_to_curl($save_to, $mh, $url, $i);
echo "URL IS $url, I is $i\n";
}
do {
$n = curl_multi_exec($mh,$running);
$ready = curl_multi_select($mh); // Waiting for one of the
files to finish
if(0 < $ready){
while($info = curl_multi_info_read($mh)){
$status =
curl_getinfo($info['handle'],CURLINFO_HTTP_CODE);
echo "STATUS $status\n";
if(200 == $status){
$successUrl =
curl_getinfo($info['handle'],CURLINFO_EFFECTIVE_URL);
echo "$successUrl\n";
}
break 1;
}
}
}
while (0 < $running && -1 != $ready);
$info = curl_multi_info_read($mh);
$status = curl_getinfo($info['handle'],CURLINFO_HTTP_CODE);
echo "STATUS $status\n";
if(200 == $status){
$successUrl =
curl_getinfo($info['handle'],CURLINFO_EFFECTIVE_URL);
echo "$successUrl\n";
}
foreach ($urls as $i => $url) {
echo "Running on $url and $i\n";
curl_multi_remove_handle($mh,$conn[$i]);
curl_close($conn[$i]);
fclose ($fp[$i]);
}
curl_multi_close($mh);
?>
I am trying to run a parallel image downloading with multi curl. I have a
short script that works fine for me on my laptop (php 5.3.10-1) but fails
on my server (PHP 5.5.3-1).
When I run this script on my server the target files are being created (I
guess that curl opens the handle successfully) but the files are empty,
there is no warning or error that I could see on my server to indicate any
issue.
Following is a sample of the original POC code I wrote/found online and
runs perfectly on my laptop but fails as is on my server. I would
appreciate your thoughts. Thank you.
<?php
$urls = array(
'http://static.php.net/www.php.net/images/php.gif',
'http://p.ebaystatic.com/aw/pics/globalheader/spr9.png'
);
$save_to = '/tmp/';
function add_file_to_curl($save_to, $mh, $url, $i){
global $conn, $fp;
$g=$save_to.basename($url);
if(is_file($g)){
unlink($g);
}
$conn[$i]=curl_init($url);
$fp[$i]=fopen ($g, "w");
curl_setopt ($conn[$i], CURLOPT_FILE, $fp[$i]);
curl_setopt ($conn[$i], CURLOPT_HEADER ,0);
curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,60);
curl_multi_add_handle ($mh,$conn[$i]);
}
$conn="";
$fp="";
$mh = curl_multi_init();
foreach ($urls as $i => $url) {
add_file_to_curl($save_to, $mh, $url, $i);
echo "URL IS $url, I is $i\n";
}
do {
$n = curl_multi_exec($mh,$running);
$ready = curl_multi_select($mh); // Waiting for one of the
files to finish
if(0 < $ready){
while($info = curl_multi_info_read($mh)){
$status =
curl_getinfo($info['handle'],CURLINFO_HTTP_CODE);
echo "STATUS $status\n";
if(200 == $status){
$successUrl =
curl_getinfo($info['handle'],CURLINFO_EFFECTIVE_URL);
echo "$successUrl\n";
}
break 1;
}
}
}
while (0 < $running && -1 != $ready);
$info = curl_multi_info_read($mh);
$status = curl_getinfo($info['handle'],CURLINFO_HTTP_CODE);
echo "STATUS $status\n";
if(200 == $status){
$successUrl =
curl_getinfo($info['handle'],CURLINFO_EFFECTIVE_URL);
echo "$successUrl\n";
}
foreach ($urls as $i => $url) {
echo "Running on $url and $i\n";
curl_multi_remove_handle($mh,$conn[$i]);
curl_close($conn[$i]);
fclose ($fp[$i]);
}
curl_multi_close($mh);
?>
php email sent successfully but not received by gmail
php email sent successfully but not received by gmail
I have some code that has worked for me in the past, but isn't anymore,
for some reason I don't understand. I'm pretty sure the problem isn't in
the code itself, since 1) I haven't changed anything, and 2) it's worked
for me in the past. I am using XAMPP and PHP. My webpage allows a user to
fill out a contact form and send an email through PHP. It seems to execute
successfully, since it takes the user to thankyou.html as a result. To
troubleshoot the issue, I have 1) cleared my browser's cache and 2)
checked my spam folder in Gmail. But I still can't find my email, and
don't know why. I'm not familiar with how SNMP works, so if that may be
the issue, I could use an explanation. Here is the code:
<?php
$field_first_name = $_POST['cf_first_name'];
$field_last_name = $_POST['cf_last_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$field_reference = $_POST['cf_reference'];
$mail_to = 'myself@gmail.com';
$subject = 'Message from a website visitor '.$field_first_name.'
'.$field_last_name;
$body_message = 'From: '.$field_first_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message."\n";
$body_message .= 'Reference: '.$field_reference;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
//alert('Thank you for the message. We will contact you
shortly.');
window.location = 'thankyou.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to
someemail@gmail.com');
window.location = 'home.php';
</script>
<?php
}
?>
Any input is much appreciated!
I have some code that has worked for me in the past, but isn't anymore,
for some reason I don't understand. I'm pretty sure the problem isn't in
the code itself, since 1) I haven't changed anything, and 2) it's worked
for me in the past. I am using XAMPP and PHP. My webpage allows a user to
fill out a contact form and send an email through PHP. It seems to execute
successfully, since it takes the user to thankyou.html as a result. To
troubleshoot the issue, I have 1) cleared my browser's cache and 2)
checked my spam folder in Gmail. But I still can't find my email, and
don't know why. I'm not familiar with how SNMP works, so if that may be
the issue, I could use an explanation. Here is the code:
<?php
$field_first_name = $_POST['cf_first_name'];
$field_last_name = $_POST['cf_last_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$field_reference = $_POST['cf_reference'];
$mail_to = 'myself@gmail.com';
$subject = 'Message from a website visitor '.$field_first_name.'
'.$field_last_name;
$body_message = 'From: '.$field_first_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message."\n";
$body_message .= 'Reference: '.$field_reference;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
//alert('Thank you for the message. We will contact you
shortly.');
window.location = 'thankyou.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to
someemail@gmail.com');
window.location = 'home.php';
</script>
<?php
}
?>
Any input is much appreciated!
Subscribe to:
Posts (Atom)