Define function for property of javascript class
I have this Javascript class and want to add some kind of function (like
prototype) to properties of this class.
function theUploader(virtualField)
{
var self = this;
//self.v = virtualField;
self.v = (function(){return self.v; this.clear = function(){self.v =
'';}})()
self.v.prototype = function clear() {
self.v = '';
}
}
i tried those lines. i couldn`t find out the right way to define such a
thing.i want to call it like this
var temp = new theUploader('smart');
temp.v.clear();
someone guid me with jsaon.but still working on it
Saturday, 31 August 2013
How to echo multiple rows with data based on checkbox input?
How to echo multiple rows with data based on checkbox input?
Got stuck trying to echo out multiple rows with data based on checkbox
input. As of current code it processes data from only one checkbox, no
matter how many checkboxes are ticked. Please help!
while($row = mysql_fetch_assoc($r))
{
$pals .= '<input type="checkbox" name="pal_num[]"
value="'.$row['pal_num'].'">'.$row['pal_num'].'<br>';
}
if($pal == '') {
echo '';
} else {
echo '<form name="get_pal" action="post2.php" method="POST">';
echo $pals;
echo '<input type="submit" name="post" value="Go!">';
echo '</form>';
}
post2.php:
$w = $_POST['pal_num'];
$rrr = mysql_query("SELECT * FROM pl_tab WHERE pal_num".$w[0]);
while($row = mysql_fetch_array($rrr))
{
echo '<tr><td>'.' '.'</td>';
echo '<td rowspan="5">'.$row['descr'].'</td>';
echo '<td><b>'.'Total weight'.'<b></td>';
echo '<td>'.' '.'</td><td>'.' '.'</td></tr>';
echo '<td>'.' '.'</td>';
echo '<td colspan="3">'.' '.'</td>';
//this part should multiple based on how many checkboxes are ticked.
echo '<tr><td>'.$row['l_num'].'</td>';
echo '<td>'.$row['pal_num'].'</td>';
echo '<td>'.$row['weight 1'].'</td><td>'.$row['weight 2'].'</td></tr>';
}
echo "</table>";}
Got stuck trying to echo out multiple rows with data based on checkbox
input. As of current code it processes data from only one checkbox, no
matter how many checkboxes are ticked. Please help!
while($row = mysql_fetch_assoc($r))
{
$pals .= '<input type="checkbox" name="pal_num[]"
value="'.$row['pal_num'].'">'.$row['pal_num'].'<br>';
}
if($pal == '') {
echo '';
} else {
echo '<form name="get_pal" action="post2.php" method="POST">';
echo $pals;
echo '<input type="submit" name="post" value="Go!">';
echo '</form>';
}
post2.php:
$w = $_POST['pal_num'];
$rrr = mysql_query("SELECT * FROM pl_tab WHERE pal_num".$w[0]);
while($row = mysql_fetch_array($rrr))
{
echo '<tr><td>'.' '.'</td>';
echo '<td rowspan="5">'.$row['descr'].'</td>';
echo '<td><b>'.'Total weight'.'<b></td>';
echo '<td>'.' '.'</td><td>'.' '.'</td></tr>';
echo '<td>'.' '.'</td>';
echo '<td colspan="3">'.' '.'</td>';
//this part should multiple based on how many checkboxes are ticked.
echo '<tr><td>'.$row['l_num'].'</td>';
echo '<td>'.$row['pal_num'].'</td>';
echo '<td>'.$row['weight 1'].'</td><td>'.$row['weight 2'].'</td></tr>';
}
echo "</table>";}
imagepolygon - Generate strange output
imagepolygon - Generate strange output
When try to run this code, a strange output happen.
<?php
// cria uma imagem em branco
$image = imagecreate(400, 300);
// prenche a cor do fundo
$bg = imagecolorallocate($image, 0, 0, 0);
// escolhe uma cor para o poligono
$col_poly = imagecolorallocate($image, 255, 255, 255);
// desenha o poligono
imagepolygon($image,
array (
0, 0,
100, 200,
300, 200
),
3,
$col_poly);
// envia a imagem
header("Content-type: image/png");
imagepng($image);
?>
The output is:
Warning: Cannot modify header information - headers already sent by
(output started at /var/www/drawimage/index.php:2) in
/var/www/drawimage/index.php on line 23
what should be the picture looks like this:
‰PNG
IHDR,×ywPLTEÿÿÿ¥ÙŸÝ1IDAThí•;Ü0D5ë¡ÀÇ™C±¡à#è(lt;åÌýùivWeX»+'Púa§8ÑYxä7üä'lt;ò-ÒÈKhdþÅ#3¦Ä#EÓwy²È?ñÈû‡ŒðÊÈôb'0}á'yMH#ïÏáò~V™yû¥òV™ç:g\Ö+Nlt;8dmE*³¬2qšXeâñGDamp;ú¿ÌŠÊ„÷©ÌŠÊ¬¥He¶ï
ÙFŸSf¾p¶iá"ÙN™ý‚Ù;QÊì§L\œ21{‚'í¹ð¥LØ"2;B)³W¢"9¾Bä|F™¹xA9f…Qæ@eÎëMlt;pälD(sŒ2q1ÊÄê
D÷Â#„2áxÊœ¡ÌYPæú'kìqeæfáæš\™Á•¹/7ñH@'»¬ÌàÊÄs+••¹VÀÊ„k+s#°2wX™ìD²¡G•™Õ¥™lNPe2Uamp;¿ÚÄ#Cò6
29‚*ï%ªLì¬H¶^xTamp;dkP™•ÉËÊýBŠ'Ç"™»›nŠ)Á")L™òb)»@Ê"¦LÌ7˜2ÑØuÅnáH™Pì
eJR¦¬)Sµ©Qf6·jªA"©D™úZ©›ÊÔ¢L,·2ÑÙ+'j¿ð L¨ö25(S"iº&lsqauo;&lsqauo;4ãî+Ó
¾2Í„øÊ4¯L{©‰G‚‡´=\eZÄWamp;Ö¾2 â+#ÍÉÂ#®2¡9q•iW™¶†«ŒÒ\DvOñ"QæÃSFA
/code/pre
pwhat is happening?/p
When try to run this code, a strange output happen.
<?php
// cria uma imagem em branco
$image = imagecreate(400, 300);
// prenche a cor do fundo
$bg = imagecolorallocate($image, 0, 0, 0);
// escolhe uma cor para o poligono
$col_poly = imagecolorallocate($image, 255, 255, 255);
// desenha o poligono
imagepolygon($image,
array (
0, 0,
100, 200,
300, 200
),
3,
$col_poly);
// envia a imagem
header("Content-type: image/png");
imagepng($image);
?>
The output is:
Warning: Cannot modify header information - headers already sent by
(output started at /var/www/drawimage/index.php:2) in
/var/www/drawimage/index.php on line 23
what should be the picture looks like this:
‰PNG
IHDR,×ywPLTEÿÿÿ¥ÙŸÝ1IDAThí•;Ü0D5ë¡ÀÇ™C±¡à#è(lt;åÌýùivWeX»+'Púa§8ÑYxä7üä'lt;ò-ÒÈKhdþÅ#3¦Ä#EÓwy²È?ñÈû‡ŒðÊÈôb'0}á'yMH#ïÏáò~V™yû¥òV™ç:g\Ö+Nlt;8dmE*³¬2qšXeâñGDamp;ú¿ÌŠÊ„÷©ÌŠÊ¬¥He¶ï
ÙFŸSf¾p¶iá"ÙN™ý‚Ù;QÊì§L\œ21{‚'í¹ð¥LØ"2;B)³W¢"9¾Bä|F™¹xA9f…Qæ@eÎëMlt;pälD(sŒ2q1ÊÄê
D÷Â#„2áxÊœ¡ÌYPæú'kìqeæfáæš\™Á•¹/7ñH@'»¬ÌàÊÄs+••¹VÀÊ„k+s#°2wX™ìD²¡G•™Õ¥™lNPe2Uamp;¿ÚÄ#Cò6
29‚*ï%ªLì¬H¶^xTamp;dkP™•ÉËÊýBŠ'Ç"™»›nŠ)Á")L™òb)»@Ê"¦LÌ7˜2ÑØuÅnáH™Pì
eJR¦¬)Sµ©Qf6·jªA"©D™úZ©›ÊÔ¢L,·2ÑÙ+'j¿ð L¨ö25(S"iº&lsqauo;&lsqauo;4ãî+Ó
¾2Í„øÊ4¯L{©‰G‚‡´=\eZÄWamp;Ö¾2 â+#ÍÉÂ#®2¡9q•iW™¶†«ŒÒ\DvOñ"QæÃSFA
/code/pre
pwhat is happening?/p
Translate objetive-c into ruby
Translate objetive-c into ruby
I am developing a Rubymotion app. I am using the pod
KNSemiModalViewController. How can I "translate" this Objective-C code
into ruby?
[self presentSemiViewController:semiVC withOptions:@{
KNSemiModalOptionKeys.pushParentBack : @(YES),
KNSemiModalOptionKeys.animationDuration : @(0.3),
KNSemiModalOptionKeys.shadowOpacity : @(0.8),
}];
I am developing a Rubymotion app. I am using the pod
KNSemiModalViewController. How can I "translate" this Objective-C code
into ruby?
[self presentSemiViewController:semiVC withOptions:@{
KNSemiModalOptionKeys.pushParentBack : @(YES),
KNSemiModalOptionKeys.animationDuration : @(0.3),
KNSemiModalOptionKeys.shadowOpacity : @(0.8),
}];
Moving Linux HDD to another machine with dual Windows boot
Moving Linux HDD to another machine with dual Windows boot
Currently there're Windows 7 and XP in boot menu, and another hdd with
Fedora and CentOS coming off from a different machine. When added to the
windows boot menu, the Grab 2 allows Linux distro selection but neither of
them is able to load forcing computer into the sleep mode.
Would it still be possible to add Linux hdd to the new hardware?
Currently there're Windows 7 and XP in boot menu, and another hdd with
Fedora and CentOS coming off from a different machine. When added to the
windows boot menu, the Grab 2 allows Linux distro selection but neither of
them is able to load forcing computer into the sleep mode.
Would it still be possible to add Linux hdd to the new hardware?
Play Songs from Laptop to Phone
Play Songs from Laptop to Phone
This is since a big issue that I wanna play songs from my laptop to my
phone via bluetooth.
But the only solution I find that is play songs from mobile to laptop
speakers.. but I want the opposite process to work on..
Because while I work on my laptop I want to listen the songs and control
them from my laptop as well, but the speakers are pretty much away from my
bed, so I wanna plug in the jack with my mobile and wanna play the track
on my Laptop which will be listen to my phone via my laptop and phone
bluetooth.
My Laptop is HP430 Notebook
And Phone is Xperia X8 (Android 2.1)
Please give me a solution, Thank you..
This is since a big issue that I wanna play songs from my laptop to my
phone via bluetooth.
But the only solution I find that is play songs from mobile to laptop
speakers.. but I want the opposite process to work on..
Because while I work on my laptop I want to listen the songs and control
them from my laptop as well, but the speakers are pretty much away from my
bed, so I wanna plug in the jack with my mobile and wanna play the track
on my Laptop which will be listen to my phone via my laptop and phone
bluetooth.
My Laptop is HP430 Notebook
And Phone is Xperia X8 (Android 2.1)
Please give me a solution, Thank you..
android fragment activity How to not save state
android fragment activity How to not save state
I have FragmentActivity where first is A and then can be replaced with B
fragment. If Activity has been destroyed i would like to start app with A
fragment instead of B fragment.
I have FragmentActivity where first is A and then can be replaced with B
fragment. If Activity has been destroyed i would like to start app with A
fragment instead of B fragment.
How can I retrieve the current time, using PHP?
How can I retrieve the current time, using PHP?
How can I retrieve the current time, using PHP? I would like to be able to
use that time in my MySQL queries.
How can I retrieve the current time, using PHP? I would like to be able to
use that time in my MySQL queries.
Friday, 30 August 2013
Trouble with adding to HashMap using arguments
Trouble with adding to HashMap using arguments
I am a newbie programmer and I can't figure out what is wrong with my
addServer method. "details" is underlined and wants a semicolon next to it
(I'm using Eclipse). I thought that I had set it up correctly but
obviously I am wrong. It is called from the main and it's purpose is to
add to a hashmap of servers where the value of the hashmap consists of an
instance of ServerDetails where two int fields are stored. All values are
determined in the main. Before, serverList's value was just one integer
and I didn't use an object and I got it to work fine. If I need to show
more code, please let me know.
public class ClientSummary {
private String clientID;
private String companyName;
private int totalNum;
private HashMap<String,ServerDetails> serverList;
public ClientSummary (){
clientID = MainDisplay.getClientHolder();
totalNum= MainDisplay.getNumAttackOnClient();
serverList = new HashMap<String,ServerDetails>();
}
public void addServer(String x, int y, int z){
ServerDetails details new ServerDetails(y,z);
serverList.put(x, details);
}
}
ServerDetails.java:
public class ServerDetails {
private int threatLevel;
private int numAttack;
ServerDetails(int y, int z){
threatLevel = y;
numAttack = z;
}
}
I am a newbie programmer and I can't figure out what is wrong with my
addServer method. "details" is underlined and wants a semicolon next to it
(I'm using Eclipse). I thought that I had set it up correctly but
obviously I am wrong. It is called from the main and it's purpose is to
add to a hashmap of servers where the value of the hashmap consists of an
instance of ServerDetails where two int fields are stored. All values are
determined in the main. Before, serverList's value was just one integer
and I didn't use an object and I got it to work fine. If I need to show
more code, please let me know.
public class ClientSummary {
private String clientID;
private String companyName;
private int totalNum;
private HashMap<String,ServerDetails> serverList;
public ClientSummary (){
clientID = MainDisplay.getClientHolder();
totalNum= MainDisplay.getNumAttackOnClient();
serverList = new HashMap<String,ServerDetails>();
}
public void addServer(String x, int y, int z){
ServerDetails details new ServerDetails(y,z);
serverList.put(x, details);
}
}
ServerDetails.java:
public class ServerDetails {
private int threatLevel;
private int numAttack;
ServerDetails(int y, int z){
threatLevel = y;
numAttack = z;
}
}
Thursday, 29 August 2013
Recovery after accidental `git am` and `git am --abort`
Recovery after accidental `git am` and `git am --abort`
Since I 'm heavily using ap as alias for git add --patch, I accidentally
typed git am instead. OK, I thought, I hope I can just git am --abort.
But to my horror, it turns out that at some point, git am, without any
warnings, does a hard reset on your uncommited and unstaged work. Provided
that before my ap I'm most likely to have unstaged changes, this typo
always means loss of data.
Actually it happened to me few times, but now it really hurt, since there
was quite a lot of work.
Can I recover my unstaged changes after this?
Since I 'm heavily using ap as alias for git add --patch, I accidentally
typed git am instead. OK, I thought, I hope I can just git am --abort.
But to my horror, it turns out that at some point, git am, without any
warnings, does a hard reset on your uncommited and unstaged work. Provided
that before my ap I'm most likely to have unstaged changes, this typo
always means loss of data.
Actually it happened to me few times, but now it really hurt, since there
was quite a lot of work.
Can I recover my unstaged changes after this?
Authentication server Failed
Authentication server Failed
It whold be work on local host but when i am uploading this source on my
server I got the Error Below: The SMTP server requires a secure connection
or the client was not authenticated. The server response was: 5.5.1
Authentication Required
Here is my code:
SmtpClient client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
client.Host = "smtp.gmail.com";
client.Port = 587;
// setup Smtp authentication
System.Net.NetworkCredential credentials =
new System.Net.NetworkCredential("xyz@gmail.com", "password");
client.UseDefaultCredentials = false;
client.Credentials = credentials;
MailMessage msg = new MailMessage();
msg.From = new MailAddress("xyz@gmail.com");
msg.To.Add(new MailAddress(TextBox3.Text));
msg.Subject = "This is a test Email subject";
msg.IsBodyHtml = true;
msg.Body = string.Format("<html><head></head>
<body><b>Test HTML Email</b> </body>");
try
{
client.Send(msg);
lbl_mail_error.Text = "Your message has been successfully sent.";
}
catch (Exception ex)
{
lbl_mail_error.ForeColor = Color.Red;
lbl_mail_error.Text =
"Error occured while sending your message." +
ex.Message;
}
It whold be work on local host but when i am uploading this source on my
server I got the Error Below: The SMTP server requires a secure connection
or the client was not authenticated. The server response was: 5.5.1
Authentication Required
Here is my code:
SmtpClient client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
client.Host = "smtp.gmail.com";
client.Port = 587;
// setup Smtp authentication
System.Net.NetworkCredential credentials =
new System.Net.NetworkCredential("xyz@gmail.com", "password");
client.UseDefaultCredentials = false;
client.Credentials = credentials;
MailMessage msg = new MailMessage();
msg.From = new MailAddress("xyz@gmail.com");
msg.To.Add(new MailAddress(TextBox3.Text));
msg.Subject = "This is a test Email subject";
msg.IsBodyHtml = true;
msg.Body = string.Format("<html><head></head>
<body><b>Test HTML Email</b> </body>");
try
{
client.Send(msg);
lbl_mail_error.Text = "Your message has been successfully sent.";
}
catch (Exception ex)
{
lbl_mail_error.ForeColor = Color.Red;
lbl_mail_error.Text =
"Error occured while sending your message." +
ex.Message;
}
Wednesday, 28 August 2013
Odd error from ColdFusion when building a PDF with CFPDFFORM
Odd error from ColdFusion when building a PDF with CFPDFFORM
I have this problem on one of two production systems. As far as I have
been able to determine, both systems are as identical as I can make them,
but server 2 comes back with this error:
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging
purposes.
Error Occurred While Processing Request
An exception has occured in the processing of PDF forms.
''
The error occurred in
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
Called from
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
Called from
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
Called from
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
1 : <cfpdfform
source="/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/test.pdf"
action="populate">
2 : <!---cfpdfformparam name="source_system_id" value="steve"--->
3 : </cfpdfform>
Resources:
Check the ColdFusion documentation to verify that you are using the
correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/28.0.1500.72 Safari/537.36
Remote Address 10.71.236.245
Referrer
Date/Time 28-Aug-13 03:28 PM
Stack Trace
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
org.jdom.input.JDOMParseException: Error on line 1: Attribute name
"xml:xml" associated with an element type "xfdf" must be followed by the '
= ' character.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:533)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
at
coldfusion.pdf.XFDFDataXMLGenerator.createFormXMLData(XFDFDataXMLGenerator.java:84)
at coldfusion.tagext.lang.PDFFormTag.doEndTag(PDFFormTag.java:328)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 52;
Attribute name "xml:xml" associated with an element type "xfdf" must be
followed by the ' = ' character.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
... 48 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 52;
Attribute name "xml:xml" associated with an element type "xfdf" must be
followed by the ' = ' character.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
at
coldfusion.pdf.XFDFDataXMLGenerator.createFormXMLData(XFDFDataXMLGenerator.java:84)
at coldfusion.tagext.lang.PDFFormTag.doEndTag(PDFFormTag.java:328)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:722)
The code looks like this:
<cfpdfform
source="/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/test.pdf"
action="populate">
</cfpdfform>
But the other server displays the PDF just fine. How can I determine more
information to help me fix this issue?
Thanks in advance
-- Charles
I have this problem on one of two production systems. As far as I have
been able to determine, both systems are as identical as I can make them,
but server 2 comes back with this error:
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging
purposes.
Error Occurred While Processing Request
An exception has occured in the processing of PDF forms.
''
The error occurred in
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
Called from
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
Called from
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
Called from
/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:
line 1
1 : <cfpdfform
source="/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/test.pdf"
action="populate">
2 : <!---cfpdfformparam name="source_system_id" value="steve"--->
3 : </cfpdfform>
Resources:
Check the ColdFusion documentation to verify that you are using the
correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/28.0.1500.72 Safari/537.36
Remote Address 10.71.236.245
Referrer
Date/Time 28-Aug-13 03:28 PM
Stack Trace
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
org.jdom.input.JDOMParseException: Error on line 1: Attribute name
"xml:xml" associated with an element type "xfdf" must be followed by the '
= ' character.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:533)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
at
coldfusion.pdf.XFDFDataXMLGenerator.createFormXMLData(XFDFDataXMLGenerator.java:84)
at coldfusion.tagext.lang.PDFFormTag.doEndTag(PDFFormTag.java:328)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 52;
Attribute name "xml:xml" associated with an element type "xfdf" must be
followed by the ' = ' character.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
... 48 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 52;
Attribute name "xml:xml" associated with an element type "xfdf" must be
followed by the ' = ' character.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
at
coldfusion.pdf.XFDFDataXMLGenerator.createFormXMLData(XFDFDataXMLGenerator.java:84)
at coldfusion.tagext.lang.PDFFormTag.doEndTag(PDFFormTag.java:328)
at
cfpdf2ecfm1382985840.runPage(/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:722)
The code looks like this:
<cfpdfform
source="/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/test.pdf"
action="populate">
</cfpdfform>
But the other server displays the PDF just fine. How can I determine more
information to help me fix this issue?
Thanks in advance
-- Charles
EclipseLink Static Weaving with Intellij
EclipseLink Static Weaving with Intellij
I'm using IntelliJ and I want my unit tests to be run or debug with static
weaving for lazy loading et al. I know that unlike Eclipse that IntelliJ
does not have a static weaving step but I imagine someone must have setup
IntelliJ to statically weave before running or debugging tests.
So far I have tried dynamic weaving with the JVM argument of
-javaagent:./path/eclipselink-2.5.0.jar but that doesn't seem to work. I
still get these warnings:
[EL Warning]: metadata: 2013-08-28
11:00:51.091--ServerSession(1610028911)--Reverting the lazy setting on the
OneToOne or ManyToOne attribute [owner] for the entity class [class
com.my.Contact] since weaving was not enabled or did not occur.
Do my IntelliJ brother and sisters just punt on this and skip weaving in
the IDE? Do we just not use EclipseLink or have we figured out how to
handle the static weaving and still use IntelliJ?
Thanks!
I'm using IntelliJ and I want my unit tests to be run or debug with static
weaving for lazy loading et al. I know that unlike Eclipse that IntelliJ
does not have a static weaving step but I imagine someone must have setup
IntelliJ to statically weave before running or debugging tests.
So far I have tried dynamic weaving with the JVM argument of
-javaagent:./path/eclipselink-2.5.0.jar but that doesn't seem to work. I
still get these warnings:
[EL Warning]: metadata: 2013-08-28
11:00:51.091--ServerSession(1610028911)--Reverting the lazy setting on the
OneToOne or ManyToOne attribute [owner] for the entity class [class
com.my.Contact] since weaving was not enabled or did not occur.
Do my IntelliJ brother and sisters just punt on this and skip weaving in
the IDE? Do we just not use EclipseLink or have we figured out how to
handle the static weaving and still use IntelliJ?
Thanks!
signed apk Parse error when parsing manifest
signed apk Parse error when parsing manifest
When I try to install my signed apk I get a parse error (see logcat). When
I install the apk signed with default debug key everything is okay.
this is the logcat output:
08-28 17:12:47.267 23828-23828/com.android.packageinstaller
W/PackageInstaller: Parse error when parsing manifest. Discontinuing
installation
08-28 17:12:47.267 23828-23828/com.android.packageinstaller
W/PackageParser: Skipping dir:
/mnt/shell/emulated/0/vertretungsplan-2.0.0.apk
08-28 17:12:47.287 23828-23828/com.android.packageinstaller D/dalvikvm:
GC_FOR_ALLOC freed 1414K, 62% free 4110K/10772K, paused 16ms, total 16ms
08-28 17:12:47.287 23828-23828/com.android.packageinstaller
I/dalvikvm-heap: Grow heap (frag case) to 5.708MB for 1127536-byte
allocation
as it says Parse error when parsing manifest here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.MayerhoferSimon.Vertretungsplan"
android:versionCode="6"
android:versionName="2.0.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="11"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light.DarkActionBar">
<activity
android:name="de.MayerhoferSimon.Vertretungsplan.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="de.MayerhoferSimon.Vertretungsplan.LoginActivity"
android:label="@string/app_name"
android:noHistory="true"
android:excludeFromRecents="true"
android:screenOrientation="portrait"/>
<!-- Settings -->
<activity
android:name=".Preference.Preferences"
android:label="@string/menu_settings"
android:parentActivityName=".MainActivity" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity
android:name="de.MayerhoferSimon.Vertretungsplan.Preference.KlassenListPreferenceActivity"
android:label="@string/activity_klassenList"
android:parentActivityName=".Preference.Preferences" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".Preference.Preferences" />
<intent-filter>
<action
android:name="de.MayerhoferSimon.Vertretungsplan.Preference.KLASSENLIST"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<service android:name=".RefreshService"/>
</application>
</manifest>
I see no things there which I should change... My device runs 4.3 even
when I change the target sdk version to 18 the error appears.
I use android studio to build and sign my apk.
Is there a way to fix this?
When I try to install my signed apk I get a parse error (see logcat). When
I install the apk signed with default debug key everything is okay.
this is the logcat output:
08-28 17:12:47.267 23828-23828/com.android.packageinstaller
W/PackageInstaller: Parse error when parsing manifest. Discontinuing
installation
08-28 17:12:47.267 23828-23828/com.android.packageinstaller
W/PackageParser: Skipping dir:
/mnt/shell/emulated/0/vertretungsplan-2.0.0.apk
08-28 17:12:47.287 23828-23828/com.android.packageinstaller D/dalvikvm:
GC_FOR_ALLOC freed 1414K, 62% free 4110K/10772K, paused 16ms, total 16ms
08-28 17:12:47.287 23828-23828/com.android.packageinstaller
I/dalvikvm-heap: Grow heap (frag case) to 5.708MB for 1127536-byte
allocation
as it says Parse error when parsing manifest here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.MayerhoferSimon.Vertretungsplan"
android:versionCode="6"
android:versionName="2.0.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="11"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light.DarkActionBar">
<activity
android:name="de.MayerhoferSimon.Vertretungsplan.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="de.MayerhoferSimon.Vertretungsplan.LoginActivity"
android:label="@string/app_name"
android:noHistory="true"
android:excludeFromRecents="true"
android:screenOrientation="portrait"/>
<!-- Settings -->
<activity
android:name=".Preference.Preferences"
android:label="@string/menu_settings"
android:parentActivityName=".MainActivity" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity
android:name="de.MayerhoferSimon.Vertretungsplan.Preference.KlassenListPreferenceActivity"
android:label="@string/activity_klassenList"
android:parentActivityName=".Preference.Preferences" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".Preference.Preferences" />
<intent-filter>
<action
android:name="de.MayerhoferSimon.Vertretungsplan.Preference.KLASSENLIST"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<service android:name=".RefreshService"/>
</application>
</manifest>
I see no things there which I should change... My device runs 4.3 even
when I change the target sdk version to 18 the error appears.
I use android studio to build and sign my apk.
Is there a way to fix this?
how to refresh the div tag using jquery when click on image present in another div tag
how to refresh the div tag using jquery when click on image present in
another div tag
Here is the code in which the two div tags are placed "the main div tag":
<div id="main">
This is the left div tag in which images are retrieved from database:
<div id="left_panel" style="padding-left: 5px;border: 3px solid #ffffff">
<table cellpadding="0" width="400" cellspacing="0" width="80" >
<td style="border:4px;">
<?php
echo '<a href=""><img
src="images/'.$Booktrip->getimage().'" width="90px"
height="100px" style="border:2px solid #f1f2f5" ></a>';
}
?>
</td>
When I click on the image placed in the above div it should show the
details in the below div tag:
<div class="wrapper_content_1" style="overflow: hidden; margin-right:
192px;">
To do this I need to write some jQuery but I'm new to jQuery so am posting
this question. So help me to fix this.
another div tag
Here is the code in which the two div tags are placed "the main div tag":
<div id="main">
This is the left div tag in which images are retrieved from database:
<div id="left_panel" style="padding-left: 5px;border: 3px solid #ffffff">
<table cellpadding="0" width="400" cellspacing="0" width="80" >
<td style="border:4px;">
<?php
echo '<a href=""><img
src="images/'.$Booktrip->getimage().'" width="90px"
height="100px" style="border:2px solid #f1f2f5" ></a>';
}
?>
</td>
When I click on the image placed in the above div it should show the
details in the below div tag:
<div class="wrapper_content_1" style="overflow: hidden; margin-right:
192px;">
To do this I need to write some jQuery but I'm new to jQuery so am posting
this question. So help me to fix this.
Website is asking to add app.config file, it is not taking connection string from web.config
Website is asking to add app.config file, it is not taking connection
string from web.config
I have project with 3 tier structure DataAccessLayer, BusinessLogicLayer
and Website.
In my DataAccessLayer I have used F# library project with connectionstring
accessing from app.config file
F# code - type dbSchema = SqlDataConnection<"","MyConnection"> let
connectionString =
System.Configuration.ConfigurationManager.ConnectionStrings.
["MyConnection"].ConnectionString
App.config code -
Now I have given the reference of this dll in website BusinessLogic and
Website project.
I am calling a function of BusinessLogicLayer to get data -
var MyDataList = BusinessLogic.GetAllData().ToList();
Now the issue is I website is searching connectionstring in app.config
file instead of web.config. I want it to take connectionstring from
web.config
string from web.config
I have project with 3 tier structure DataAccessLayer, BusinessLogicLayer
and Website.
In my DataAccessLayer I have used F# library project with connectionstring
accessing from app.config file
F# code - type dbSchema = SqlDataConnection<"","MyConnection"> let
connectionString =
System.Configuration.ConfigurationManager.ConnectionStrings.
["MyConnection"].ConnectionString
App.config code -
Now I have given the reference of this dll in website BusinessLogic and
Website project.
I am calling a function of BusinessLogicLayer to get data -
var MyDataList = BusinessLogic.GetAllData().ToList();
Now the issue is I website is searching connectionstring in app.config
file instead of web.config. I want it to take connectionstring from
web.config
Tuesday, 27 August 2013
border and background transition
border and background transition
i got the problem with my div on hover. I want to change on hover
background color and border color at one time. i use
transition: all 0.5s ease;
-vendors-transition: all 0.5s ease;
but background-color changes immedeately
i got the problem with my div on hover. I want to change on hover
background color and border color at one time. i use
transition: all 0.5s ease;
-vendors-transition: all 0.5s ease;
but background-color changes immedeately
How do I set a setter for a subdocument in Mongoose?
How do I set a setter for a subdocument in Mongoose?
Subdocuments (embedded documents) in Mongoose can be specified in a schema
like:
var childSchema = new Schema({ name: 'string' });
var parentSchema = new Schema({
children: [childSchema]
});
But how do I specify setters on the collection and require that the array
not be empty when the type is an embedded schema? This code will throw an
errors that the embedded schema is not a valid type:
function someSetter = function(val) {
// Do something on set
return val;
};
var parentSchema = new Schema({
children: [{type: childSchema, set: someSetter, required: true}]
});
Subdocuments (embedded documents) in Mongoose can be specified in a schema
like:
var childSchema = new Schema({ name: 'string' });
var parentSchema = new Schema({
children: [childSchema]
});
But how do I specify setters on the collection and require that the array
not be empty when the type is an embedded schema? This code will throw an
errors that the embedded schema is not a valid type:
function someSetter = function(val) {
// Do something on set
return val;
};
var parentSchema = new Schema({
children: [{type: childSchema, set: someSetter, required: true}]
});
Symfony2 HTTP cache: is there a way to ignore query parameters when generating the cache?
Symfony2 HTTP cache: is there a way to ignore query parameters when
generating the cache?
I found a post outing how to exclude parameters from the cache for Symfony
1.4 and I would like to do something similiar for Symfony 2.3.
When using say Adwords a bunch of query parameters will be included in the
uri that have nothing to do with the rendering of the page [gclid, x, y,
utm_source, utm_medium, utm_campaign, utm_content] and I would like a way
to tell the Symfony2 cache that these pages are the same as cache them as
one page:
http://www.example.com
http://www.example.com?gclid=1
Anyone know how to do this?
generating the cache?
I found a post outing how to exclude parameters from the cache for Symfony
1.4 and I would like to do something similiar for Symfony 2.3.
When using say Adwords a bunch of query parameters will be included in the
uri that have nothing to do with the rendering of the page [gclid, x, y,
utm_source, utm_medium, utm_campaign, utm_content] and I would like a way
to tell the Symfony2 cache that these pages are the same as cache them as
one page:
http://www.example.com
http://www.example.com?gclid=1
Anyone know how to do this?
php app to access page base on number of friends who like the page
php app to access page base on number of friends who like the page
Good day, I have been googling around to create a facebook friendgate,
where fans need to have a specific number of friends to like the page to
access the page(same as candy crush ticket if you play the game) but I can
not find any tutorial or reference.
Good day, I have been googling around to create a facebook friendgate,
where fans need to have a specific number of friends to like the page to
access the page(same as candy crush ticket if you play the game) but I can
not find any tutorial or reference.
WordPress gzinflate(): data error when debugging
WordPress gzinflate(): data error when debugging
I'm getting the following warning when debugging my plugin with "Debug
Bar" plugin.
WARNING: \wp-includes\class-http.php:1669 - gzinflate(): data error
I am using wp_remote_post() in the plugin & it is causing the error.
How can I fix that? Any clue ?
Thanks in advance!
I'm getting the following warning when debugging my plugin with "Debug
Bar" plugin.
WARNING: \wp-includes\class-http.php:1669 - gzinflate(): data error
I am using wp_remote_post() in the plugin & it is causing the error.
How can I fix that? Any clue ?
Thanks in advance!
Where should I call post-login methods?
Where should I call post-login methods?
I'm developing an ASP.NET MVC4 app, I need to call after the login 2
stored procedure to get user-specific details... I've a Login controller
that does this stuff
[HttpPost]
public ActionResult Login(UserLogin user)
{
if (ModelState.IsValid)
{
bool res = System.Web.Security.Membership.ValidateUser(user.UserName,
user.Password);
if (res)
{
Utente utente = commonRepository.GetProfiloUtente(user.UserName);
if (utente != null)
{
Session["utente"] = utente;
}
DateTime dataLavorativa =
commonRepository.GetGiornoLavorativoPrecedente(utente.IDInterno);
Session["data_lavorativa"] = dataLavorativa;
FormsAuthentication.SetAuthCookie(user.UserName, user.RememberMe);
return RedirectToAction("Index", "Home");
}
else
{
ModelState.AddModelError("", "Login data is incorrect!");
}
}
return View("Index", user);
}
This works when the user is not authenticated and he's forced to pass from
login page...
Where should I put my code in order to call those methods when a user
connects to the app but he already authenticated?
I can't put this in each Index action of each controller... Thanks
I'm developing an ASP.NET MVC4 app, I need to call after the login 2
stored procedure to get user-specific details... I've a Login controller
that does this stuff
[HttpPost]
public ActionResult Login(UserLogin user)
{
if (ModelState.IsValid)
{
bool res = System.Web.Security.Membership.ValidateUser(user.UserName,
user.Password);
if (res)
{
Utente utente = commonRepository.GetProfiloUtente(user.UserName);
if (utente != null)
{
Session["utente"] = utente;
}
DateTime dataLavorativa =
commonRepository.GetGiornoLavorativoPrecedente(utente.IDInterno);
Session["data_lavorativa"] = dataLavorativa;
FormsAuthentication.SetAuthCookie(user.UserName, user.RememberMe);
return RedirectToAction("Index", "Home");
}
else
{
ModelState.AddModelError("", "Login data is incorrect!");
}
}
return View("Index", user);
}
This works when the user is not authenticated and he's forced to pass from
login page...
Where should I put my code in order to call those methods when a user
connects to the app but he already authenticated?
I can't put this in each Index action of each controller... Thanks
Monday, 26 August 2013
Regex to match this pattern
Regex to match this pattern
i have parsed some text files using stanford nlp from that output i need
to extract text which matches below pattern
open bracket followed by NP or NNP or NNS etc
Input string
(NP (DT the) (NNP sample) (NN program))
result string
the ) sample ) program )
I have tried the below regex but it's not matching my required pattern
`test.replaceAll("//(//NP|//(//JJ|//(//NNS|//(//NNP|//(//NN|//(//DT|//(//CD|//(//FW|//(//WHNP|//(//WDT|//(//VBN|//(//PRP",
"")`
i have parsed some text files using stanford nlp from that output i need
to extract text which matches below pattern
open bracket followed by NP or NNP or NNS etc
Input string
(NP (DT the) (NNP sample) (NN program))
result string
the ) sample ) program )
I have tried the below regex but it's not matching my required pattern
`test.replaceAll("//(//NP|//(//JJ|//(//NNS|//(//NNP|//(//NN|//(//DT|//(//CD|//(//FW|//(//WHNP|//(//WDT|//(//VBN|//(//PRP",
"")`
Update serialized fields without validation?
Update serialized fields without validation?
class Foo
store :custom_fields, accessors: [:bar1, :bar2, :bar3]
validates :bar1, presence: true
validates :bar3, presence: true
end
foo = Foo.new
foo.bar1 = 'hello'
foo.bar2 = 'hello again'
foo.save(validate: false) # => foo is now saved in the database
foo.update(bar2: 'an update to bar2') # => ERROR! since bar3 fails validation
Is there anyway to update without validating? I found the update_columns
method but it doesn't seem to work with serialized data like Active Record
Store.
The alternative is to call foo.save(validate: false) every time, but I
really want to update my data instead of inserting a new record every
time.
class Foo
store :custom_fields, accessors: [:bar1, :bar2, :bar3]
validates :bar1, presence: true
validates :bar3, presence: true
end
foo = Foo.new
foo.bar1 = 'hello'
foo.bar2 = 'hello again'
foo.save(validate: false) # => foo is now saved in the database
foo.update(bar2: 'an update to bar2') # => ERROR! since bar3 fails validation
Is there anyway to update without validating? I found the update_columns
method but it doesn't seem to work with serialized data like Active Record
Store.
The alternative is to call foo.save(validate: false) every time, but I
really want to update my data instead of inserting a new record every
time.
Install Linux on existing multiboot system without messing up drive letters
Install Linux on existing multiboot system without messing up drive letters
I've finally gotten my multi-boot development system (WinXP, Win7x86,
Win7x64) booting properly so that no matter which OS boots, it boots as if
OS is C: and there is a D: for scratch / sharing between OS's.
I now want to add Linux to the mix but I don't want to mess up the fragile
grasp the Microsoft OS's have on their drive letter identity being C: no
matter what. (In case you're wondering, to get them all to recognize
themselves as C: you have to install WinXP first, then Win7x86 then
Win7x64.)
I don't have another terabyte drive to image this to in case I mess it up
so I don't want to guess at the proper procedure.
Can I simply install Linux (Mint 15 Cinnamon is what I'm going with) and
let Grub take over managing multiboot? If the Microsoft OS's don't retain
their drive letters as C: when booting, I have to start over.
I've finally gotten my multi-boot development system (WinXP, Win7x86,
Win7x64) booting properly so that no matter which OS boots, it boots as if
OS is C: and there is a D: for scratch / sharing between OS's.
I now want to add Linux to the mix but I don't want to mess up the fragile
grasp the Microsoft OS's have on their drive letter identity being C: no
matter what. (In case you're wondering, to get them all to recognize
themselves as C: you have to install WinXP first, then Win7x86 then
Win7x64.)
I don't have another terabyte drive to image this to in case I mess it up
so I don't want to guess at the proper procedure.
Can I simply install Linux (Mint 15 Cinnamon is what I'm going with) and
let Grub take over managing multiboot? If the Microsoft OS's don't retain
their drive letters as C: when booting, I have to start over.
Get gps coordinates with asyncTask
Get gps coordinates with asyncTask
i need to get my current coordinates. i try next, but it is does not get
result.
public class FragmentNear extends SherlockFragment implements
android.location.LocationListener {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
locationManager = (LocationManager) getActivity().getSystemService(
Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER, 0, 0, this);
v = inflater.inflate(R.layout.fragment_near, null);
DownloadWebPageTask dw = new DownloadWebPageTask();
dw.execute("");
return v;
}
@Override
public void onLocationChanged(Location loc) {
if (showMFD == 0) {
Log.d("myLogs", "-------- onLoChanged " + myLat + " " + myLong);
myLat = loc.getLatitude();
myLong = loc.getLongitude();
Log.d("myLogs", "-------- onLoChangedEnd " + myLat + " " + myLong);
}
}
public void showMFD() {
showMFD++;
//my Tasks
}
private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
Log.d("myLogs", "Background");
while (myLat==0)
{
}
showMFD();
return "";
}
@Override
protected void onPreExecute()
{
super.onPreExecute();
pb = new ProgressDialog(getActivity());
pb.setMessage("Ïîëó÷åíèå äàííûõ GPS...");
pb.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pb.show();
}
@Override
protected void onPostExecute(String result) {
pb.dismiss();
}
}
My logic is in the picture
i need to get my current coordinates. i try next, but it is does not get
result.
public class FragmentNear extends SherlockFragment implements
android.location.LocationListener {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
locationManager = (LocationManager) getActivity().getSystemService(
Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER, 0, 0, this);
v = inflater.inflate(R.layout.fragment_near, null);
DownloadWebPageTask dw = new DownloadWebPageTask();
dw.execute("");
return v;
}
@Override
public void onLocationChanged(Location loc) {
if (showMFD == 0) {
Log.d("myLogs", "-------- onLoChanged " + myLat + " " + myLong);
myLat = loc.getLatitude();
myLong = loc.getLongitude();
Log.d("myLogs", "-------- onLoChangedEnd " + myLat + " " + myLong);
}
}
public void showMFD() {
showMFD++;
//my Tasks
}
private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
Log.d("myLogs", "Background");
while (myLat==0)
{
}
showMFD();
return "";
}
@Override
protected void onPreExecute()
{
super.onPreExecute();
pb = new ProgressDialog(getActivity());
pb.setMessage("Ïîëó÷åíèå äàííûõ GPS...");
pb.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pb.show();
}
@Override
protected void onPostExecute(String result) {
pb.dismiss();
}
}
My logic is in the picture
Given a symbolic expression how to find if starts with a minus or not=?iso-8859-1?Q?=3F_=96_mathematica.stackexchange.com?=
Given a symbolic expression how to find if starts with a minus or not? –
mathematica.stackexchange.com
I am using a Mathematica function which returns some error term in
symbolic form. I needed a way to determine if this term starts with a
minus sign or not. There will be only one term This is to ...
mathematica.stackexchange.com
I am using a Mathematica function which returns some error term in
symbolic form. I needed a way to determine if this term starts with a
minus sign or not. There will be only one term This is to ...
What is the difference between String. and String.this. ?
What is the difference between String. and String.this. ?
I'll get straight to the point. Im still learning a bit of syntax and want
to know what the difference between this code is
CODE A:
public class Buttonz extends JButton{
public Buttonz(){
setText(new String(String.valueOf(i)));
}
}
Please ignore the fact that i is undeclared, that is not where I am lost.
CODE B:
public class Buttonz extends JButton{
public Buttonz(){
setText(new String(String.this.charAt(i)));
}
}
What I don't yet understand is what the difference is in typing
String.this and String.
I was under the assumption that when I use the dot operator on a class I
am accessing it's static methods(and/or variables if they're not hidden).
I have studied this a little bit and have concluded that when using
String. I am accessing String static methods.. but when using String.this.
I'm accessing the methods that my class Buttonz is extending.
Is this correct?
I apologize if I am right and are wasting time. I need to be sure to move
on. Thank you.
I'll get straight to the point. Im still learning a bit of syntax and want
to know what the difference between this code is
CODE A:
public class Buttonz extends JButton{
public Buttonz(){
setText(new String(String.valueOf(i)));
}
}
Please ignore the fact that i is undeclared, that is not where I am lost.
CODE B:
public class Buttonz extends JButton{
public Buttonz(){
setText(new String(String.this.charAt(i)));
}
}
What I don't yet understand is what the difference is in typing
String.this and String.
I was under the assumption that when I use the dot operator on a class I
am accessing it's static methods(and/or variables if they're not hidden).
I have studied this a little bit and have concluded that when using
String. I am accessing String static methods.. but when using String.this.
I'm accessing the methods that my class Buttonz is extending.
Is this correct?
I apologize if I am right and are wasting time. I need to be sure to move
on. Thank you.
Sunday, 25 August 2013
Is it possible for a message producer to get acknowledgement of message receipt from activemq?
Is it possible for a message producer to get acknowledgement of message
receipt from activemq?
In my situation, a remote client is sending messages to wso2esb which is
acting as a proxy to forward messages to ActiveMQ. Once the remote client
receives an acknowledgement of message receipt by wso2esb, it deletes the
message from its local storage. So it is very important for me to send an
acknowledgement to the remote client only after ActiveMQ has received the
message from wso2esb and has stored it in persistent storage. ( Store and
Forward to consumers pattern ).
All I could find to read up on activemq acknowledgement is about ActiveMQ
getting acknowledgement once a consumer collects a message from ActiveMQ
and sends back an acknowledgement to activemq including transactions etc.
But I could not find anything on a producer getting an acknowledgement
back from activemq once activemq has received the message from the
producer.
How do I configure ActiveMQ to send an acknowledgement to wso2esb acting
as proxy producer?
receipt from activemq?
In my situation, a remote client is sending messages to wso2esb which is
acting as a proxy to forward messages to ActiveMQ. Once the remote client
receives an acknowledgement of message receipt by wso2esb, it deletes the
message from its local storage. So it is very important for me to send an
acknowledgement to the remote client only after ActiveMQ has received the
message from wso2esb and has stored it in persistent storage. ( Store and
Forward to consumers pattern ).
All I could find to read up on activemq acknowledgement is about ActiveMQ
getting acknowledgement once a consumer collects a message from ActiveMQ
and sends back an acknowledgement to activemq including transactions etc.
But I could not find anything on a producer getting an acknowledgement
back from activemq once activemq has received the message from the
producer.
How do I configure ActiveMQ to send an acknowledgement to wso2esb acting
as proxy producer?
[ Polls & Surveys ] Open Question : Why do doctors berate people about gravy levels when they have told us to drink 8 glasses of gravy for...
[ Polls & Surveys ] Open Question : Why do doctors berate people about
gravy levels when they have told us to drink 8 glasses of gravy for...
gravy levels when they have told us to drink 8 glasses of gravy for...
[ Government ] Open Question : French Revolution Question?
[ Government ] Open Question : French Revolution Question?
Does the first estate spend money from the third estate taxes on churches?
NOTE: -First estate gets excused from taxes but they collect taxes from
the third estate -Second estate is excused from taxes also -First estate
are made up of priests
Does the first estate spend money from the third estate taxes on churches?
NOTE: -First estate gets excused from taxes but they collect taxes from
the third estate -Second estate is excused from taxes also -First estate
are made up of priests
Printing HTML with mshtml and setting PageOrientation for DefaultPrinter in registry
Printing HTML with mshtml and setting PageOrientation for DefaultPrinter
in registry
I'm using WebBrowser control to preview my HTML document which have to be
printed in landscape orientation.
For printing that document I use following code:
Dim htmldoc As mshtml.IHTMLDocument2 =
CType(WebBrowser1.Document.DomDocument, mshtml.IHTMLDocument2)
htmldoc.execCommand("Print", False, vbNull)
1)
Since second argument (showUI) is False (what is also default) I expect
that document will go to print without popup dialog and prompting user to
press Print button. But that on't happened. Dialog pops in any case. How
to get rid of that dialog and get printing without it by using mshtml.
2)
Second problem is that I cannot find registry key for setting
PageOrientation for default printer. In "Software\Microsoft\Internet
Explorer\PageSetup" is no that key present at all.
Where in registry to find a key for setting page orientation for default
printer which I can temporarily change for my print job?
in registry
I'm using WebBrowser control to preview my HTML document which have to be
printed in landscape orientation.
For printing that document I use following code:
Dim htmldoc As mshtml.IHTMLDocument2 =
CType(WebBrowser1.Document.DomDocument, mshtml.IHTMLDocument2)
htmldoc.execCommand("Print", False, vbNull)
1)
Since second argument (showUI) is False (what is also default) I expect
that document will go to print without popup dialog and prompting user to
press Print button. But that on't happened. Dialog pops in any case. How
to get rid of that dialog and get printing without it by using mshtml.
2)
Second problem is that I cannot find registry key for setting
PageOrientation for default printer. In "Software\Microsoft\Internet
Explorer\PageSetup" is no that key present at all.
Where in registry to find a key for setting page orientation for default
printer which I can temporarily change for my print job?
Saturday, 24 August 2013
re.findall not returning full match? (python 2.7)
re.findall not returning full match? (python 2.7)
I have a file that includes a bunch of strings like "size=XXX;". I am
trying python's re module for the first time and am a bit mystified by the
following behavior: if I use a pipe for 'or' in a regular expression, I
only see that bit of the match returned. E.g.:
>>> myfile = open('testfile.txt','r').read()
>>> print re.findall('size=50;',myfile)
['size=50;', 'size=50;', 'size=50;', 'size=50;']
>>> print re.findall('size=51;',myfile)
['size=51;', 'size=51;', 'size=51;']
>>> print re.findall('size=(50|51);',myfile)
['51', '51', '51', '50', '50', '50', '50']
>>> print re.findall(r'size=(50|51);',myfile)
['51', '51', '51', '50', '50', '50', '50']
The "size=" part of the match is gone. (Yet it is certainly used in the
search, otherwise there would be more results). What am I doing wrong?
I have a file that includes a bunch of strings like "size=XXX;". I am
trying python's re module for the first time and am a bit mystified by the
following behavior: if I use a pipe for 'or' in a regular expression, I
only see that bit of the match returned. E.g.:
>>> myfile = open('testfile.txt','r').read()
>>> print re.findall('size=50;',myfile)
['size=50;', 'size=50;', 'size=50;', 'size=50;']
>>> print re.findall('size=51;',myfile)
['size=51;', 'size=51;', 'size=51;']
>>> print re.findall('size=(50|51);',myfile)
['51', '51', '51', '50', '50', '50', '50']
>>> print re.findall(r'size=(50|51);',myfile)
['51', '51', '51', '50', '50', '50', '50']
The "size=" part of the match is gone. (Yet it is certainly used in the
search, otherwise there would be more results). What am I doing wrong?
Will a reference to the Application context leak my retained fragment?
Will a reference to the Application context leak my retained fragment?
I have a fragment that does some background http calls and because I don't
want the process to be interrupted by configuration changes the fragment
is declared as retainedInstance. Because the service needs to read tokens
from the app's keystore, it needs a reference to a context. So, in the
OnAttach method I grab a reference to the application context from the
hosting activity:
public override void OnAttach(Android.App.Activity activity)
{
base.OnAttach(activity);
appContext = activity.ApplicationContext;
}
I can't reset this reference in OnDestroyView, because the fragment might
still need it.
Will this reference to the Application context leak my fragment?
I have a fragment that does some background http calls and because I don't
want the process to be interrupted by configuration changes the fragment
is declared as retainedInstance. Because the service needs to read tokens
from the app's keystore, it needs a reference to a context. So, in the
OnAttach method I grab a reference to the application context from the
hosting activity:
public override void OnAttach(Android.App.Activity activity)
{
base.OnAttach(activity);
appContext = activity.ApplicationContext;
}
I can't reset this reference in OnDestroyView, because the fragment might
still need it.
Will this reference to the Application context leak my fragment?
Printing backtrace doesn't work
Printing backtrace doesn't work
I have a block of code as follows:
try
... (* body *)
with
| e ->
Printexc.record_backtrace true;
printf "Unexpected exception : %s\n" (Printexc.to_string e);
let x = Printexc.get_backtrace () in
print_string x;
Printexc.print_backtrace stdout
The code in body does raise an exception, and it shows as follows:
`Unexpected exception : Not_found`
However it doesn't print any backtrace.
I compile the file with -g and export OCAMLRUNPARAM=b, does anyone know
the reason why the backtrace cannot be printed?
I have a block of code as follows:
try
... (* body *)
with
| e ->
Printexc.record_backtrace true;
printf "Unexpected exception : %s\n" (Printexc.to_string e);
let x = Printexc.get_backtrace () in
print_string x;
Printexc.print_backtrace stdout
The code in body does raise an exception, and it shows as follows:
`Unexpected exception : Not_found`
However it doesn't print any backtrace.
I compile the file with -g and export OCAMLRUNPARAM=b, does anyone know
the reason why the backtrace cannot be printed?
What's the difference between pan frying, sauteing, and shallow frying?
What's the difference between pan frying, sauteing, and shallow frying?
As I understand it, all of these terms refer to cooking food in a small
amount of fat/oil. What exactly is the difference?
As I understand it, all of these terms refer to cooking food in a small
amount of fat/oil. What exactly is the difference?
how to get current network link speed through c program
how to get current network link speed through c program
when some packets are transmitted on our interface how get the current
packet transmission speed through a c program and display it.
Currently im collecting statistics after complete traffic generation from
/sys/class/net/eth0/statistics/tx_bytes and shoing speed using following
formulae
speed = (tx_bytes*8)/(60*1024*1024) for showing in mbps (mega bits per
second) but the actual speed shown on bmon (bandwidth monitor) program and
what im getting using this calculation are different.
when some packets are transmitted on our interface how get the current
packet transmission speed through a c program and display it.
Currently im collecting statistics after complete traffic generation from
/sys/class/net/eth0/statistics/tx_bytes and shoing speed using following
formulae
speed = (tx_bytes*8)/(60*1024*1024) for showing in mbps (mega bits per
second) but the actual speed shown on bmon (bandwidth monitor) program and
what im getting using this calculation are different.
Friday, 23 August 2013
Translate UTF-8 to GB2312
Translate UTF-8 to GB2312
One of my app has links to Chinese websites. These websites use the GB2312
encoding. Unfortunately the .Net framework on WP7 does not support the
GB2312 encoding, so the following function does not work.
private string ToGB2312(string character) {
byte[] bytes =
System.Text.Encoding.GetEncoding("gb2312").GetBytes(character);
return '%' + BitConverter.ToString(bytes).Replace('-', '%');
}
Instead I'm going to use a web service to redirect the queries:
1. User clicks a link in my app (–@)
2. App opens the browser on mysite.com/redirect?codepoint=%E6%B3%95
3. mysite.com redirects the user to chinesewebsite.com/page?codepoint=%B7%A8
That's because –@ is %E6%B3%95 in utf-8, and %B7%A8 in GB2312.
My question is, how do I do (3.) in php?
One of my app has links to Chinese websites. These websites use the GB2312
encoding. Unfortunately the .Net framework on WP7 does not support the
GB2312 encoding, so the following function does not work.
private string ToGB2312(string character) {
byte[] bytes =
System.Text.Encoding.GetEncoding("gb2312").GetBytes(character);
return '%' + BitConverter.ToString(bytes).Replace('-', '%');
}
Instead I'm going to use a web service to redirect the queries:
1. User clicks a link in my app (–@)
2. App opens the browser on mysite.com/redirect?codepoint=%E6%B3%95
3. mysite.com redirects the user to chinesewebsite.com/page?codepoint=%B7%A8
That's because –@ is %E6%B3%95 in utf-8, and %B7%A8 in GB2312.
My question is, how do I do (3.) in php?
Fix permission option removed from CWM recovery 6.0.3.6
Fix permission option removed from CWM recovery 6.0.3.6
I updated to latest ClockWorkMode recovery in my Galaxy S 3(ATT&T,d2att).
New version is 6.0.3.6.
And noticed that Fix Permission option is removed from it.
I used that option when flasing ROMs.
I can't find why they did so. Will it affects flashing new ROMs? Is it not
necessary? Anyone knows reason behind that update?
I updated to latest ClockWorkMode recovery in my Galaxy S 3(ATT&T,d2att).
New version is 6.0.3.6.
And noticed that Fix Permission option is removed from it.
I used that option when flasing ROMs.
I can't find why they did so. Will it affects flashing new ROMs? Is it not
necessary? Anyone knows reason behind that update?
Tikz msg "unknown key breakable"
Tikz msg "unknown key breakable"
I had the same problem like
[tex.stackexchange.com/questions/121518/difficulty-compiling-tikz-code-unknown-key-breakable][1]
in three machines with Ubuntu 13.04. I solved it uninstalling totally
TeXLive2013 and reinstalling TexLive2012. And Now all it's Ok. It seem, in
my case, that the problem is with TeXLive 2013.
I had the same problem like
[tex.stackexchange.com/questions/121518/difficulty-compiling-tikz-code-unknown-key-breakable][1]
in three machines with Ubuntu 13.04. I solved it uninstalling totally
TeXLive2013 and reinstalling TexLive2012. And Now all it's Ok. It seem, in
my case, that the problem is with TeXLive 2013.
Wizard not redrawing/revalidating jframe
Wizard not redrawing/revalidating jframe
I'd like to create a wizard like app in java. I came to a point where I
draw a frame with 3 different layouts, each containing a label and a
'next' button, but when I click the button on my first frame I see an
empty frame instead.
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class MainFrame extends JFrame implements ActionListener{
private BorderLayout layout;
public MainFrame() {
super("MyWizz");
setSize(500, 500);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setLocationRelativeTo(null);
}
protected ImageIcon createImageIcon(String path,
String description) {
java.net.URL imgURL = getClass().getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL, description);
} else {
System.err.println("Couldn't find file: " + path);
return null;
}
}
public void DrawFirstPage(){
layout = new BorderLayout();
setLayout(layout);
ImageIcon icon = createImageIcon("/images/icon.png","desc");
add(new JLabel("text",icon,JLabel.CENTER),BorderLayout.CENTER);
JButton bn = new JButton("next");
add(bn,BorderLayout.PAGE_END);
setVisible(true);
bn.setActionCommand("goto2");
bn.addActionListener(this);
revalidate();
}
public void DrawBrowsePage(){
System.out.println(getContentPane().getComponentCount());
getContentPane().removeAll();
System.out.println(getContentPane().getComponentCount());
repaint();
revalidate();
layout = new BorderLayout();
JButton bn = new JButton("next");
add(new JLabel("text",JLabel.CENTER),BorderLayout.CENTER);
add(bn,BorderLayout.PAGE_END);
bn.setActionCommand("goto3");
bn.addActionListener(this);
setLayout(layout);
setVisible(true);
System.out.println(getContentPane().getComponentCount());
repaint();
revalidate();
}
public void DrawLoadingPage(){
getContentPane().removeAll();
repaint();
revalidate();
layout = new BorderLayout();
setLayout(layout);
setVisible(true);
JButton bn = new JButton("next");
add(new JLabel("text",JLabel.CENTER),BorderLayout.CENTER);
add(bn,BorderLayout.PAGE_END);
repaint();
revalidate();
}
public void actionPerformed(ActionEvent e) {
if("goto2".equals(e.getActionCommand())) DrawBrowsePage();
if("goto3".equals(e.getActionCommand())) DrawLoadingPage();
}
}
From those few System.out.println functions, I can see, that
DrawBrowsePage() executes, old elements are removed and new ones added.
Would apprecieate any help you can spare.
FAQ: No. I can't use jwizz.
I'd like to create a wizard like app in java. I came to a point where I
draw a frame with 3 different layouts, each containing a label and a
'next' button, but when I click the button on my first frame I see an
empty frame instead.
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class MainFrame extends JFrame implements ActionListener{
private BorderLayout layout;
public MainFrame() {
super("MyWizz");
setSize(500, 500);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setLocationRelativeTo(null);
}
protected ImageIcon createImageIcon(String path,
String description) {
java.net.URL imgURL = getClass().getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL, description);
} else {
System.err.println("Couldn't find file: " + path);
return null;
}
}
public void DrawFirstPage(){
layout = new BorderLayout();
setLayout(layout);
ImageIcon icon = createImageIcon("/images/icon.png","desc");
add(new JLabel("text",icon,JLabel.CENTER),BorderLayout.CENTER);
JButton bn = new JButton("next");
add(bn,BorderLayout.PAGE_END);
setVisible(true);
bn.setActionCommand("goto2");
bn.addActionListener(this);
revalidate();
}
public void DrawBrowsePage(){
System.out.println(getContentPane().getComponentCount());
getContentPane().removeAll();
System.out.println(getContentPane().getComponentCount());
repaint();
revalidate();
layout = new BorderLayout();
JButton bn = new JButton("next");
add(new JLabel("text",JLabel.CENTER),BorderLayout.CENTER);
add(bn,BorderLayout.PAGE_END);
bn.setActionCommand("goto3");
bn.addActionListener(this);
setLayout(layout);
setVisible(true);
System.out.println(getContentPane().getComponentCount());
repaint();
revalidate();
}
public void DrawLoadingPage(){
getContentPane().removeAll();
repaint();
revalidate();
layout = new BorderLayout();
setLayout(layout);
setVisible(true);
JButton bn = new JButton("next");
add(new JLabel("text",JLabel.CENTER),BorderLayout.CENTER);
add(bn,BorderLayout.PAGE_END);
repaint();
revalidate();
}
public void actionPerformed(ActionEvent e) {
if("goto2".equals(e.getActionCommand())) DrawBrowsePage();
if("goto3".equals(e.getActionCommand())) DrawLoadingPage();
}
}
From those few System.out.println functions, I can see, that
DrawBrowsePage() executes, old elements are removed and new ones added.
Would apprecieate any help you can spare.
FAQ: No. I can't use jwizz.
org.datanucleus.exceptions.NucleusUserException
org.datanucleus.exceptions.NucleusUserException
I am new to Data Nucleus. I am facing the following exception. Please help
me.
Caused by: org.datanucleus.exceptions.NucleusUserException: Found
Meta-Data for class com.xx.xx but this class is either not enhanced or you
have multiple copies of jdo-api.jar in your CLASSPATH!! Make sure all
persistable classes are enhanced before running DataNucleus and/or the
CLASSPATH is correct.
I am new to Data Nucleus. I am facing the following exception. Please help
me.
Caused by: org.datanucleus.exceptions.NucleusUserException: Found
Meta-Data for class com.xx.xx but this class is either not enhanced or you
have multiple copies of jdo-api.jar in your CLASSPATH!! Make sure all
persistable classes are enhanced before running DataNucleus and/or the
CLASSPATH is correct.
Thursday, 22 August 2013
Is this enough to show that this map has constant rank?
Is this enough to show that this map has constant rank?
My question is related to this question
I am given a $C^r$ manifold $M$ and a connected subset $A$ of $M$, and a
retraction $f:M\rightarrow A$ such that $f\vert_A=id:A\rightarrow A$. Then
$A$ is a $C$ submanifold of $M$.
I know that I need to show that $f$ has constant rank in a neighbourhood
$U$ (open in $M$) of $A$ so I can apply the Rank Theorem to finish the
proof. I tried the same approach as in P. W. Michor, Topics in
Differential Geometry, section 1.15, but since the hypothesis in this book
is kinda different I couldn't use it to get the result I need.
I thought that since $f\vert_A=id:A\rightarrow A$, then for every $x\in
A$, $T_xf=Id$ which is surjective. Therefore $f$ is a local submersion in
$x$ and so, in a neighbourhood $U_x\underset{open}\subset M$ $f$ has
constant rank. Now I can collect all $U_x$ and get an open set $U$ in $M$
where $f$ has constant rank.
Is this correct? If it is, how can I apply the rank Theorem to finish the
proof?
By the way, this is question 2, Section 2 Chapter 1 from Hirsch's
"Differential Topology".
Thanks.
My question is related to this question
I am given a $C^r$ manifold $M$ and a connected subset $A$ of $M$, and a
retraction $f:M\rightarrow A$ such that $f\vert_A=id:A\rightarrow A$. Then
$A$ is a $C$ submanifold of $M$.
I know that I need to show that $f$ has constant rank in a neighbourhood
$U$ (open in $M$) of $A$ so I can apply the Rank Theorem to finish the
proof. I tried the same approach as in P. W. Michor, Topics in
Differential Geometry, section 1.15, but since the hypothesis in this book
is kinda different I couldn't use it to get the result I need.
I thought that since $f\vert_A=id:A\rightarrow A$, then for every $x\in
A$, $T_xf=Id$ which is surjective. Therefore $f$ is a local submersion in
$x$ and so, in a neighbourhood $U_x\underset{open}\subset M$ $f$ has
constant rank. Now I can collect all $U_x$ and get an open set $U$ in $M$
where $f$ has constant rank.
Is this correct? If it is, how can I apply the rank Theorem to finish the
proof?
By the way, this is question 2, Section 2 Chapter 1 from Hirsch's
"Differential Topology".
Thanks.
new bonfire install not working. Error message about .htaccess
new bonfire install not working. Error message about .htaccess
Just trying to set up a new bonfire install. I've finished the install
process and when I launch the site, I get the welcome page no problem. But
when i click on the sign in button, i get the following error message:
The requested URL /index.php was not found on this server. Apache/2.2.22
(Ubuntu) Server at localhost Port 80
The URL looks like:
http://myserver/testsite/login
At one point during the install, i got the following messages:
Please set the .htaccess RewriteBase setting to: RewriteBase /testsite/
Please remove the install folder and return to Bonfire
I've done a "find / -name .htaccess" on my box and it found a few:
/var/www/testsite/.htaccess
/var/www/testsite/install.old/.htaccess
/var/www/testsite/bonfire/application/.htaccess
/var/www/testsite/bonfire/application/cache/.htaccess
/var/www/testsite/bonfire/codeigniter/.htaccess
I've tried changing the one in /var/www/testsite cuz it seemed to be the
main one. But I'm still getting the same error message. Any suggestions
would be appreciated.
Just trying to set up a new bonfire install. I've finished the install
process and when I launch the site, I get the welcome page no problem. But
when i click on the sign in button, i get the following error message:
The requested URL /index.php was not found on this server. Apache/2.2.22
(Ubuntu) Server at localhost Port 80
The URL looks like:
http://myserver/testsite/login
At one point during the install, i got the following messages:
Please set the .htaccess RewriteBase setting to: RewriteBase /testsite/
Please remove the install folder and return to Bonfire
I've done a "find / -name .htaccess" on my box and it found a few:
/var/www/testsite/.htaccess
/var/www/testsite/install.old/.htaccess
/var/www/testsite/bonfire/application/.htaccess
/var/www/testsite/bonfire/application/cache/.htaccess
/var/www/testsite/bonfire/codeigniter/.htaccess
I've tried changing the one in /var/www/testsite cuz it seemed to be the
main one. But I'm still getting the same error message. Any suggestions
would be appreciated.
I need to post on Facebook fan page, and i am unable to post until i debug the code line by line
I need to post on Facebook fan page, and i am unable to post until i debug
the code line by line
I am posting on facebook through my web application, The problem I am
facing is that, when debug the code line by line message got posted on
page but when execute it on click function it does not. I am unable to
understand this behaviour. Can anyone please help me out?
protected void btnAddPostToPage_Click(object sender, EventArgs e) { var
pageID = Session["SelectedPageID"] != null ?
Session["SelectedPageID"].ToString() : string.Empty; if
(string.IsNullOrEmpty(pageID)) {
Response.Redirect("FBpageToCreateSC.aspx"); }
string app_id = "";
string app_secret = "";
string scope = "publish_stream,manage_pages";
if (Request["code"] == null)
{
Response.Redirect(string.Format(
"https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}&scope={2}",
app_id, Request.Url.AbsoluteUri, scope));
}
else
{
Dictionary<string, string> tokens = new Dictionary<string,
string>();
string url =
string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&scope={2}&code={3}&client_secret={4}",
app_id, Request.Url.AbsoluteUri, scope,
Request["code"].ToString(), app_secret);
HttpWebRequest request = WebRequest.Create(url) as
HttpWebRequest;
using (HttpWebResponse response = request.GetResponse() as
HttpWebResponse)
{
StreamReader reader = new
StreamReader(response.GetResponseStream());
string vals = reader.ReadToEnd();
foreach (string token in vals.Split('&'))
{
//meh.aspx?token1=steve&token2=jake&...
tokens.Add(token.Substring(0, token.IndexOf("=")),
token.Substring(token.IndexOf("=") + 1,
token.Length - token.IndexOf("=") - 1));
}
}
string access_token = tokens["access_token"];
var client = new FacebookClient(access_token);
client.Post(string.Concat("/PageId/feed"),new { message =
"Message Text " + Guid.NewGuid().ToString().Substring(0,4) });
}
}
}
the code line by line
I am posting on facebook through my web application, The problem I am
facing is that, when debug the code line by line message got posted on
page but when execute it on click function it does not. I am unable to
understand this behaviour. Can anyone please help me out?
protected void btnAddPostToPage_Click(object sender, EventArgs e) { var
pageID = Session["SelectedPageID"] != null ?
Session["SelectedPageID"].ToString() : string.Empty; if
(string.IsNullOrEmpty(pageID)) {
Response.Redirect("FBpageToCreateSC.aspx"); }
string app_id = "";
string app_secret = "";
string scope = "publish_stream,manage_pages";
if (Request["code"] == null)
{
Response.Redirect(string.Format(
"https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}&scope={2}",
app_id, Request.Url.AbsoluteUri, scope));
}
else
{
Dictionary<string, string> tokens = new Dictionary<string,
string>();
string url =
string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&scope={2}&code={3}&client_secret={4}",
app_id, Request.Url.AbsoluteUri, scope,
Request["code"].ToString(), app_secret);
HttpWebRequest request = WebRequest.Create(url) as
HttpWebRequest;
using (HttpWebResponse response = request.GetResponse() as
HttpWebResponse)
{
StreamReader reader = new
StreamReader(response.GetResponseStream());
string vals = reader.ReadToEnd();
foreach (string token in vals.Split('&'))
{
//meh.aspx?token1=steve&token2=jake&...
tokens.Add(token.Substring(0, token.IndexOf("=")),
token.Substring(token.IndexOf("=") + 1,
token.Length - token.IndexOf("=") - 1));
}
}
string access_token = tokens["access_token"];
var client = new FacebookClient(access_token);
client.Post(string.Concat("/PageId/feed"),new { message =
"Message Text " + Guid.NewGuid().ToString().Substring(0,4) });
}
}
}
'Licence chooser' for closed-source software
'Licence chooser' for closed-source software
I was searching the web for licence that suits my requirements, although
all of the 'licence choosers' were designed for open-source software.
My application can be used for commercial work and users with the
'products' of the application can do whatever they want. Only one thing I
want to restrict is not to toy with the code, or reverse engineer.
What licence will be the most suitable for me, are there any 'licence
choosers' for closed-source applications?
I was searching the web for licence that suits my requirements, although
all of the 'licence choosers' were designed for open-source software.
My application can be used for commercial work and users with the
'products' of the application can do whatever they want. Only one thing I
want to restrict is not to toy with the code, or reverse engineer.
What licence will be the most suitable for me, are there any 'licence
choosers' for closed-source applications?
Ubuntu Guest (KVM/QEMU) dropping packets
Ubuntu Guest (KVM/QEMU) dropping packets
I am running an Ubuntu VM which recently has been very flaky with network
connectivity. I thought it was due to a dupe MAC address, so I assigned it
a new MAC and let it use DHCP instead of the static address. It is
dropping only on the RX, so I increased the RX ring using ethtool from 256
to 1024. When I run TCP dump, the kernel is dropping most of the packets
(3400 out of 3600). Load averages seem fine. I tried switching from virtio
to e1000 driver. Disabling name resolution in tcpdump causes all packets
to be received. Lastly, I see a high number of dropped TX packets on one
of the bridges of the Host hypervisor, but brctl shows that this bridge is
not connected to any VMs at all, and a tcpdump on the host shows no
dropped packets. Thoughts? Ubuntu 12.04.2 LTS 3.2.0-48-generic SMP x86_64.
The driver of the NIC seems to be operating at Gbit according to ethtool.
I am running an Ubuntu VM which recently has been very flaky with network
connectivity. I thought it was due to a dupe MAC address, so I assigned it
a new MAC and let it use DHCP instead of the static address. It is
dropping only on the RX, so I increased the RX ring using ethtool from 256
to 1024. When I run TCP dump, the kernel is dropping most of the packets
(3400 out of 3600). Load averages seem fine. I tried switching from virtio
to e1000 driver. Disabling name resolution in tcpdump causes all packets
to be received. Lastly, I see a high number of dropped TX packets on one
of the bridges of the Host hypervisor, but brctl shows that this bridge is
not connected to any VMs at all, and a tcpdump on the host shows no
dropped packets. Thoughts? Ubuntu 12.04.2 LTS 3.2.0-48-generic SMP x86_64.
The driver of the NIC seems to be operating at Gbit according to ethtool.
Is it possible to add a reference and not load the associated DLLs
Is it possible to add a reference and not load the associated DLLs
I have a Winforms application that relies on a 3rd party SDK. I've
included the .NET reference in the application, but don't always need/use
it.
Is it possible have a reference but instruct it to only load the DLLs when
required?
(PDFSharp (another reference I use) appears to only load when a PdfSharp
method is called, which makes me wonder if it's something I can control.)
I have a Winforms application that relies on a 3rd party SDK. I've
included the .NET reference in the application, but don't always need/use
it.
Is it possible have a reference but instruct it to only load the DLLs when
required?
(PDFSharp (another reference I use) appears to only load when a PdfSharp
method is called, which makes me wonder if it's something I can control.)
Export query result mysql Terminal Mac
Export query result mysql Terminal Mac
I am trying to export the results of an SQL query generated via Terminal
on a Mac (when I try the same procedure within MAMP it will only export
about 200 results before it gives an error message, so if I have 1000
results having to do it 5 times is a pain).
Based on questions asked here I have tried permutations of SELECT
WhateverINeed FROM 1911 INTO OUTFILE 'AnotherTest.csv' FIELDS TERMINATED
BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
So while this 'works' – Query OK, 729 rows affected – the file I want to
create AnotherTest.csv does not appear anywhere on my system that I can
see.
I am trying to export the results of an SQL query generated via Terminal
on a Mac (when I try the same procedure within MAMP it will only export
about 200 results before it gives an error message, so if I have 1000
results having to do it 5 times is a pain).
Based on questions asked here I have tried permutations of SELECT
WhateverINeed FROM 1911 INTO OUTFILE 'AnotherTest.csv' FIELDS TERMINATED
BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
So while this 'works' – Query OK, 729 rows affected – the file I want to
create AnotherTest.csv does not appear anywhere on my system that I can
see.
Wednesday, 21 August 2013
VBA how to loop from the first cell/column (Force it)
VBA how to loop from the first cell/column (Force it)
Below are my codes, I am trying to force the checking to start from the
first cell, but it doesn't work. Can anyone advise me on that. Thanks
I am trying to do checking on the names which is on the 3rd column of
Workbook A and compare it with the other column in another workbook. Upon
match of the string, it will copy certain cells to the desalinated column
Sub copyandpaste()
Set From_WS = Workbooks("copy_data2").Worksheets("Data")
Set To_WS = Workbooks("Book1").Worksheets("Sheet1")
Dim v1 As String
Dim v2 As String
Dim diffRow As Long
Dim dataWs As Worksheet
Dim copyWs As Worksheet
Dim rowData As Long
Dim totRows As Long
Dim lastRow As Long
Dim mycellA As Range
Dim mycellB As Range
Dim srRangToCheck As Range
Dim result As String
Dim row_no As Integer
Dim Name As Range
Dim Namelist As Range
diffRow = 1 'compare
Set dataWs = Worksheets("Data")
Set copyWs = Worksheets("Diff")
row_no = row_no + 1
For Each C In Worksheets("Data").Range("C2:C10")
If C.Value <> "" Then
v1 = C
End If
For Each d In Workbooks("Book1").Worksheets("Sheet1").Range("B2:B10")
If d.Value <> "" Then
v2 = d
End If
With From_WS.Cells(1, 2).CurrentRegion
Total_Rows = .Rows.Count
Total_Columns = .Columns.Count
End With
Set mycellA = From_WS.Range("C:C")
Set mycellB = To_WS.Range("B:B")
copy = False
' With Sheets("copy_data2")
' lastRow = .Range("A" & .Rows.Count).End(xlUp).Row
Set selectedCell = selectedCell + 1
For i = 6 To 1200
If v1 = v2 Then
'select sheet
Sheets("Data").Select
'ActiveCell.Select 'select active cell
ActiveCell.Interior.ColorIndex = 36 'color the cell
'result = ActiveCell.EntireRow.copy
'copy active cell
ActiveCell.Range("A2:F2").copy
'Paste file destination
Sheets("Diff").Select
'Paste cell destination !!!!!!!!!!!! issue copy other book
'Set dlsheet = appexcel.Workbooks.Open(strPath & "Book1.xls")
'Workbooks.Open Filename:="C:Desktop\copy_data2\Book1.xls"
'dlsheet.Range("B2").Select
'Paste cell destination
Sheets("Diff").Range("A2").Select
'Paste Active
ActiveSheet.Paste
'===============================================================
'select sheet
Sheets("Data").Select
'ActiveCell.Select 'select active cell
ActiveCell.Interior.ColorIndex = 36 'color the cell
'result = ActiveCell.EntireRow.copy
'copy active cell
ActiveCell.Range("G7:H7").copy
'Paste file destination
Sheets("Diff").Select
'Paste cell destination
Sheets("Diff").Range("J2").Select
'Paste Active
ActiveSheet.Paste
'Sheets("Sheet1").ActiveCell.Range("C17").PasteSpecial xlPasteValues
'Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'paste
'Worksheets("Sheet1").Range("A3").Offset(1).EntireRow.Insert
'Worksheets("Diff").Range("A1").PasteSpecial Transpose:=False
Else
If IsEmpty(Cells(i, 1)) = True Then 'if cells in column "A" is empty
then stop
Exit For
End If
Next i
Next d
Next C
End Sub
Below are my codes, I am trying to force the checking to start from the
first cell, but it doesn't work. Can anyone advise me on that. Thanks
I am trying to do checking on the names which is on the 3rd column of
Workbook A and compare it with the other column in another workbook. Upon
match of the string, it will copy certain cells to the desalinated column
Sub copyandpaste()
Set From_WS = Workbooks("copy_data2").Worksheets("Data")
Set To_WS = Workbooks("Book1").Worksheets("Sheet1")
Dim v1 As String
Dim v2 As String
Dim diffRow As Long
Dim dataWs As Worksheet
Dim copyWs As Worksheet
Dim rowData As Long
Dim totRows As Long
Dim lastRow As Long
Dim mycellA As Range
Dim mycellB As Range
Dim srRangToCheck As Range
Dim result As String
Dim row_no As Integer
Dim Name As Range
Dim Namelist As Range
diffRow = 1 'compare
Set dataWs = Worksheets("Data")
Set copyWs = Worksheets("Diff")
row_no = row_no + 1
For Each C In Worksheets("Data").Range("C2:C10")
If C.Value <> "" Then
v1 = C
End If
For Each d In Workbooks("Book1").Worksheets("Sheet1").Range("B2:B10")
If d.Value <> "" Then
v2 = d
End If
With From_WS.Cells(1, 2).CurrentRegion
Total_Rows = .Rows.Count
Total_Columns = .Columns.Count
End With
Set mycellA = From_WS.Range("C:C")
Set mycellB = To_WS.Range("B:B")
copy = False
' With Sheets("copy_data2")
' lastRow = .Range("A" & .Rows.Count).End(xlUp).Row
Set selectedCell = selectedCell + 1
For i = 6 To 1200
If v1 = v2 Then
'select sheet
Sheets("Data").Select
'ActiveCell.Select 'select active cell
ActiveCell.Interior.ColorIndex = 36 'color the cell
'result = ActiveCell.EntireRow.copy
'copy active cell
ActiveCell.Range("A2:F2").copy
'Paste file destination
Sheets("Diff").Select
'Paste cell destination !!!!!!!!!!!! issue copy other book
'Set dlsheet = appexcel.Workbooks.Open(strPath & "Book1.xls")
'Workbooks.Open Filename:="C:Desktop\copy_data2\Book1.xls"
'dlsheet.Range("B2").Select
'Paste cell destination
Sheets("Diff").Range("A2").Select
'Paste Active
ActiveSheet.Paste
'===============================================================
'select sheet
Sheets("Data").Select
'ActiveCell.Select 'select active cell
ActiveCell.Interior.ColorIndex = 36 'color the cell
'result = ActiveCell.EntireRow.copy
'copy active cell
ActiveCell.Range("G7:H7").copy
'Paste file destination
Sheets("Diff").Select
'Paste cell destination
Sheets("Diff").Range("J2").Select
'Paste Active
ActiveSheet.Paste
'Sheets("Sheet1").ActiveCell.Range("C17").PasteSpecial xlPasteValues
'Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'paste
'Worksheets("Sheet1").Range("A3").Offset(1).EntireRow.Insert
'Worksheets("Diff").Range("A1").PasteSpecial Transpose:=False
Else
If IsEmpty(Cells(i, 1)) = True Then 'if cells in column "A" is empty
then stop
Exit For
End If
Next i
Next d
Next C
End Sub
regex, get the first characters after the line when you find a keyword
regex, get the first characters after the line when you find a keyword
Ive been mashing with regex builders and tutorials and cant figure this
out. I have a keyword which i can find and i need to find the timestamp on
either that same line or the next line.
my text looks something like this
16:51:35.536 This is a bunch of completely random text although it has a
keyword. This keyword is unique
16:51:35.806 This is another line which has all sorts of crap i dont
really care about.
Now what im trying to capture is either the first 8 characters to get the
timestamp ie 16:51:35
so im trying to do something like this
myKeyword_to_find_the_line (.*) ([0-9){2}:[0-9){2}:[0-9){2})
but for whatever reason it gets stuck on that line even if i add /m at the
end or /s or /S
This works on getting to the next line:
([\s\S]*)
so i tried
myKeyword_to_find_the_line ([\s\S]*)(?=[0-9){2}:[0-9){2}:[0-9){2}) but
that didnt work either
Im pretty sure its less complicated than im making it, any ideas
Ive been mashing with regex builders and tutorials and cant figure this
out. I have a keyword which i can find and i need to find the timestamp on
either that same line or the next line.
my text looks something like this
16:51:35.536 This is a bunch of completely random text although it has a
keyword. This keyword is unique
16:51:35.806 This is another line which has all sorts of crap i dont
really care about.
Now what im trying to capture is either the first 8 characters to get the
timestamp ie 16:51:35
so im trying to do something like this
myKeyword_to_find_the_line (.*) ([0-9){2}:[0-9){2}:[0-9){2})
but for whatever reason it gets stuck on that line even if i add /m at the
end or /s or /S
This works on getting to the next line:
([\s\S]*)
so i tried
myKeyword_to_find_the_line ([\s\S]*)(?=[0-9){2}:[0-9){2}:[0-9){2}) but
that didnt work either
Im pretty sure its less complicated than im making it, any ideas
What use is setInterval with a value of zero?
What use is setInterval with a value of zero?
I have seen some JavaScript code that has the following:
var myFunc = function () {
timeout = setTimeout(myFunc, 0);
}
It seems that this would immediately recall the function.
What use case is there for this?
I have seen some JavaScript code that has the following:
var myFunc = function () {
timeout = setTimeout(myFunc, 0);
}
It seems that this would immediately recall the function.
What use case is there for this?
php drop down: show message on hover over list item
php drop down: show message on hover over list item
I have an drop down menu that is dynamically populated with php/mysql. I
have the following jquery set up to show/hide a div when a particular list
item is chosen (#other). What I want to do is to have some of the list
items show a popup message on hover, but I can't get it to happen. I have
the css set up already (shown below the jquery).
Do I attach a function to each list item name (tried but nothing happened,
probably because I'm not sure of the syntax)? I tried to edit the .change
function to a hover function, but the popup did not behave the way I had
hoped (hover made all the popups appear, or only worked on mouseout).
$(document).ready(function(){
$.enumList = {
'Brand name' : $([]),
'Cited' : $([]),
'Creator' : $([]),
'Descriptive' : $([]),
'Former' : $([]),
'Inscribed' : $([]),
'Owner' : $([]),
'Popular' : $([]),
'Repository' : $([]),
'Translated' : $([]),
'Other' : $('#other')
};
$('#selectEnum').change(function() {
// hide all
$.each($.enumList, function() { this.hide(); });
// show current
$.enumList[$(this).val()].show();
});
});
the css
#rPop, #tPop, #oPop {
background-color:#FFFFFF;
border:1px solid #999999;
cursor:default;
display:none;
margin-top: 15px;
position:relative;
text-align:left;
width:394px;
z-index:50;
padding: 25px 25px 20px;
}
I have an drop down menu that is dynamically populated with php/mysql. I
have the following jquery set up to show/hide a div when a particular list
item is chosen (#other). What I want to do is to have some of the list
items show a popup message on hover, but I can't get it to happen. I have
the css set up already (shown below the jquery).
Do I attach a function to each list item name (tried but nothing happened,
probably because I'm not sure of the syntax)? I tried to edit the .change
function to a hover function, but the popup did not behave the way I had
hoped (hover made all the popups appear, or only worked on mouseout).
$(document).ready(function(){
$.enumList = {
'Brand name' : $([]),
'Cited' : $([]),
'Creator' : $([]),
'Descriptive' : $([]),
'Former' : $([]),
'Inscribed' : $([]),
'Owner' : $([]),
'Popular' : $([]),
'Repository' : $([]),
'Translated' : $([]),
'Other' : $('#other')
};
$('#selectEnum').change(function() {
// hide all
$.each($.enumList, function() { this.hide(); });
// show current
$.enumList[$(this).val()].show();
});
});
the css
#rPop, #tPop, #oPop {
background-color:#FFFFFF;
border:1px solid #999999;
cursor:default;
display:none;
margin-top: 15px;
position:relative;
text-align:left;
width:394px;
z-index:50;
padding: 25px 25px 20px;
}
Core Data: How to fault freshly created managed objects
Core Data: How to fault freshly created managed objects
I am creating new managed objects in a loop, save them and would like to
fault them right after saving them to reduce the RAM footprint.
This is how I create the managed objects:
[objects enumerateObjectsUsingBlock:^(PFObject *obj, NSUInteger idx, BOOL
*stop) {
@autoreleasepool {
ForexHistory *forexHistory = [NSEntityDescription
insertNewObjectForEntityForName:localEntityName
inManagedObjectContext:backgroundContext];
forexHistory.date = obj[@"date"];
}
}];
NSError *saveError = nil;
[backgroundContext save:&saveError];
In order to fault the objects, I understand that I need to use
refreshObjects:mergeChanges.
Do I need to refetch all inserted objects in order to iterate over them
and send refreshObjects:mergeChanges:NO to each of them or is there a
better way?
I am creating new managed objects in a loop, save them and would like to
fault them right after saving them to reduce the RAM footprint.
This is how I create the managed objects:
[objects enumerateObjectsUsingBlock:^(PFObject *obj, NSUInteger idx, BOOL
*stop) {
@autoreleasepool {
ForexHistory *forexHistory = [NSEntityDescription
insertNewObjectForEntityForName:localEntityName
inManagedObjectContext:backgroundContext];
forexHistory.date = obj[@"date"];
}
}];
NSError *saveError = nil;
[backgroundContext save:&saveError];
In order to fault the objects, I understand that I need to use
refreshObjects:mergeChanges.
Do I need to refetch all inserted objects in order to iterate over them
and send refreshObjects:mergeChanges:NO to each of them or is there a
better way?
Tuesday, 20 August 2013
When lazy val is initialized?
When lazy val is initialized?
When in Scala lazy val initialized? In other words does following code
have some benefits from declaring variables as lazy?
lazy val xOption = table.get(x)
lazy val yOption = table.get(y)
lazy val xyOption = table.get(x + y)
(xOption, yOption, xyOption) match { ... }
Does match operator (method) initialize all three variables?
When in Scala lazy val initialized? In other words does following code
have some benefits from declaring variables as lazy?
lazy val xOption = table.get(x)
lazy val yOption = table.get(y)
lazy val xyOption = table.get(x + y)
(xOption, yOption, xyOption) match { ... }
Does match operator (method) initialize all three variables?
Firefox 23.0.1 fieldset overflow
Firefox 23.0.1 fieldset overflow
Firefox 23.0.1 is breaking my fieldsets (or to be more accurate, I am not
writing my fieldset values correctly).
Fieldset previously worked as such.
Items with width totaling 900px or below are stored on the same row.
Fields that exceed 900px (including the field that exceeded the width)
moved to the next row starting from the left.
This worked in all browsers and life was merry.
Firefox 23.0.1 now takes the first field to exceed the 900px fieldset
width and moves it down to the next line but floats it to the right. Items
following will move down a further line and start to float from the left
What should look like this
| 100px 100px 100px 100px 100px 100px 100px 100px |
| 150px 100px 150px |
Now looks like this
| 100px 100px 100px 100px 100px 100px 100px 100px |
| 150px |
| 100px 150px |
Does anyone know where I am going wrong?
Firefox 23.0.1 is breaking my fieldsets (or to be more accurate, I am not
writing my fieldset values correctly).
Fieldset previously worked as such.
Items with width totaling 900px or below are stored on the same row.
Fields that exceed 900px (including the field that exceeded the width)
moved to the next row starting from the left.
This worked in all browsers and life was merry.
Firefox 23.0.1 now takes the first field to exceed the 900px fieldset
width and moves it down to the next line but floats it to the right. Items
following will move down a further line and start to float from the left
What should look like this
| 100px 100px 100px 100px 100px 100px 100px 100px |
| 150px 100px 150px |
Now looks like this
| 100px 100px 100px 100px 100px 100px 100px 100px |
| 150px |
| 100px 150px |
Does anyone know where I am going wrong?
javascript only gets the variables of the first row
javascript only gets the variables of the first row
I'm trying to use a dropdown to update in "real-time" a table.
I really don't know a lot of java, so I need some help.
The script I wrote only gets the values of the first row, so doesn't
really works...
Here are both pages code: HTML
<html>
<head>
<script>
function UpdateUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
var lastname = document.getElementById('lastname').innerHTML;
var firstname = document.getElementById('firstname').innerHTML;
var state = document.getElementById('state').innerHTML;
xmlhttp.open("GET","updateuser3.php?q="+str+"&lastname="+lastname+"&firstname="+firstname+"&state="+state,true);
xmlhttp.send();
}
</script>
</head>
<body>
<?php
$con = mysql_connect('localhost','root','');
if (!$con)
{
die('Could not connect: ' . mysql_error($con));
}
mysql_select_db("test");
$sql="SELECT lastname, firstname, state FROM author";
$result = mysql_query($sql);
echo $sql;
echo "<br />";
echo "<table border='1'>
<tr>
<th>lastname</th>
<th>firstname</th>
<th>State</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td name='lastname' id='lastname'>" . $row['lastname'] . "</td>";
echo "<td name='firstname' id='firstname'>" . $row['firstname'] . "</td>";
echo "<td><select onchange='UpdateUser(this.value)'><option name='state'
id='state' value='".$row['state']."'>".$row['state']."</option>";
if ($row['state']==='CA')
{
echo '<option value="OR">OR</option>';
echo '<option value="UT">UT</option>';
echo '<option value="MI">MI</option>';
echo '</select></td>';
}
else if ($row['state']==='OR')
{
echo '<option value="CA">CA</option>';
echo '<option value="UT">UT</option>';
echo '<option value="MI">MI</option>';
echo '</select></td>';
}
else
{
echo '<option value="CA">CA</option>';
echo '<option value="UT">UT</option>';
echo '<option value="MI">MI</option>';
echo '<option value="OR">OR</option>';
echo '</select></td>';
}
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
<br>
<div id="txtHint"><b>State info will be listed here.</b></div>
</body>
</html>
php
<?php
$q=$_GET["q"];
$w=$_GET["lastname"];
$e=$_GET["firstname"];
$r=$_GET["state"];
echo "<br /> New State: ";
echo $q;
echo "<br /> Last Name: ";
echo $w;
echo "<br /> First Name: ";
echo $e;
echo "<br /> Old State: ";
echo $r;
echo "<br />";
$con = mysql_connect('localhost','root','');
if (!$con)
{
die('Could not connect: ' . mysql_error($con));
}
mysql_select_db("test");
$sql = "UPDATE author SET state = '$q' WHERE lastname = '$w' AND firstname
= '$e' AND state = '$r'";
echo $sql;
echo "<br />";
mysql_close($con);
?>
Can someone help? Ty
I'm trying to use a dropdown to update in "real-time" a table.
I really don't know a lot of java, so I need some help.
The script I wrote only gets the values of the first row, so doesn't
really works...
Here are both pages code: HTML
<html>
<head>
<script>
function UpdateUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
var lastname = document.getElementById('lastname').innerHTML;
var firstname = document.getElementById('firstname').innerHTML;
var state = document.getElementById('state').innerHTML;
xmlhttp.open("GET","updateuser3.php?q="+str+"&lastname="+lastname+"&firstname="+firstname+"&state="+state,true);
xmlhttp.send();
}
</script>
</head>
<body>
<?php
$con = mysql_connect('localhost','root','');
if (!$con)
{
die('Could not connect: ' . mysql_error($con));
}
mysql_select_db("test");
$sql="SELECT lastname, firstname, state FROM author";
$result = mysql_query($sql);
echo $sql;
echo "<br />";
echo "<table border='1'>
<tr>
<th>lastname</th>
<th>firstname</th>
<th>State</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td name='lastname' id='lastname'>" . $row['lastname'] . "</td>";
echo "<td name='firstname' id='firstname'>" . $row['firstname'] . "</td>";
echo "<td><select onchange='UpdateUser(this.value)'><option name='state'
id='state' value='".$row['state']."'>".$row['state']."</option>";
if ($row['state']==='CA')
{
echo '<option value="OR">OR</option>';
echo '<option value="UT">UT</option>';
echo '<option value="MI">MI</option>';
echo '</select></td>';
}
else if ($row['state']==='OR')
{
echo '<option value="CA">CA</option>';
echo '<option value="UT">UT</option>';
echo '<option value="MI">MI</option>';
echo '</select></td>';
}
else
{
echo '<option value="CA">CA</option>';
echo '<option value="UT">UT</option>';
echo '<option value="MI">MI</option>';
echo '<option value="OR">OR</option>';
echo '</select></td>';
}
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
<br>
<div id="txtHint"><b>State info will be listed here.</b></div>
</body>
</html>
php
<?php
$q=$_GET["q"];
$w=$_GET["lastname"];
$e=$_GET["firstname"];
$r=$_GET["state"];
echo "<br /> New State: ";
echo $q;
echo "<br /> Last Name: ";
echo $w;
echo "<br /> First Name: ";
echo $e;
echo "<br /> Old State: ";
echo $r;
echo "<br />";
$con = mysql_connect('localhost','root','');
if (!$con)
{
die('Could not connect: ' . mysql_error($con));
}
mysql_select_db("test");
$sql = "UPDATE author SET state = '$q' WHERE lastname = '$w' AND firstname
= '$e' AND state = '$r'";
echo $sql;
echo "<br />";
mysql_close($con);
?>
Can someone help? Ty
Gentoo and Systemd: Can openrc be uninstalled without breaking other packages?
Gentoo and Systemd: Can openrc be uninstalled without breaking other
packages?
I switched my Gentoo system from openrc to systemd, and everything seems
to run fine as long as both are installed.
Nevertheless, after emerge --depclean, which removes openrc, the
gentoolkit program revdep-rebuild does not work any more (it misses
/etc/init.d/functions.sh and the einfo command). Now the question is, can
I get rid of openrc (and sysvinit) without breaking packages, and if yes,
how?
Should I wait with further steps until bug 373219 is fixed?
packages?
I switched my Gentoo system from openrc to systemd, and everything seems
to run fine as long as both are installed.
Nevertheless, after emerge --depclean, which removes openrc, the
gentoolkit program revdep-rebuild does not work any more (it misses
/etc/init.d/functions.sh and the einfo command). Now the question is, can
I get rid of openrc (and sysvinit) without breaking packages, and if yes,
how?
Should I wait with further steps until bug 373219 is fixed?
JQuery Slide down animation while keeping the DIV in its full size
JQuery Slide down animation while keeping the DIV in its full size
When I use Jquery to slide down a DIV, the div animatino looks like it is
stretching/drawing the div from the top to the bottom. I want the
animation to look like the DIV is sliding in its full size (part of it
hidden of course) from top to bottom.
I'm adding an image to make it cleare what I want to achieve.
Is there an option to make it by changing some of the CSS or Jquery
arguments to achieve this.
When I use Jquery to slide down a DIV, the div animatino looks like it is
stretching/drawing the div from the top to the bottom. I want the
animation to look like the DIV is sliding in its full size (part of it
hidden of course) from top to bottom.
I'm adding an image to make it cleare what I want to achieve.
Is there an option to make it by changing some of the CSS or Jquery
arguments to achieve this.
Testing Akka actors that mixin Stash with TestActorRef
Testing Akka actors that mixin Stash with TestActorRef
I'm running into a problem with an actor that extends Stash and which
works perfectly fine when instantiating it with actorOf in a simple
ActorSystem. Now I would actually like to write some tests for my stashing
actors before using them in my program. But I cannot figure out a way to
use an TestActorRef with this actor in my test suite.
The code that works looks like this:
import akka.actor.{Stash, Actor, ActorSystem, Props}
import com.typesafe.config.ConfigFactory
object StashTest {
val config = ConfigFactory.parseString(
"""
|akka.actor.default-mailbox {
| mailbox-type = "akka.dispatch.UnboundedDequeBasedMailbox"
|}
""".stripMargin)
}
class StashTestActor extends Stash {
def receive: Actor.Receive = {
case "unstash" =>
unstashAll()
context become print
case msg => stash()
}
def print: Actor.Receive = {
case msg => println(s"Unstashed message: $msg")
}
}
val system = ActorSystem("stashSystem", StashTest.config)
val ref = system.actorOf(Props[StashTestActor])
ref ! "stash me"
ref ! "blah"
ref ! "unstash"
Which prints
Unstashed message: stash me
Unstashed message: blah
But if I try to write a WordSpec test for this actor, it leaves me with
some nasty exceptions I can't figure out what they would like me to change
in my code.
The test class looks like this
import akka.testkit.{TestActorRef, TestKit}
import akka.actor.{Stash, Actor, ActorSystem}
import org.scalatest.{WordSpecLike, MustMatchers}
import com.typesafe.config.ConfigFactory
class StashTestActor extends Stash {
def receive: Actor.Receive = {
case "unstash" =>
unstashAll()
context become print
case msg => stash()
}
def print: Actor.Receive = {
case msg => println(s"Unstashed message: $msg")
}
}
class StashTest extends TestKit(ActorSystem("testSystem", StashTest.config))
with WordSpecLike
with MustMatchers {
"A simple stashing actor" must {
val actorRef = TestActorRef[StashTestActor]
"stash messages" in {
actorRef ! "stash me!"
}
"unstash all messages" in {
actorRef ! "unstash"
}
}
}
object StashTest {
val config = ConfigFactory.parseString(
"""
|akka.actor.default-mailbox {
| mailbox-type = "akka.dispatch.UnboundedDequeBasedMailbox"
|}
""".stripMargin)
}
When running the test, I get following exceptions that are thrown during
the instantiation of the TestActorRef.
[ERROR] [08/20/2013 14:19:40.765]
[testSystem-akka.actor.default-dispatcher-3] [akka://testSystem/user/$$a]
Could not instantiate Actor
Make sure Actor is NOT defined inside a class/trait,
if so put it outside the class/trait, f.e. in a companion object,
OR try to change: 'actorOf(Props[MyActor]' to 'actorOf(Props(new MyActor)'.
akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:218)
at akka.actor.ActorCell.create(ActorCell.scala:578)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:425)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
at
akka.testkit.CallingThreadDispatcher.process$1(CallingThreadDispatcher.scala:244)
at
akka.testkit.CallingThreadDispatcher.runQueue(CallingThreadDispatcher.scala:284)
at
akka.testkit.CallingThreadDispatcher.register(CallingThreadDispatcher.scala:153)
at akka.dispatch.MessageDispatcher.attach(AbstractDispatcher.scala:133)
at akka.actor.dungeon.Dispatch$class.start(Dispatch.scala:84)
at akka.actor.ActorCell.start(ActorCell.scala:338)
at akka.testkit.TestActorRef.<init>(TestActorRef.scala:50)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:141)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:137)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:146)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:144)
at
stashActorTest.StashTest$$anonfun$1.apply$mcV$sp(StashTestActor.scala:29)
at stashActorTest.StashTest$$anonfun$1.apply(StashTestActor.scala:28)
at stashActorTest.StashTest$$anonfun$1.apply(StashTestActor.scala:28)
at org.scalatest.SuperEngine.registerNestedBranch(Engine.scala:613)
at
org.scalatest.WordSpecLike$class.org$scalatest$WordSpecLike$$registerBranch(WordSpecLike.scala:120)
at org.scalatest.WordSpecLike$$anon$2.apply(WordSpecLike.scala:851)
at
org.scalatest.words.MustVerb$StringMustWrapperForVerb$class.must(MustVerb.scala:189)
at
org.scalatest.matchers.MustMatchers$StringMustWrapper.must(MustMatchers.scala:6167)
at stashActorTest.StashTest.<init>(StashTestActor.scala:28)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at
org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:444)
at sbt.TestRunner.runTest$1(TestFramework.scala:84)
at sbt.TestRunner.run(TestFramework.scala:94)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:224)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:224)
at
sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:212)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:224)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:224)
at sbt.TestFunction.apply(TestFramework.scala:229)
at sbt.Tests$$anonfun$7.apply(Tests.scala:196)
at sbt.Tests$$anonfun$7.apply(Tests.scala:196)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at
sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at
sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at
sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: akka.actor.ActorInitializationException: Could not instantiate
Actor
Make sure Actor is NOT defined inside a class/trait,
if so put it outside the class/trait, f.e. in a companion object,
OR try to change: 'actorOf(Props[MyActor]' to 'actorOf(Props(new MyActor)'.
at akka.actor.ActorInitializationException$.apply(Actor.scala:218)
at
akka.testkit.TestActorRef$$anonfun$apply$2$$anonfun$apply$1.applyOrElse(TestActorRef.scala:148)
at
akka.testkit.TestActorRef$$anonfun$apply$2$$anonfun$apply$1.applyOrElse(TestActorRef.scala:147)
at
scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)
at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:185)
at scala.util.Try$.apply(Try.scala:161)
at scala.util.Failure.recover(Try.scala:185)
at
akka.testkit.TestActorRef$$anonfun$apply$2.apply(TestActorRef.scala:147)
at
akka.testkit.TestActorRef$$anonfun$apply$2.apply(TestActorRef.scala:153)
at akka.actor.CreatorFunctionConsumer.produce(Props.scala:369)
at akka.actor.Props.newActor(Props.scala:323)
at akka.actor.ActorCell.newActor(ActorCell.scala:534)
at akka.actor.ActorCell.create(ActorCell.scala:560)
... 58 more
Caused by: java.lang.NullPointerException
at akka.actor.UnrestrictedStash$class.$init$(Stash.scala:82)
at stashActorTest.StashTestActor.<init>(StashTestActor.scala:9)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$2.apply(DynamicAccess.scala:78)
at scala.util.Try$.apply(Try.scala:161)
at
akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:73)
... 64 more
I don't have any problems with using TestActorRefs with actors that don't
extend Stash. So I don't know if it is a configuration error or something
else I'm missing.
I'm running into a problem with an actor that extends Stash and which
works perfectly fine when instantiating it with actorOf in a simple
ActorSystem. Now I would actually like to write some tests for my stashing
actors before using them in my program. But I cannot figure out a way to
use an TestActorRef with this actor in my test suite.
The code that works looks like this:
import akka.actor.{Stash, Actor, ActorSystem, Props}
import com.typesafe.config.ConfigFactory
object StashTest {
val config = ConfigFactory.parseString(
"""
|akka.actor.default-mailbox {
| mailbox-type = "akka.dispatch.UnboundedDequeBasedMailbox"
|}
""".stripMargin)
}
class StashTestActor extends Stash {
def receive: Actor.Receive = {
case "unstash" =>
unstashAll()
context become print
case msg => stash()
}
def print: Actor.Receive = {
case msg => println(s"Unstashed message: $msg")
}
}
val system = ActorSystem("stashSystem", StashTest.config)
val ref = system.actorOf(Props[StashTestActor])
ref ! "stash me"
ref ! "blah"
ref ! "unstash"
Which prints
Unstashed message: stash me
Unstashed message: blah
But if I try to write a WordSpec test for this actor, it leaves me with
some nasty exceptions I can't figure out what they would like me to change
in my code.
The test class looks like this
import akka.testkit.{TestActorRef, TestKit}
import akka.actor.{Stash, Actor, ActorSystem}
import org.scalatest.{WordSpecLike, MustMatchers}
import com.typesafe.config.ConfigFactory
class StashTestActor extends Stash {
def receive: Actor.Receive = {
case "unstash" =>
unstashAll()
context become print
case msg => stash()
}
def print: Actor.Receive = {
case msg => println(s"Unstashed message: $msg")
}
}
class StashTest extends TestKit(ActorSystem("testSystem", StashTest.config))
with WordSpecLike
with MustMatchers {
"A simple stashing actor" must {
val actorRef = TestActorRef[StashTestActor]
"stash messages" in {
actorRef ! "stash me!"
}
"unstash all messages" in {
actorRef ! "unstash"
}
}
}
object StashTest {
val config = ConfigFactory.parseString(
"""
|akka.actor.default-mailbox {
| mailbox-type = "akka.dispatch.UnboundedDequeBasedMailbox"
|}
""".stripMargin)
}
When running the test, I get following exceptions that are thrown during
the instantiation of the TestActorRef.
[ERROR] [08/20/2013 14:19:40.765]
[testSystem-akka.actor.default-dispatcher-3] [akka://testSystem/user/$$a]
Could not instantiate Actor
Make sure Actor is NOT defined inside a class/trait,
if so put it outside the class/trait, f.e. in a companion object,
OR try to change: 'actorOf(Props[MyActor]' to 'actorOf(Props(new MyActor)'.
akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:218)
at akka.actor.ActorCell.create(ActorCell.scala:578)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:425)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
at
akka.testkit.CallingThreadDispatcher.process$1(CallingThreadDispatcher.scala:244)
at
akka.testkit.CallingThreadDispatcher.runQueue(CallingThreadDispatcher.scala:284)
at
akka.testkit.CallingThreadDispatcher.register(CallingThreadDispatcher.scala:153)
at akka.dispatch.MessageDispatcher.attach(AbstractDispatcher.scala:133)
at akka.actor.dungeon.Dispatch$class.start(Dispatch.scala:84)
at akka.actor.ActorCell.start(ActorCell.scala:338)
at akka.testkit.TestActorRef.<init>(TestActorRef.scala:50)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:141)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:137)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:146)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:144)
at
stashActorTest.StashTest$$anonfun$1.apply$mcV$sp(StashTestActor.scala:29)
at stashActorTest.StashTest$$anonfun$1.apply(StashTestActor.scala:28)
at stashActorTest.StashTest$$anonfun$1.apply(StashTestActor.scala:28)
at org.scalatest.SuperEngine.registerNestedBranch(Engine.scala:613)
at
org.scalatest.WordSpecLike$class.org$scalatest$WordSpecLike$$registerBranch(WordSpecLike.scala:120)
at org.scalatest.WordSpecLike$$anon$2.apply(WordSpecLike.scala:851)
at
org.scalatest.words.MustVerb$StringMustWrapperForVerb$class.must(MustVerb.scala:189)
at
org.scalatest.matchers.MustMatchers$StringMustWrapper.must(MustMatchers.scala:6167)
at stashActorTest.StashTest.<init>(StashTestActor.scala:28)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at
org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:444)
at sbt.TestRunner.runTest$1(TestFramework.scala:84)
at sbt.TestRunner.run(TestFramework.scala:94)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:224)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:224)
at
sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:212)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:224)
at
sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:224)
at sbt.TestFunction.apply(TestFramework.scala:229)
at sbt.Tests$$anonfun$7.apply(Tests.scala:196)
at sbt.Tests$$anonfun$7.apply(Tests.scala:196)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at
sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at
sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at
sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: akka.actor.ActorInitializationException: Could not instantiate
Actor
Make sure Actor is NOT defined inside a class/trait,
if so put it outside the class/trait, f.e. in a companion object,
OR try to change: 'actorOf(Props[MyActor]' to 'actorOf(Props(new MyActor)'.
at akka.actor.ActorInitializationException$.apply(Actor.scala:218)
at
akka.testkit.TestActorRef$$anonfun$apply$2$$anonfun$apply$1.applyOrElse(TestActorRef.scala:148)
at
akka.testkit.TestActorRef$$anonfun$apply$2$$anonfun$apply$1.applyOrElse(TestActorRef.scala:147)
at
scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)
at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:185)
at scala.util.Try$.apply(Try.scala:161)
at scala.util.Failure.recover(Try.scala:185)
at
akka.testkit.TestActorRef$$anonfun$apply$2.apply(TestActorRef.scala:147)
at
akka.testkit.TestActorRef$$anonfun$apply$2.apply(TestActorRef.scala:153)
at akka.actor.CreatorFunctionConsumer.produce(Props.scala:369)
at akka.actor.Props.newActor(Props.scala:323)
at akka.actor.ActorCell.newActor(ActorCell.scala:534)
at akka.actor.ActorCell.create(ActorCell.scala:560)
... 58 more
Caused by: java.lang.NullPointerException
at akka.actor.UnrestrictedStash$class.$init$(Stash.scala:82)
at stashActorTest.StashTestActor.<init>(StashTestActor.scala:9)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$2.apply(DynamicAccess.scala:78)
at scala.util.Try$.apply(Try.scala:161)
at
akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:73)
... 64 more
I don't have any problems with using TestActorRefs with actors that don't
extend Stash. So I don't know if it is a configuration error or something
else I'm missing.
Stop downloading after receiving particular amount of bytes?
Stop downloading after receiving particular amount of bytes?
Is there a way to stop downloading from a URL after a certain of bytes
have been received?
In PHP there is:
$contents = @file_get_contents($page, FALSE, NULL, 0, 40000);
The fifth argument tells file_get_contents to stop downloading after 40000
bytes. I'm basically looking for something similar in Python. A search on
Google and reading docs didn't yield anything. Help would be great, I'm
new to Python.
Thanks.
Is there a way to stop downloading from a URL after a certain of bytes
have been received?
In PHP there is:
$contents = @file_get_contents($page, FALSE, NULL, 0, 40000);
The fifth argument tells file_get_contents to stop downloading after 40000
bytes. I'm basically looking for something similar in Python. A search on
Google and reading docs didn't yield anything. Help would be great, I'm
new to Python.
Thanks.
Monday, 19 August 2013
How to use bootstrap-theme.css with bootstrap 3?
How to use bootstrap-theme.css with bootstrap 3?
After downloading a complete pack of bootscrap 3 from
http://getbootstrap.com, i noticed that there is a separate css file for
theme. How to make use of it? Please explain?
After downloading a complete pack of bootscrap 3 from
http://getbootstrap.com, i noticed that there is a separate css file for
theme. How to make use of it? Please explain?
Show div on li hover jquery html
Show div on li hover jquery html
So it's all together possible that I've just been looking at this for too
long but I've debugged all my code and searched everywhere I know for an
answer.
Maybe this isn't possible, I'm not sure but here's what I'm trying to do.
I have unordered list displayed horizontally acting as my top level
navigation. when I hover over one of the items I want to show a div that
is the full width of the unordered list above it. here's my caveat: I'm
using wordpresss custom post type to do this. the unordered list is the
title of the post and I want to show the content in the div that is
revealed on hover. I have this working the content loading that's not the
issue, i can't seem to find the right jquery / css combination to make the
div that reveals match the width of the whole list. I might have to use
ajax? Not sure, I'm very unfamiliar with it.
Here's my code:
HTML
<div class="menu-header-container">
<ul>
<?php
$args = array(
'post_type' => 'menu',
'post_status' => 'publish',
'posts_per_page' => 10,
'offset' => 0,
'order' => 'ASC'
);
$the_query = new WP_Query( $args ); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<li>
<a href="#"><?php the_title(); ?></a>
<div class="overlay">
<ul>
<li><?php the_field('sub_menu_item_one'); ?></li>
<li><?php the_field('sub_menu_item_two'); ?></li>
<li><?php the_field('sub_menu_item_three'); ?></li>
<li><?php the_field('sub_menu_item_four'); ?></li>
<li><?php the_field('sub_menu_item_five'); ?></li>
<li><?php the_field('sub_menu_item_six'); ?></li>
</ul>
</div>
</li>
<?php endwhile;?>
</ul>
</div>
CSS
.menu-header-container{
overflow: visible;
float: right;
margin-top: 4%;
}
.menu-header-container > ul > li{
margin-left: 20px;
display:inline-block;
float: right;
}
.overlay{
display: none;
position: absolute;
background: aqua;
}
jquery
<script>
$(".menu-header-container li").hover(function(){
$(this).find(".overlay").stop().fadeIn();
},function(){
$(this).find(".overlay").stop().fadeOut();
});
</script>
output
<div class="menu-header-container">
<ul>
<li>
<a href="#">Top Level one</a>
<div class="overlay">
<ul>
<li>item in sub div</li>
<li>item in sub div</li>
<li>item in sub div</li>
</ul>
</div>
</li>
<li>
<a href="#">Top Level two</a>
<div class="overlay">
<ul>
<li>item in sub div</li>
<li>item in sub div</li>
<li>item in sub div</li>
</ul>
</div>
</li>
</ul>
</div>
Here's a fiddle with my output as the html, so i want those top level
items on the same line and I want the revealing div to span the whole
width of the top level ul and my brain is fried.
jsfiddle
So it's all together possible that I've just been looking at this for too
long but I've debugged all my code and searched everywhere I know for an
answer.
Maybe this isn't possible, I'm not sure but here's what I'm trying to do.
I have unordered list displayed horizontally acting as my top level
navigation. when I hover over one of the items I want to show a div that
is the full width of the unordered list above it. here's my caveat: I'm
using wordpresss custom post type to do this. the unordered list is the
title of the post and I want to show the content in the div that is
revealed on hover. I have this working the content loading that's not the
issue, i can't seem to find the right jquery / css combination to make the
div that reveals match the width of the whole list. I might have to use
ajax? Not sure, I'm very unfamiliar with it.
Here's my code:
HTML
<div class="menu-header-container">
<ul>
<?php
$args = array(
'post_type' => 'menu',
'post_status' => 'publish',
'posts_per_page' => 10,
'offset' => 0,
'order' => 'ASC'
);
$the_query = new WP_Query( $args ); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<li>
<a href="#"><?php the_title(); ?></a>
<div class="overlay">
<ul>
<li><?php the_field('sub_menu_item_one'); ?></li>
<li><?php the_field('sub_menu_item_two'); ?></li>
<li><?php the_field('sub_menu_item_three'); ?></li>
<li><?php the_field('sub_menu_item_four'); ?></li>
<li><?php the_field('sub_menu_item_five'); ?></li>
<li><?php the_field('sub_menu_item_six'); ?></li>
</ul>
</div>
</li>
<?php endwhile;?>
</ul>
</div>
CSS
.menu-header-container{
overflow: visible;
float: right;
margin-top: 4%;
}
.menu-header-container > ul > li{
margin-left: 20px;
display:inline-block;
float: right;
}
.overlay{
display: none;
position: absolute;
background: aqua;
}
jquery
<script>
$(".menu-header-container li").hover(function(){
$(this).find(".overlay").stop().fadeIn();
},function(){
$(this).find(".overlay").stop().fadeOut();
});
</script>
output
<div class="menu-header-container">
<ul>
<li>
<a href="#">Top Level one</a>
<div class="overlay">
<ul>
<li>item in sub div</li>
<li>item in sub div</li>
<li>item in sub div</li>
</ul>
</div>
</li>
<li>
<a href="#">Top Level two</a>
<div class="overlay">
<ul>
<li>item in sub div</li>
<li>item in sub div</li>
<li>item in sub div</li>
</ul>
</div>
</li>
</ul>
</div>
Here's a fiddle with my output as the html, so i want those top level
items on the same line and I want the revealing div to span the whole
width of the top level ul and my brain is fried.
jsfiddle
Chrome dev channel features list
Chrome dev channel features list
where can I find list of features either completed or in development in
Chrome developer channel?
I'am pretty sure, that I've come across such a list before and can't find
it again after spending an hour searching.
I've looked at http://www.chromium.org/getting-involved/dev-channel but
could not find a related link.
where can I find list of features either completed or in development in
Chrome developer channel?
I'am pretty sure, that I've come across such a list before and can't find
it again after spending an hour searching.
I've looked at http://www.chromium.org/getting-involved/dev-channel but
could not find a related link.
Convert PHP echoed date to client local time
Convert PHP echoed date to client local time
This is my first post. I have a problem that i can't seem to resolve. Here
it goes:
I have a PHP script that prints the date of an event to the page:
$event_datetime = date("g:i A (m/d/y)", strtotime($row['event_time']));
echo $event_datetime
I want to use Javascript to convert that $event_datetime into client local
timezone preferably or local client computer time.
Any ideas ?
Thanks in advance !
This is my first post. I have a problem that i can't seem to resolve. Here
it goes:
I have a PHP script that prints the date of an event to the page:
$event_datetime = date("g:i A (m/d/y)", strtotime($row['event_time']));
echo $event_datetime
I want to use Javascript to convert that $event_datetime into client local
timezone preferably or local client computer time.
Any ideas ?
Thanks in advance !
i can't like other people's page! why?
i can't like other people's page! why?
i can't like other people's page! why? error msg : Add Fan Status Failed:
Your attempt to become a fan was not successful. Please try again. please
help me to solve this
i can't like other people's page! why? error msg : Add Fan Status Failed:
Your attempt to become a fan was not successful. Please try again. please
help me to solve this
Sunday, 18 August 2013
How to get path chooser dialog box to save file using GWT
How to get path chooser dialog box to save file using GWT
I'm developing an application in which I want to create an 'MS-EXCEL' file
and for that I want the name for the file to be given by user and later on
I want to provide an option to the user to save at the path where he
wants.
Currently I am hard coding the path in program. I can't use swing I want
to implement this in GWT.
I'm developing an application in which I want to create an 'MS-EXCEL' file
and for that I want the name for the file to be given by user and later on
I want to provide an option to the user to save at the path where he
wants.
Currently I am hard coding the path in program. I can't use swing I want
to implement this in GWT.
Is there a quick way to make a large amount of direct download links to a certain files? [on hold]
Is there a quick way to make a large amount of direct download links to a
certain files? [on hold]
Is there a quick way make a lot of direct download links in html? I have a
lot of files that I would like to have direct downloads and I didn't want
to go through one by one and type it all out. I was wondering if there was
a software that would let me select a lot of files and it would make
download links out of them.
certain files? [on hold]
Is there a quick way make a lot of direct download links in html? I have a
lot of files that I would like to have direct downloads and I didn't want
to go through one by one and type it all out. I was wondering if there was
a software that would let me select a lot of files and it would make
download links out of them.
Beta Testing Android Play Store
Beta Testing Android Play Store
Apparently, by mistake published me app on the play store before putting
out a beta. I created a google group, and invited all my testers. However,
they still see version 1.0 on the play store and not version 1.1?
Is there a problem? or does it take longer to show up? and how will the
user know it is the beta app other than the version number?
Apparently, by mistake published me app on the play store before putting
out a beta. I created a google group, and invited all my testers. However,
they still see version 1.0 on the play store and not version 1.1?
Is there a problem? or does it take longer to show up? and how will the
user know it is the beta app other than the version number?
Prblem with scroll view in android
Prblem with scroll view in android
I tried to show lots of items in a page in my android application I used
ScrollView but the problem is layout limited and just some item can be
placed not a lot, here is my code:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/page_bg_center">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Hello"
android:textAppearance="?android:attr/textAppearanceSmall"/>
.
.
.
</RelativeLayout>
</ScrollView>
I tried to show lots of items in a page in my android application I used
ScrollView but the problem is layout limited and just some item can be
placed not a lot, here is my code:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/page_bg_center">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Hello"
android:textAppearance="?android:attr/textAppearanceSmall"/>
.
.
.
</RelativeLayout>
</ScrollView>
Subscribe to:
Comments (Atom)