How to achieve the view of windows8 music player(mobile) app in android?
one can only understand this question if they might have used windows
phone.In the default music player that nokia provides...when the main
screen pops up ,the view looks something similar to the view in android
with fragments attached in a view pager,but its a bit different.Upon
scrolling the objects seem to be floating.Thats because maybe the view has
three layers. One is the main layer where the content is displayed the
other is the background and the third is where the title is written.
the objects in windows music player app move(in horizontal direction) with
different velocities,like the heading or title moves a bit slower,the
background a little faster and text, the fastest. I mean if one swaps
between views,the text is swapped completely,background is swapped say by
1/3 and the title is swapped by 1/5.
anyone knows how i can achieve this kind of view??
Thursday, 3 October 2013
Wednesday, 2 October 2013
How to fix FileNotFoundException
How to fix FileNotFoundException
This is my source cord to print my invoice page. My report is in java
package. I kept it inside a folder called "report".
try {
String date1 = new
SimpleDateFormat("yyyy-MM-dd").format(isdate.getDate());
String time1 = istime.getValue().toString().split(" ")[3];
date1 = date1 + " " + time1;
String date2 = new
SimpleDateFormat("yyyy-MM-dd").format(redate.getDate());
String time2 = retime.getValue().toString().split(" ")[3];
date2 = date2 + " " + time2;
JRTableModelDataSource dataSource = new
JRTableModelDataSource(jTable1.getModel());
String reportsource = " D:/Catering/report/report1.jrxml";
Map<String, Object> params = new HashMap<String, Object>();
params.put("inid", txtInvoiceID.getText());
params.put("cuname", txtCuName.getText());
params.put("cuadd", txtCuid.getText());
params.put("cutp", txtTPNo.getText());
params.put("isdate", date1);
params.put("redate", date2);
params.put("advance", txtAdvance.getText());
params.put("due", txtDue.getText());
params.put("total", txtGtotal.getText());
JasperReport jasperReport =
JasperCompileManager.compileReport(reportsource);
JasperPrint jasperPrint =
JasperFillManager.fillReport(jasperReport, params, dataSource);
JasperViewer.viewReport(jasperPrint, true);
JOptionPane.showMessageDialog(null, "Done");
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "jasper error"+e);
}
This is my source cord to print my invoice page. My report is in java
package. I kept it inside a folder called "report".
try {
String date1 = new
SimpleDateFormat("yyyy-MM-dd").format(isdate.getDate());
String time1 = istime.getValue().toString().split(" ")[3];
date1 = date1 + " " + time1;
String date2 = new
SimpleDateFormat("yyyy-MM-dd").format(redate.getDate());
String time2 = retime.getValue().toString().split(" ")[3];
date2 = date2 + " " + time2;
JRTableModelDataSource dataSource = new
JRTableModelDataSource(jTable1.getModel());
String reportsource = " D:/Catering/report/report1.jrxml";
Map<String, Object> params = new HashMap<String, Object>();
params.put("inid", txtInvoiceID.getText());
params.put("cuname", txtCuName.getText());
params.put("cuadd", txtCuid.getText());
params.put("cutp", txtTPNo.getText());
params.put("isdate", date1);
params.put("redate", date2);
params.put("advance", txtAdvance.getText());
params.put("due", txtDue.getText());
params.put("total", txtGtotal.getText());
JasperReport jasperReport =
JasperCompileManager.compileReport(reportsource);
JasperPrint jasperPrint =
JasperFillManager.fillReport(jasperReport, params, dataSource);
JasperViewer.viewReport(jasperPrint, true);
JOptionPane.showMessageDialog(null, "Done");
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "jasper error"+e);
}
php email going to the 'from' address not the to address
php email going to the 'from' address not the to address
I have been searching for a working email php script, I have everything
working except -
The email that is entered into the contact form receives the message
instead of the pre-set recipient?
I have tried all sorts of tricks to try and get this to work, the only way
I can get the mail to arrive in my web-mail account is if I type that
address into the form as the senders email.
This is the 'html' form
<html>
<body>
<form method="post" action="new-mail.php">
<div class="5grid">
<div class="row">
<div class="6u">
<input type="text" name="name" id="name" placeholder="Name" />
</div>
<div class="6u">
<input type="text" name="contact" id="contact" placeholder="Email" />
</div>
</div>
<div class="row">
<div class="12u">
<input type="text" name="subject" id="subject"
placeholder="Subject" />
</div>
</div>
<div class="row">
<div class="12u">
<textarea name="message" id="message"
placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<input type="submit" class="button" value="Send Message" />
<input type="reset" class="button button-alt" value="Clear Form" />
</div>
</div>
</div>
</form>
</body>
</html>
and this is the php mailer -
<?php
$subject = $_POST['subject'];
$message = $_POST['message'];
$email = 'net@webmail.address';
$who_sent = $_POST['contact'];
$headers = 'From: ' . $who_sent . "\r\n" .
'Reply-To: ' . $who_sent . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$name = $_POST['name'];
mail($email, $subject, $message, $name, $headers);
?>
When the mail is received at the intended senders email address it list's
the recipient as being the intended send to address, and the from address
is the web host 'user@server.web-host.net'
I am finding this a little confusing, I have tried setting the form id and
name for the email field to different text, I have tried putting the
recipients address directly into the mail(), and a good many other
combinations too. For some reason it makes no difference to the outcome.
The host is 000webhost.com which is a linux based server if that makes any
difference to this.
I have been searching for a working email php script, I have everything
working except -
The email that is entered into the contact form receives the message
instead of the pre-set recipient?
I have tried all sorts of tricks to try and get this to work, the only way
I can get the mail to arrive in my web-mail account is if I type that
address into the form as the senders email.
This is the 'html' form
<html>
<body>
<form method="post" action="new-mail.php">
<div class="5grid">
<div class="row">
<div class="6u">
<input type="text" name="name" id="name" placeholder="Name" />
</div>
<div class="6u">
<input type="text" name="contact" id="contact" placeholder="Email" />
</div>
</div>
<div class="row">
<div class="12u">
<input type="text" name="subject" id="subject"
placeholder="Subject" />
</div>
</div>
<div class="row">
<div class="12u">
<textarea name="message" id="message"
placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<input type="submit" class="button" value="Send Message" />
<input type="reset" class="button button-alt" value="Clear Form" />
</div>
</div>
</div>
</form>
</body>
</html>
and this is the php mailer -
<?php
$subject = $_POST['subject'];
$message = $_POST['message'];
$email = 'net@webmail.address';
$who_sent = $_POST['contact'];
$headers = 'From: ' . $who_sent . "\r\n" .
'Reply-To: ' . $who_sent . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$name = $_POST['name'];
mail($email, $subject, $message, $name, $headers);
?>
When the mail is received at the intended senders email address it list's
the recipient as being the intended send to address, and the from address
is the web host 'user@server.web-host.net'
I am finding this a little confusing, I have tried setting the form id and
name for the email field to different text, I have tried putting the
recipients address directly into the mail(), and a good many other
combinations too. For some reason it makes no difference to the outcome.
The host is 000webhost.com which is a linux based server if that makes any
difference to this.
jQuery UI draggable not cloning
jQuery UI draggable not cloning
I have the following elements:
<div style="height: 25%">
<div id="e1" class="oneEigth insertionBlock insertion ui-draggable"
accountname="1 of a Find" premiumtitle="Page 1 of 2" data-id="2.000H"
insertion-id="1390"> </div>
<div id="e2" class="oneEigth insertionBlock insertion ui-draggable"
accountname="1 of a Find" premiumtitle="Page 1 of 2" data-id="2.000H"
insertion-id="1390"> </div>
</div>
I loop through the elements with the insertionBlock class and bind this
draggable:
$(this).draggable({
helper: 'clone',
containment:"document",
start: function() {
var $possibleThisBlockPaginationPage, thisBlockInsertionId;
thisBlockInsertionId = $(this).attr("insertion-id");
$(this).addClass('standalone placeholder');
$(this).removeClass('oneThird oneEigth oneSixth eHoveredOver
insertionBlock oHoveredOver xHoveredOver');
$(this).attr("id", thisBlockInsertionId);
$(this).removeAttr("insertion-id");
$possibleThisBlockPaginationPage =
$(this).parent().parent().parent();
if
($possibleThisBlockPaginationPage.parent().hasClass('paginationPage'))
{
$possibleThisBlockPaginationPage.find(".insertionBlock").each(function()
{
if ($(this).attr("insertion-id") === thisBlockInsertionId) {
$(this).removeClass("insertion");
$(this).removeAttr("accountname");
$(this).removeAttr("premiumtitle");
$(this).removeAttr("data-id");
$(this).removeAttr("insertion-id");
}
});
}
}
});
And I have the following droppable:
$("#paginationScratch").droppable({
drop: function( event, ui ) {
var thisInsertion = ui.draggable.detach(), $scratchPad =
$("#paginationScratch");
$scratchPad.append(thisInsertion);
}
});
The insertionBlock elements drag and drop just fine, but the problem is
that the source ends up looking like this:
<div style="height: 25%">
<div id="e2" class="oneEigth insertionBlock ui-draggable"> </div>
</div>
When it SHOULD look like this:
<div style="height: 25%">
<div id="e1" class="oneEigth insertionBlock ui-draggable"> </div>
<div id="e2" class="oneEigth insertionBlock ui-draggable"> </div>
</div>
So basically, the element I drag:
<div id="e1" ... >
Is detached from the source and appended to the destination, when it
should be cloned from the source and appended to the destination. Note
that all of the other transformations, such as the removal of classes,
etc, are required.
How am I screwing this up? I've been stuck on this for quite a while.
I have the following elements:
<div style="height: 25%">
<div id="e1" class="oneEigth insertionBlock insertion ui-draggable"
accountname="1 of a Find" premiumtitle="Page 1 of 2" data-id="2.000H"
insertion-id="1390"> </div>
<div id="e2" class="oneEigth insertionBlock insertion ui-draggable"
accountname="1 of a Find" premiumtitle="Page 1 of 2" data-id="2.000H"
insertion-id="1390"> </div>
</div>
I loop through the elements with the insertionBlock class and bind this
draggable:
$(this).draggable({
helper: 'clone',
containment:"document",
start: function() {
var $possibleThisBlockPaginationPage, thisBlockInsertionId;
thisBlockInsertionId = $(this).attr("insertion-id");
$(this).addClass('standalone placeholder');
$(this).removeClass('oneThird oneEigth oneSixth eHoveredOver
insertionBlock oHoveredOver xHoveredOver');
$(this).attr("id", thisBlockInsertionId);
$(this).removeAttr("insertion-id");
$possibleThisBlockPaginationPage =
$(this).parent().parent().parent();
if
($possibleThisBlockPaginationPage.parent().hasClass('paginationPage'))
{
$possibleThisBlockPaginationPage.find(".insertionBlock").each(function()
{
if ($(this).attr("insertion-id") === thisBlockInsertionId) {
$(this).removeClass("insertion");
$(this).removeAttr("accountname");
$(this).removeAttr("premiumtitle");
$(this).removeAttr("data-id");
$(this).removeAttr("insertion-id");
}
});
}
}
});
And I have the following droppable:
$("#paginationScratch").droppable({
drop: function( event, ui ) {
var thisInsertion = ui.draggable.detach(), $scratchPad =
$("#paginationScratch");
$scratchPad.append(thisInsertion);
}
});
The insertionBlock elements drag and drop just fine, but the problem is
that the source ends up looking like this:
<div style="height: 25%">
<div id="e2" class="oneEigth insertionBlock ui-draggable"> </div>
</div>
When it SHOULD look like this:
<div style="height: 25%">
<div id="e1" class="oneEigth insertionBlock ui-draggable"> </div>
<div id="e2" class="oneEigth insertionBlock ui-draggable"> </div>
</div>
So basically, the element I drag:
<div id="e1" ... >
Is detached from the source and appended to the destination, when it
should be cloned from the source and appended to the destination. Note
that all of the other transformations, such as the removal of classes,
etc, are required.
How am I screwing this up? I've been stuck on this for quite a while.
Tuesday, 1 October 2013
Detached Thread: Handler not showing the Printfs
Detached Thread: Handler not showing the Printfs
I'm trying to compile and run the following code using Detached Threads in
C Linux. The thing is that I want every thread to show me the
corresponding printf from the handler *idThreadMethod and it doesn't show
me anything! I tried using a printf before calling the pthread_create
function and it show it, but the problem should be inside the
*idThreadMethod (handler function). The code:
//gcc detachedThreads.c -lpthread -o p
//./p 4
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int i;
void *idThreadMethod(void *args)
{
int pid;
pid = *((int *)args);
printf("\nI'm The Detached Thread %d\n", i);
printf("\nMy PID is: %d\n", pid);
pthread_exit(NULL);
}
int main(int argc, char *argv[])
{
int quantityThreads, returnThread, pid;
pthread_t idThread[15];
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
if(argc-1 < 1)
{
printf("\nSome arguments are missing\n");
return EXIT_FAILURE;
}
quantityThreads = atoi(argv[1]);
pid=getpid();
int *it = &pid;
for(i=0;i<quantityThreads;i++)
{
returnThread = pthread_create(&idThread[i],&attr,idThreadMethod,it);
if(returnThread == -1)
{
printf("\nThere is an error trying to create the thread\n");
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
What could I do in order to show the printf messages from the
*idThreadMethod function?
I'm trying to compile and run the following code using Detached Threads in
C Linux. The thing is that I want every thread to show me the
corresponding printf from the handler *idThreadMethod and it doesn't show
me anything! I tried using a printf before calling the pthread_create
function and it show it, but the problem should be inside the
*idThreadMethod (handler function). The code:
//gcc detachedThreads.c -lpthread -o p
//./p 4
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int i;
void *idThreadMethod(void *args)
{
int pid;
pid = *((int *)args);
printf("\nI'm The Detached Thread %d\n", i);
printf("\nMy PID is: %d\n", pid);
pthread_exit(NULL);
}
int main(int argc, char *argv[])
{
int quantityThreads, returnThread, pid;
pthread_t idThread[15];
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
if(argc-1 < 1)
{
printf("\nSome arguments are missing\n");
return EXIT_FAILURE;
}
quantityThreads = atoi(argv[1]);
pid=getpid();
int *it = &pid;
for(i=0;i<quantityThreads;i++)
{
returnThread = pthread_create(&idThread[i],&attr,idThreadMethod,it);
if(returnThread == -1)
{
printf("\nThere is an error trying to create the thread\n");
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
What could I do in order to show the printf messages from the
*idThreadMethod function?
Splash Image naming clash and PNG crush error
Splash Image naming clash and PNG crush error
I am adding splash images in one of my Universal projects using xCode5.
When I add splash image for iPhone Non-Retina (iOS 6.1 or prior), xCode
asks me to rename the image to Default.png (Good enough)
I add all other images for iPhone.
When I add splash image for iPad Portrait Non-Retina (iOS 6.1 or prior),
xCode again asks me to rename the file to Default.png and places it in a
sub-directory.
Now when I try to build the project, it gives the PNG Crush error due to
same file names.
Here is the exact error: While reading
/Volumes/iosWorkspace/projectName/projectName/Default@2x.png pngcrush
caught libpng error: Command
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng
emitted errors but did not return a nonzero exit code to indicate failure
I am adding splash images in one of my Universal projects using xCode5.
When I add splash image for iPhone Non-Retina (iOS 6.1 or prior), xCode
asks me to rename the image to Default.png (Good enough)
I add all other images for iPhone.
When I add splash image for iPad Portrait Non-Retina (iOS 6.1 or prior),
xCode again asks me to rename the file to Default.png and places it in a
sub-directory.
Now when I try to build the project, it gives the PNG Crush error due to
same file names.
Here is the exact error: While reading
/Volumes/iosWorkspace/projectName/projectName/Default@2x.png pngcrush
caught libpng error: Command
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng
emitted errors but did not return a nonzero exit code to indicate failure
Calculating $ý\sum_{n=2}^{\infty}\frac{1}{k^n}\zeta(n)$ math.stackexchange.com
Calculating $ý\sum_{n=2}^{\infty}\frac{1}{k^n}\zeta(n)$ –
math.stackexchange.com
ýTHEOREMý: ýIf $f\left(z \right)=\sum_{n=2}^{\infty}a_{n}z^n$ and
$\sum_{n=2}^{\infty}|a_n|$ converges thený, ý\begin{equation*}ý ...
math.stackexchange.com
ýTHEOREMý: ýIf $f\left(z \right)=\sum_{n=2}^{\infty}a_{n}z^n$ and
$\sum_{n=2}^{\infty}|a_n|$ converges thený, ý\begin{equation*}ý ...
Transitivity of parallel lines
Transitivity of parallel lines
I cam across a question (in my textbook) about proofs with parallel lines.
The question is: Prove that the property that || is transitive implies
that for any point P and line l, there is at the most 1 line through P
that is parallel to the line l.
In other words the question is asking me to prove that (P is on q & P is
on s & l||q & l||s) --> q = s, using the transitive property.
I know that the transitivity property tells me that l||m & m||n --> n||l,
but I am not sure how to do this proof.
Any hints or solutions would be much appreciated!! :)
Thank you in advance
I cam across a question (in my textbook) about proofs with parallel lines.
The question is: Prove that the property that || is transitive implies
that for any point P and line l, there is at the most 1 line through P
that is parallel to the line l.
In other words the question is asking me to prove that (P is on q & P is
on s & l||q & l||s) --> q = s, using the transitive property.
I know that the transitivity property tells me that l||m & m||n --> n||l,
but I am not sure how to do this proof.
Any hints or solutions would be much appreciated!! :)
Thank you in advance
Subscribe to:
Comments (Atom)