How do I delay a PHP script that writes to a text file and then reads from the same file long enough to make sure changes have been written before I attempt the read?
I'm using Handlebar's {{#each}} to render out my collection to the DOM. After each item is rendered, I want to run a script on these elements. I'm trying to find a callabck function wich fires only once, when the whole render is completed. Meteor's Template.rendered() run's each time a new item is inserted, so it runs as many times as much item I have in my collection. Is there any solution for this?
Thanks a lot!
Hi,
I'm using latest version of Xampp on 64bit Win7.
The problem is that, when I use mysql_connect with "bool $new_link" set to true like so:
mysql_connect('localhost', 'root', 'my_password', TRUE);
script execution time increases dramatically (about 0,5 seconds per connection, and when I have 4 diffirent objects using different connections, it takes ~2 seconds).
Is setting "bool $new_link" to true, generally a bad idea or could it just be some problem with my software configuration.
Thank you.
This is my Unit Test class
<?
require_once '../simpletest/unit_tester.php';
require_once '../simpletest/reporter.php';
class Academic extends UnitTestCase
{
function setUp()
{
}
function tearDown()
{
}
function testAc1()
{
}
function testAc4()
{
}
function testAc7()
{
}
}
$test = new Academic();
$test->run(new HtmlReporter());
?>
When I run this script all methods viz., testAc1, testAc4, testAc7 etc are run.
Is there a way to execute just a single method ?
Thanks,
Shikhar
I have a searchbox with auto-suggest that pops a div up underneath it with multiple search string suggestions (like google). Is it possible to have drop shadow on the auto-suggest box with CSS or will I need a script of some sort? I tried a background image but the number of suggests can vary from 1 to 10 or 15.
I'd prefer something that works in IE6+ and FF2+ if possible. Thanks!
I am preparing a script. I am using AJAX(load()) with jQuery.
I am getting a page which includes textarea with ckeditor by load() jQuery AJAX function.
Although I include ckeditor's.js file, loaded page doesn't includes javascript file and shows a normal textarea without ckeditor.
How can I load file which includes textarea with ckeditor?
I used the Redgate packager (ran MSI) to reset all the data in my database (i.e. I deleted everything, and let it build the new database). Unfortunately, I discovered that it didn't retain my diagrams, which has a nice arrangement and several annotations.
Is there any way to copy/migrate/script the diagram from one database to another (the databases have identical structures).
Thanks,
Neal Walters
I am using Tomcat 6. I am running a php script using the JavaBridge. I get the following error when I run my code.
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\xxxx\xxxxx.php on line 534
Please help.
There is a simple way with php, a simple script or URL manipulation to build a URL for the gravatar image corresponding to an email?
Ex. http://gravatar.com/avatars/[email protected] and this return a jpeg or png image.
If there is no simple way like the example, what is the easiest way you know to resolve a url of the gravatar corresponding to an email?. Thanks
The question is to know if there is a way to build an HTML email with inline style (no CSS file, nor tags) with the href links that react with the mouse passing over them : just to be able to change the color font.
So, no JS, no script, no , just link
I'm using Intercom rails in my application and I would like to not include intercom script in a certain situation. So, I would like to skip the intercom after_filter when a value is set in the user session.
I tried that, but it didn't worked:
class ApplicationController < ActionController::Base
before_filter :verify_session
def verify_session
if skip_intercom?
self.class.skip_after_filter :intercom_rails_auto_include
end
end
end
Any idea if it's possible?
I am writing a script to run under the korn shell on AIX. I'd like to use the mkdir command to create a directory. But the directory may already exist, in which case I don't want to do anything. So I want to either test to see that the directory doesn't exist, or suppress the "File exists" error that mkdir throws when it tries to create an existing directory.
Any thoughts on how best to do this?
I was told I can add the -XX:+HeapDumpOnOutOfMemoryError parameter to my JVM start up options to my JBoss start up script to get a heap dump when we get an out of memory error in our application. I was wondering where this data gets dumped? Is it just to the console, or to some log file? If it's just to the console, what if I'm not logged into the unix server through the console?
Thanks
Hi, Disqus automatically places defined captions upon request. For example: Add new Comment
I've tried to change its value with jquery on ready():
$('#dsq-new-post h3').text('Paticipa con tu cuenta favorita');
No success :( ... how can i know when disqus script is finished parsing the data so i can change the caption value of h3?
I am using wget to mirror website using this code
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
The next time I run it it starts downloading the same files again, however I want only the changed files to be downloaded next time. I am open to use any other tool or script(preferably PHP,Curl) apart from using wget.
I've inherited a bunch of code that has server script inside of .htm files.
On IIS, a handler mapping pumps.Htm pages though the asp.net engine.
Unfortunately, visual studio doesn't notice that they should be treated as code.
Is there any way to make VS treat .Htm files as code/aspx files?
I would like to create a python script, which will:
Create a django project in the current directory. Fix settings.py, urls.py.
Do syncdb
Install new apache instance listening on specific port (command line argument), with WSGI configured to serve my project.
I can't figure out how to do point 3.
EDIT:
Peter Rowell:
I need the solution for both Linux and Windows
I have root access
This is a dedicated host
Apache only
I got a Silverlight App with-in a Web Project
Web
Silverlight
The web contains a service:
[WebService(Namespace = "svChat")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
//[System.Web.Script.Services.ScriptService]
public class GetIPService : System.Web.Services.WebService
{
public GetIPService ()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string GetIp()
{
return HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
}
}
And I got a class in my Silverlight App using the Service:
public class Client
{
private string ip;
private string created;
#region Properties
public string Ip
{
get { return ip; }
set { ip = value; }
}
public string Created
{
get { return created; }
set { created = value; }
}
#endregion
public Client()
{
}
public void SetIp()
{
ServiceReference1.GetIPServiceSoapClient scIpClient = new svChat.ServiceReference1.GetIPServiceSoapClient();
scIpClient.GetIpCompleted += new EventHandler<svChat.ServiceReference1.GetIpCompletedEventArgs>(IpService_Completed);
scIpClient.GetIpAsync();
}
private void IpService_Completed(object sender, ServiceReference1.GetIpCompletedEventArgs e)
{
this.ip = e.Result;
}
}
After Client is created, SetIp() is called, and Client.Ip is added to a text box.
Nothing happens.
Ip = null.
Service itselfs works, tested it.
Getting Ip by the above code works.
Gettings Ip via service through Silverlight App does not work.
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="GetIPServiceSoap" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:2090/svChat.Web/GetIPService.asmx"
binding="basicHttpBinding" bindingConfiguration="GetIPServiceSoap"
contract="ServiceReference1.GetIPServiceSoap" name="GetIPServiceSoap" />
</client>
</system.serviceModel>
</configuration>
Any ideas?
regards,
Hi all
I'm attempting to write a PowerShell script that, among other things, runs two external programs, harvesting the output of one and providing it to the other.
The problem is that the second program is interactive and asks for:
- a password
- an option (1, 2, or 3)
- an option (Y or N)
- output of external program 1
Note also that this is on XP with PowerShell v1 and .net v2.0 (no I can't upgrade)
Any ideas how I would do this?
CC
I need to install a plugin like this:
script/plugin install git://github.com/apotonick/cells.git
and it just creates a new empty folder in the plugins dir, "cells"
(i use eclipse and rails)
Is that a bad question, i dont get it?(-6 votes)
I know i already asked simillar question, but now when I work with jQuery Mobile I can't figure it out. So I have this form:
<div data-role="page" data-theme="a" id="login_page">
<div data-role="header" data-position="fixed">
<h1>****</h1>
</div>
<div data-role="content">
<form id="login_form" method="POST" data-ajax="false">
<label for="basic">Username:</label>
<input type="text" name="name" id="username" value=""/>
<label for="basic">Password:</label>
<input type="password" name="password" id="password" value=""/>
<input type="submit" value="Login" id="login" name="login"/>
</form>
</div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar"></div>
</div>
</div>
And I need to submit Username and Password to php script, where php replies and send "success" or "failed". Here is php:
<?php
session_start();
$username = $_POST["name"];
$password = $_POST["password"];
include('mysql_connection.php');
mysql_select_db("jzperson_imesUsers", $con);
$res1 = mysql_query("SELECT * FROM temp_login WHERE username='$username' AND password='$password'");
$count=mysql_num_rows($res1);
if($count==1){
echo "success";
}else{
echo "failed";
}
?>
And to do all this I want to use this script:
$(document).ready(function() {
$("form").submit(function(){
$.mobile.showPageLoadingMsg();
$.ajax({
url: "http://imes.jzpersonal.com/login_control.php",
type: "POST",
dataType: "jsonp",
jsonp: "jsoncallback",
data: $("form#login_form").serialize(),
success: function( response ){
$.mobile.changePage( "http://imes.jzpersonal.com/user_panel.html");
}
});
return false;
});
});
But I can't make it work, I know I must have mistakes in there, I just can't find them, or better way to do it. Thank you in advance for any help.
What does the following code mean -
<a href="javacsript:;" onClick="addItem(160)">some link</a>
My basic doubt is which script is run when we click on the link
I'm trying to get a color picker javascript widget working in a page with a bunch of "stuff" in it that I can't change. Some of the "stuff" is causing the color picker to appear well below the link when clicked. I've reduced it to a simple example below.
<html>
<head>
<script type="text/javascript">
function setPos(aname,dname) {
var o=document.getElementById(aname);
var ol=o.offsetLeft;
while ((o=o.offsetParent) != null) {
ol += o.offsetLeft;
}
o=document.getElementById(aname);
var ot=o.offsetTop + 25;
while((o=o.offsetParent) != null) {
ot += o.offsetTop;
}
document.getElementById(dname).style.left = ol + "px";
document.getElementById(dname).style.top = ot + "px";
}
</script>
<style>
h1 {height: 50px;}
#divMain {position: relative;}
</style>
</head>
<body>
<h1></h1>
<div id="divMain">
<a href="#" onClick="setPos('link1','div1');return false;" name="link1" id="link1">link 1</a>
<div id="div1" style="position:absolute;border-style:solid;left:200px;top:200px;">div 1</div>
</div>
</body>
</html>
What's supposed to happen is when you click "link 1", "div1" should move directly below "link 1". What actually happens is that "div 1" appears well below "link 1". If you remove position: relative; from the CSS definition for divMain, "div 1" is positioned correctly.
How can I position "div 1" directly beneath "link 1" without removing position: relative;?
My eventinfo.php is giving the following output:
<br />
<b>Notice</b>: Undefined index: club in <b>/homepages/19/d361310357/htdocs/guestvibe/wp-content/themes/yasmin/guestvibe/eventinfo.php</b> on line <b>11</b><br />
[]
HTML (index.php):
<select name="club" class="dropdown" id="club">
<?php getClubs(); ?>
</select>
jQuery (index.php):
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: "POST",
url: "http://www.guestvibe.com/wp-content/themes/yasmin/guestvibe/eventinfo.php",
data: $('#club').serialize(),
success: function(data) {
$('#rightbox_inside').html('<h2>' + $('#club').val() + '<span style="font-size: 14px"> (' + data[0].day + ')</h2><hr><p><b>Entry:</b> ' + data[0].entry + '</p><p><b>Queue jump:</b> ' + data[0].queuejump + '</p><br><p><i>Guestlist closes at ' + data[0].closing + '</i></p>');
},
dataType: "json"
});
});
$('#club').change(function(event) {
$.ajax({
type: "POST",
url: "http://www.guestvibe.com/wp-content/themes/yasmin/guestvibe/eventinfo.php",
data: $(this).serialize(),
success: function(data) {
$('#rightbox_inside').hide().html('<h2>' + $('#club').val() + '<span style="font-size: 14px"> (' + data[0].day + ')</h2><hr><p><b>Entry:</b> ' + data[0].entry + '</p><p><b>Queue jump:</b> ' + data[0].queuejump + '</p><br><p><i>Guestlist closes at ' + data[0].closing + '</i></p>').fadeIn('500');
},
dataType: "json"
});
});
</script>
I can run alerts from the jQuery, so it is active.
I've copied this as is from an old version of the website, but I've changed the file structure (through to move to WordPress) so I suspect the variables might not even be reaching eventinfo.php in the first place...
index.php is in wp-content/themes/cambridge and eventinfo.php is in wp-content/themes/yasmin/guestvibe but I've tried to avoid structuring issues by referencing the URL in full.
Any ideas?
We have multiple maven projects depending on on our own common libraries.
When we upgrade a library it would be useful to quickly find out which projects have a dependency on the library (and might need to use the new version)
Obviously I can manually look in all the pom files or write a script to do it but this is less than ideal.
Are there any tools that provide this functionality. e.g. a hudson plugin, Nexus, artifactory etc?