It seems they canceled in Python 3.0 all the easy way to quickly load a script file - both execfile() and reload().
Is there an obvious alternative I'm missing?
I have a simple perl script that via ftp uploads files to the server hosting our website. After I do that I have to login as a Wordpress admin and use the GUI to edit a page so that it reflects the new file I just uploaded. I want to programmatically edit that file to save a few steps, but I can't find the file. Are any Wordpress files sitting on the server? The file in question is basically a subpage of the main site.
In the beginning of a file on my server (linux), which is located in the /etc/init.d/ folder I have this line:
!/bin/sh -e
What does it mean, because every time I execute the rest of the script it works fine except for an error which shows:
!/bin/sh not found
Any ideas?
PHP has the function memory_get_usage to report the amount of memory a PHP script has. How can you do the same thing in .NET (ASP.NET C#)?
Also, can you report on how much memory an object is taking (e.g. SiteMap or DataTable)?
In SQL Server, you can declare a table variable (DECLARE @table TABLE), which is produced while the script is run and then removed from memory.
Does Oracle have a similar function? Or am I stuck with CREATE/DROPs that segment my hard drive?
I'm using twitter bootstrap in my application. i gave e.preventDefault for link button in $(document).reday(), but it is not working.
Here is my code:
Master page:
<a id="lnkLogout" href="javascript:void(0);" onclick="PageLogout();"><i class="icon-off">
</i>Logout</a>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$('#lnkLogout').click(function (e) { e.preventDefault(); });
});
function PageLogout() {
//Code for logout from the application....
}
</script>
SampleDefaultPage.aspx :
<div class="row-fluid">
<div class="form-horizontal">
<h4 class="header blue bolder smaller">
Contact</h4>
<div class="control-group">
<label for="form-field-email" class="control-label">
Email</label>
<div class="controls">
<input type="text" style="width:200px;" data-val="true" data-val-required="Mobile Number is required." id="txtEmail">
<div class="space-3">
</div>
<span data-valmsg-replace="true" data-valmsg-for="txtEmail" class="field-validation-valid text-warning red"></span>
</div>
</div>
<div class="control-group">
<label for="form-field-website" class="control-label">
Phone Number</label>
<div class="controls">
<input type="text" style="width:200px;" id="txtPhno">
</div>
</div>
</div>
I have given txtEmail as mandatory field. if i left that field blank and click on Logout button in Master page, it says txtEmail is required. i dint do any validation in Logout onclick event. I have given preventDefault for Logout link. But still facing an issue. I should be able to logout even though txtEmail is left blank.
Thank you all in advance for your response.
I have JQuery working to show a particular div when a certain link is clicked.
I have managed to apply the effect I'm after with the main navigation bar through id'ing the body tag and using css to style when the id is found.
However, i'd like to apply the same effect to the sub navigation when a certain div is present.
How the main navigation is styled:
HTML:
<nav>
<ul>
<li id="nav-home"><a href="index.html">Home</a></li>
<li id="nav-showreel"><a href="showreel.html">Showreel</a></li>
<li id="nav-portfolio"><a href="portfolio.html">Portfolio</a></li>
<li>Contact</li>
</ul>
</nav>
CSS:
body#home li#nav-home,
body#portfolio li#nav-portfolio
{
background: url("Images/Nav_Underline.png") no-repeat;
background-position: center bottom;
color: white;
}
(Other links havent been added to styling as those pages are still in development)
How the sub navigation is structured:
<nav id="portfolioNav">
<ul>
<li id="portfolio-compositing"><a id="compositingWork" href="#">Compositing</a></li>
<li id="portfolio-animation"><a id="animationWork" href="#">Animation</a></li>
<li id="portfolio-motionGfx"><a id="GFXWork" href="#">Motion Graphics</a></li>
<li id="portfolio-3D"><a id="3DWork" href="#">3D</a></li>
</ul>
</nav>
As you can see, its similar format to the main navigation, however i've tried the same approach and it doesn't work :(
The Javascript that switches the divs on the navigation click:
<script type="text/javascript">
$(document).ready(function() {
$('#3DWork').click(function(){
$('#portfolioWork').load('portfolioContent.html #Portfolio3D');
});
$('#GFXWork').click(function(){
$('#portfolioWork').load('portfolioContent.html #motionGraphics');
});
$('#compositingWork').click(function(){
$('#portfolioWork').load('portfolioContent.html #PortfolioCompositing');
});
$('#animationWork').click(function(){
$('#portfolioWork').load('portfolioContent.html #PortfolioAnimation');
});
});
</script>
JSFiddle for full HTML & CSS : JSFiddle File
The effect I'm After:
I have a .h when I map all the image files names and xib names with #defines. For example, if I have an image called "buttonBackground.png" I map it in my .h as
#define BUTTON_BACKGROUND_PNG_FILE @"buttonBackground.png"
It's possible to detect when a resource is added to the bundle and create the correspond define with a script?
I have a fairly large SQL Server database; I'd like to pull 4 tables out and dump them directly into an sqlite.db for remote querying (via nightly batch).
I was about to write a script to step through(most likely on a unix host kicked off via cron); but there should be a simpler method to export the tables directly (SQLite not an option in the included DTS Import/Export wizard)
What would the most efficient method of dumping the SQL Server tables to SQLite via batch be?
"8,5,,1,4,7,,,,7,,1,9,3,6,,,8,6,3,9,,2,5,4,,,,,3,2,,,7,4,1,1,,4,,6,9,,5,,,,5,,,1,,6,3,,,6,5,,,,7,4,,1,7,6,,,,8,,5,,,7,1,,3,9,"
I'm doing a programming challenge where i need to parse this sequence into my sudoku script.
Need to get the above sequence into 8,5,0,1,4,7,0,0,0,7,0,1,9,3,6,0,0,8.........
I tried re but without success, help is appreciated, thanks.
This is my question and apparently this is the answer. I found you can stdout to null by writing NUL in command prompt so i tried writing < NUL at the end of my argument. No luck.
How do i pass in null or do something with the IO locks like that perl code does so i can get my ffmpeg script not locking up after 15 or so seconds?
One of my utility jar files is used by different nix scripts, located in different categories. Problem: unable to initialize log4j framework (unable to find log4j.xml). Solution, that allows to configure logger correctly while launching jar classes by different scripts - usage of env vars and force configuring using DOMConfigurtor.configure(pathToConfXml) method. is it possible to avoid path hardcoding and configure logger inside of a script?
Appreciate all your help.
Thanks.
I have a script that animates an element as follows:
var item_height = $('#item').height();
$('#item').height(0);
$('#item').animate({ height: item_height });
Now suppose the animation needs to be stopped before it is complete:
$('#item').stop();
How can I get the end value of the animation? (The total height of the element when the animation would have been complete)
i have a textbox in asp.net form.... if i entered numbers not like 7 or 8 or 9, then script function should be araised with alert message.... how to achieve this.... that 7 or 8 or 9 are first digits in my texbox...
Hi,
I am trying to make a script that updates the captcha image, that is loaded through live() function... It works, but it only updates the image 1 time on firefox, 2 times on safari... How can I make this to work multiple times?
jquery 1.4.2
relevant part of code:
/* captcha image change */
var rand = Math.random();
$('a.captcha_refresh').live('click', function() {
$('img.captcha').attr("src", 'captchashow.php?sid=' + rand);
});
thanks,
brm
I've set a rule in Apple Mail to run a "Download & Open link" applescript. I would like this script to download the url in the mail message and after downloading it should open the file.
No idea how to start on this...
I have a directory of functions and aliases I'd like to include for both bash and zsh terminal invocations (So I don't need to put every function and alias into every separate script and to facilitate organization/tidying of .rc files)
What I've tried so far hasn't worked. Just setting this out for further suggestions.
I am currently facing a situation where i have a table with almost 80 millions data and i have to take a dump of that table and store it into a csv file. Currently i am using a not so professional approach( with a perl script+DBI interface , printing the values to stdout and redirecting to a csv file). Now i am planning to use java threading approach. Can you suggest a way forward. Thanks in advance
I've come across the following code in a Python script
from pprint import pprint
why not simply import pprint?
Unless the module pprint contains a function called pprint which is being aliased as pprint (surely, this must be the definition of madness?)
In my bash script I have two variables 'CONFIG_OPTION' and 'CONFIG_VALUE' which contain string VENDOR_NAME and Default_Vendor respectively.
I need to create a variable with name '$CONFIG_OPTION' ie VENDOR_NAME and assign the value in CONFIG_VALUE to newly created variable.
How I can do this?
I tried
$CONFIG_OPTION=$CONFIG_VALUE
But I am getting an error on this line as
'./Build.bash: line 137: VENDOR_NAME="Default_Vendor": command not found'
Thanks.
I need to put copyright message one every file. It will be done only for files going to client. Is there some unix script that will slap copyright message at the very top of every file.
The title pretty much sums up my question, I would like to find all commits I have ever done to the subversion repository. Not just commits in current snapshot. More importantly, I would like to organize the file lists by the SVN comment used while committing.
Thank you
Edit: I am thinking maybe a python or shell script that would parse the output of
svn log | grep username
to extract revisions and then pipes the output to
svn log -r [revision numbers go here]
Maybe some scripting gurus can help me out..
Hello, i have a AS2 script who get information from a MySQL database. This information is a text from 0 to 300 chars. I want to display that text in this layout:
I want to resize the black box you see on the picture in function of the amount of text imported. Any idea of how to do that on AS2?
The instance name of the box is: cargador.fondo (only want to resize height)
The instance name of the text is: cargador.texto
Thanks.