I need to add the URL 'user/7/orders' to a particular menu. As this requires PHP for the UID (7), how do I write a script to add an item to a particular menu?
Hey I got the following ps for retrieving the site template from SharePoint,but I do not quite undersantd what does
the second half of the script( | ? {$_.IsHidden -eq $false }) does? Can someone explain this to me please as I am fairly new to PS.
Get-SPWebTemplate | ? {$_.IsHidden -eq $false }
Hi All,
I have tried for "unload" and "beforeunload" binding in following code, but none of the browser is sending a request:
$(window).bind('unload', function(){
$.ajax({cache: false,
dataType: "script",
url: "test.php"
});
});
Any suggestion?
Thank you.
I want to use sqlite memory database for all my testing and Postgresql for my development/production server.
But the SQL syntax is not same in both dbs. for ex: SQLite has autoincrement, and Postgresql has serial
Is it easy to port the SQL script from sqlite to postgresql... what are your solutions?
If you want me to use standard SQL, how should I go about generating primary key in both the databases?
The user should input two strings and the script will performe a text search:
$sql = "SELECT * FROM table_one WHERE name='%$str1%' AND MATCH (street, city, pin) AGAINST ('$hrtg'IN BOOLEAN MODE)";
somehow the % does not work, but it alwas did actually. please help?
This is my code:
<html>
<head>
<title>scoreboard</title>
<script>
function calculate() {
var sum=0; var total=0;
for (var i=0; i < document.questions.group1.length; i++){
if (document.questions.group1[i].checked){
sum = parseInt(document.questions.group1[i].value)
total = parseInt(total + sum);}}
for (var i=0; i < document.questions.group2.length; i++){
if (document.questions.group2[i].checked){
sum = parseInt(document.questions.group2[i].value)
total = parseInt(total + sum);}}
for (var i=0; i < document.questions.group3.length; i++){
if (document.questions.group3[i].checked){
sum = parseInt(document.questions.group3[i].value)
total = parseInt(total + sum);}}
alert(total)
}
</script>
</head>
<body>
<form name="questions">
A:<br>
answer a1: <input type="radio" name="group1" value="0">
answer a2: <input type="radio" name="group1" value="1">
answer a3: <input type="radio" name="group1" value="2">
answer a4: <input type="radio" name="group1" value="3"><br>
B:<br>
answer b1: <input type="radio" name="group2" value="0">
answer b2: <input type="radio" name="group2" value="1">
answer b3: <input type="radio" name="group2" value="2">
answer b4: <input type="radio" name="group2" value="3"><br>
C:<br>
answer c1: <input type="radio" name="group3" value="0">
answer c2: <input type="radio" name="group3" value="1">
answer c3: <input type="radio" name="group3" value="2">
answer c4: <input type="radio" name="group3" value="3"><br><br>
<input type="button" value="total" onclick="calculate()">
</form>
</body>
</html>
How can I replace 'group[x]' in my code by a variable, so the three for-loops are replaced by one (because in reality there are a lot more questions and answers) ?
I tried on Flex 3, facing issue with uploading JPG/PNG image, trace readUTFBytes would return correct bytes length but tmpFileContent is trucated, it would only appear to have upload just 3 characters of data to the server through PHP script which made image unusable. I have no issue for non-images format. What is wrong here?
var tmpFileContent:String = fileRef.data.readUTFBytes(fileRef.data.length);
Is String capable of handle bytes?
"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.
Simply, I'm just looking to get a list of connected remote disks.
I have a script right now that compares /Volumes/ to "diskutil -list" but that only gives me the name of the remote disks, not the actual address.
Anyone have ideas as to how I might go about doing this?
Thanks in advance.
There is a panel on my page with no default background-image css. On load it is set with jquery to an initial image, waits for 10 seconds then loads a random image out of some predetermined images. There are previous and next buttons which allow you to cycle through the images. In ie6 the initial image loads and then a random image also loads after 10 seconds, however pressing prev/next causes the background to become white and the images aren't loaded. With alerts I was able to find that it's still keeping track of the position and url of the image it's supposed to load, but just won't load it. Here is the code below.
<script type="text/javascript">
var facts = new Array();
var position;
$(document).ready(function() {
<xsl:for-each select="$currentPage/ancestor-or-self::node[@level=1]/../node[@nodeName='Fun Fact Folder']/node">
facts[<xsl:value-of select="position()" />] = '<xsl:value-of select="." />';
</xsl:for-each>
if(window.location.pathname == "/homepage.aspx" || window.location.pathname == "/") {
$(".fun_facts_bg").css("background-image", "url(images/fun_fact_homepage.JPG)");
setTimeout("randomFact()",10000);
} else {
randomFact();
}
});
function randomFact() {
$("a.previous_button").css("display", "block");
$("a.next_button").css("display", "block");
position = Math.ceil(Math.random() * (facts.length - 1));
changeFact(0);
}
function changeFact(increment) {
position = checkPosition(position, increment);
$(".fun_facts_bg").css("background-image", "url(" + facts[position] + ")");
}
<xsl:text disable-output-escaping="yes"><!--//--><![CDATA[//><!--
function checkPosition(currentPos, increment) {
currentPos = currentPos + increment;
if (currentPos > facts.length - 1) {
currentPos = 1;
} else if (currentPos < 1) {
currentPos = facts.length - 1;
}
return currentPos;
}
//--><!]]></xsl:text>
</script>
<a class="previous_button" href="javascript:void(0);" onclick="changeFact(-1);">
<a class="next_button" href="javascript:void(0);" onclick="changeFact(1);">
I'm using rails 2.3.2 and when I run script/server -d, the only output I get is
= Booting Mongrel
= Rails 2.3.2 application starting on http://0.0.0.0:3000
which is fine. But when I check for anything running on port 3000, i get nothing. Any ideas?
Is it possible to have a global event handler for ajax requests that automatically gets called when any ajax request returns ?
I'm interested in this because I'm making a greasemonkey script for an ajax site. In previous scripts I either ran the main function every few seconds or overwrote parts of the site's javascript, both things that are messy.
Hi.
Look on my code that i created in a partial View:
<% foreach (Customer customerInfo in Model.DataRows) {%>
<tr>
<td>
<%=Html.ActionLink(
customerInfo.FullName
, ((string)ViewData["ActionNameForSelectedCustomer"])
, JoinParameters(customerInfo.id, (RouteValueDictionary) ViewData["AdditionalSelectionParameters"])
, null)%>
</td>
<td>
<%=customerInfo.LegalGuardianName %>
</td>
<td>
<%=customerInfo.HomePhone %>
</td>
<td>
<%=customerInfo.CellPhone %>
</td>
</tr>
<%}%>
Here I'm building simple table that showing customer's details.
As you may see, in each row, I'm trying to build a link that will redirect to another action.
That action requires customerId and some additional parameters.
Additional parameters are different for each page where this partial View is using.
So, i decided to make Action methods to pass that additional parameters in the ViewData as RouteValueDictionary instance.
Now, on the view i have a problem, i need to pass customerId and that RouteValueDictionary together into Html.ActionLink method.
That makes me to figure out some way of how to combine all that params into one object (either object or new RouteValueDictionary instance)
Because of the way the MVC does, i can't create create a method in the codebehind class (there is no codebihind in MVC) that will join that parameters.
So, i used ugly way - inserted inline code:
...script runat="server"...
private RouteValueDictionary JoinParameters(int customerId, RouteValueDictionary defaultValues)
{
RouteValueDictionary routeValueDictionary = new RouteValueDictionary(defaultValues);
routeValueDictionary.Add("customerId", customerId);
return routeValueDictionary;
}
...script...
This way is very ugly for me, because i hate to use inline code in the View part.
My question is - is there any better way of how i can mix parameters passed from the action (in ViewData, TempData, other...) and the parameter from the view when building action links.
May be i can build this link in other way ?
Thanks!
Hello
I'm creating a bookmarklet and of course I'd like to use jQuery. But, if I include jQuery (append a script-tag to head) on a site, will the site itself work anymore, if it has some other js on?
Martti Laine
hi, I'm using jquery-plugin columnizer
http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=columnizer
for this website: http://donatellabernardi.ch/drupal
It is sometimes very slow to create the columns (you can try changing the browser window size, or selecting a filter.
Sometimes Firefox gives the error message: "Unresponsive Javascript script" and I have to press on continue to continue the navigation.
thanks
Im writing a bash-script to perform an offsite backup, using rsync over SSH. I'm able to send STDOUT to logger, for logs via
rsync --del -az -e 'ssh -i mycrt.crt' /home/gnutt/backup/ me@offisite:backup | logger -i
But I want to send STDERR instead, so if there is a problem, such as that offsite is unavailable, that output should be sent to logger and logged.
Is there a script i can use to copy some particular sectors of my Harddisk?
I actually have two partitions say A and B, on my Harddisk. Both are of same sizes. What i want is to run a program which starts copying data from the starting sector of A to the starting sector of B until the end sector of A is copied to the end sector of B.
Looking for possible solutions...
Thanks a lot
Is it possible to get the full path of the file on the user's computer being uploaded to my site?
Using os.path.abspath(fileitem.filename) simply gets me the address of where my script is executing from on my shared hosting server.
FYI: fileitem = form['file'] and form = cgi.FieldStorage()
Hi,
I get in a bash script, in the follwoing line
echo $AAAA" "$DDDD" "$MOL_TAG >> ${OUPUT_RESULTS}
the error:
line 46: ${OUPUT_RESULTS}: ambiguous redirect
Why?
Thanks
Hi guys,
I am trying to create a shell script/command that find error_log files created by PHP, check their file sizes and remove them if over a certain size.
I have only gotten as far as printing the files and file sizes with the code below
for i in `locate -r 'error_log$'`;do echo "$i|" `stat -c %s $i`;done
Can anyone help?
Thanks in advance!
Hi there,
i'm building a page that is dinamically loaded with ajax.
This is what the '$.get' jQuery function calls (this is located on an external HTML page):
<script type="text/javascript">
$(function()
{
$('button').sb_animateButton();
$('input').sb_animateInput();
$('#settings_security_error').hide();
});
function check_passwords(password, password_confirm)
{
$('#settings_security_error').show();
alert('I\'m in funcion!'); // This works...
if(password.length < 4) // ... this doesn't
{
$('#settings_security_error').innerHTML = 'Password too short';
}
else
{
password = hex_md5(password);
password_confirm = hex_md5(password_confirm);
$.get('/engine/ajax/check_password.php?password=' + password + '$password_confirm=' + password_confirm,
{language: "php", version: 5},
function(result)
{
$('#settings_security_error').innerHTML = result;
},
'html');
}
}
</script>
<div class="title">Security</div>
<table class="sub_container">
<tr>
<td><label>Old password</label></td>
<td class="td_input"><input type="password" name="old_password"/></td>
</tr>
<tr>
<td><label>New password</label></td>
<td class="td_input"><input type="password"
name="new_password"
id="settings_security_new_password"
onkeyup="check_passwords(this.value, getElementById('settings_security_password_confirm').value)"/></td>
</tr>
<tr>
<td><label>Confirm password</label></td>
<td class="td_input"><input type="password"
name="new_password_confirm"
id="settings_security_password_confirm"
onkeyup="check_passwords(getElementById('settings_security_new_password').value, this.value)"/></td>
</tr>
<tr>
<td class="td_error" id="settings_security_error"></td>
</tr>
</table>
And this is where the external HTML is placed...:
<div id="settings_appearance">
</div>
... from this javascript snippet:
function get_page_content(page, target_id)
{
$.get('engine/ajax/get_page_content.php?page=' + page,
null,
function(result)
{
$("#"+target_id).html(result); // Or whatever you need to insert the result
},
'html');
}
Well... the problem is that the javascript in the first snippet is executed when it's loaded by the $.get function, but i still can't understand the reason why when i type into the input boxes nothing happen. It should write the output of the javascript function check_passwords(password, password_confirm) in <td class="td_error" id="settings_security_error"></td>.
Thanks for helping.
Silvio
Hi,
Is there any way that I can call my Java script function from css
for ex here is style:
.first-nav li a:hover,
.first-nav li.hover a {
margin:-3px 0 -1px;
height:30px;
position:relative;
background:url(../images/nav-hover.jpg) no-repeat;
}
and what I want to call a JS function on anchor hover
I want to write script for internal issue tracking system, integrated with ClearCase, that checks activity name (typed by user) for illegal characters. Unfortunatly, I can't find list of characters, allowed by ClearCase. Does anybody know where to get it?
UPD: I'm looking for a link to a document, that specifies the allowed characters (or says that all characters are allowed).