I'm writing a linux driver and I would like to register a callback function to be invoked when the system goes to sleep. What is the api to do this?
Thanks.
I have a method that is trying to take in a list. This list can contain data and other lists. The end goal is to try to convert something like this
["a", "b", ["c", "d"]]
into
<ol>
<li>
<b>a</a>
</li>
<li>
<b>b</a>
</li>
<ol>
<li>
<b>c</a>
</li>
<li>
<b>d</a>
</li>
</ol>
</ol>
The code is:
function $(tagName) {
return document.createElement(tagName);
}
//returns an html element representing data
//data should be an array or some sort of value
function tagMaker(data) {
tag = null;
if(data instanceof Array) {
//data is an array, represent using <ol>
tag = $("ol");
for(i=0; i<data.length; i++) {
//construct one <li> for each item in the array
listItem = $("li");
//get the html element representing this particular item in the array
child = tagMaker(data[i]);
//<li>*html for child*</li>
listItem.appendChild(child);
//add this item to the list
tag.appendChild(listItem);
}
} else {
//data is not an array, represent using <b>data</b>
tag = $("b");
tag.innerHTML = data.toString();
}
return tag;
}
Calling tagMaker throws HIERARCHY_REQUEST_ERR: DOM Exception 3, rather than generating a helpful HTML element object which I was planning to append to document.body.
i asked a question regarding how to display aspx and cs code on page,
one answer was convert to string and display in textbox
i would like to know if there is a function in c# asp.net which allows to convert file contents directly to string?
Hey,
I'm trying to get the GUID of a given sharepoint URL. I don't mind using the API or the webservices or Sharepoint's database.
if i were to write a function, it's signature would be:
//get a GUID from path.
string GetGuidFromPath(string path){}
I had a lead: SPContentMapProvider but it doesn't seem to get the right info.
Thank you!
I have a C++ program that takes user input for fopen in order to initiate a file write. Could someone help me find a function which will return a FILE* and use the Windows specific version of mkdir in order to create the folder structure for fopen to never fail to open a new file in the specified location because one of the folders does not exist. Thanks a bunch!
Hello.
I working now on firm that using ref in every function.
The reason, is to catch errors.
There example :
//return true if the read is success
//otherwise writing to the error ,the problem
bool ReadFile(ref string error)
Question:
How do you catching errors?
Using ref,exceptions or other way?
Hi All,
I am calling a ajax method to update a div. It contains links and functions which require java script files. But these methods and functions are not getting called properly as java script files are not getting included through ajax call. For example, i am trying to call a light box function, but it gets redirected to different page and not in light box.
Thanks in advance, Anubhaw Prakash
<area shape="poly" coords="63,10,64,38,89,37,91,10" class={"strokeColor:'0000ff',strokeWidth:5, fillColor:'ff0000',fillOpacity:0.6}" href="#" id="x1">
There is a imagemap in my html and I want to dynamicly add a new configuration "alwaysOn:true" to the class attribute.
$("#x1").click(function(){alert(8);})
I am newbea I can add click listener to it but cannot figure out how to add config option
How can I do that with jquery?
I am new to Ajax. In my Ajax I get the following error message :
Notice: Undefined index: address in C:\wamp\www\test\sample.php on
line 11
I googled but I didn't get a solution for my specified issue.
Here is what I did.
HTML Form with Ajax (test1.php)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function loadXMLDoc()
{
var xmlhttp;
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("mydiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST","test2.php",true);
xmlhttp.send();
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="sample.php">
<p>
<label for="mail"></label>
<input type="text" name="mail" id="mail" onblur="loadXMLDoc()" />
<input type="submit" name="submit" id="submit" value="Submit" />
</p>
<p><div id = 'mydiv'></div></p>
</form>
</body>
</html>
test2.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
echo "Your Address is ".$_POST['address'];
?>
</body>
</html>
I am sure it is very simple issue but I don't know how to solve it. Any help ?
I have a simple one level deep vocabulary taxonomy. Something like Vocabulary-Term-Node. What I want to know is if there's a built in function to get an array of nodes related to a single term, something like taxonomy_select_nodes() but that would return an array of nodes instead of a string.
I need to sort a 2 dimensional array of doubles on multiple columns using either C or C++. Could someone point me to the algorithm that I should use or an existing library (perhaps boost?) that has this functionality?
I have a feeling that writing a recursive function may be the way to go but I am too lazy to write out the algorithm or implement it myself if it has been done elsewhere. :-)
Thanks
I am not sure if this belongs on serverfault or superuser.
I would like to override SetThreadExecutionState(ES_DISPLAY_REQUIRED) to be a no-op. How is this accomplished?
Is there some registry setting that can be altered instead of API hooking?
Blocking ES_DISPLAY_REQUIRED will prevent apps from keeping the monitor powered on. I have an application (likely the antivirus) that is preventing some monitors from entering power-save and I think this function is the culprit.
Hi, i have a form(id="search_options") and i tracking changes in form by:
$("#search_options").change(function() {
// Bla Bla Bla
});
In this form i have many inputs and one of is select(id="project_category") and i want to catch if user changed project_category select or another input. How can i done this ? Thanks
hi,
I wanted to have function which will accept as
foo(...)
{
}
usage of this would be
foo(1,2,3);
foo(1)
foo(1,2,3,4,5,5,6);
va_list can be used but again for that I have to pass foo(int count, ...), as this at run time i dont know how many argument i have.
any pointer would be appreciated
Thanks
Does anyone know of an onHide() event or something similar in jQuery?
I tried:
$(this).bind('hide', function(){
console.log('asdasda')
})
But apparently that doesn't work.
Is there a function or constant defining the amount of available memory for an app in iPhone OS?
I'm looking for a device-independent way (iPod touch, iPhone, iPad) to know how much memory the app has left.
I would like to know if this is the correct way of hiding visible elements when clicked anywhere on the page.
$(document).click(function (event) {
$('#myDIV:visible').hide();
});
The element (div, span etc) cannot disappear when click event occurs withing the boundaries of the element.
I would like to have a string (char*) parsed into a tm struct in C. Is there any built-in function to do that?
I am referring to ANSI C in C99 Standard.
I'm learning to use the PHP interactive shell, but I'm having trouble with multi-line code.
Using backslashes like in the UNIX shells doesn't seem to work. What am I doing wrong ?
php > function test(){\
php { echo "test";\
php { }\
php > test();
PHP Parse error: syntax error, unexpected T_ECHO, expecting T_STRING in php shell code on line 2
Is there a preferred (not ugly) way of outputting a list length as a string? Currently I am nesting function calls like so:
print "Length: %s" % str(len(self.listOfThings))
This seems like a hack solution, is there a more graceful way of achieving the same result?
Hi
I have the following jquery in my code$j.getJSON("http://localhost:8080/WWTestHarnessWEB/ReadersToolkitFinalController.htm?jsoncallback=?", {'uID': 1}, function(data){alert(data);});
The json that i am returning looks like the following ({"positiveCount":"0","negativeCount":"999"})
But my alert is never firing.
Any idea what i need to do to ensure that this will work?
regards
Damien
Hi All,
I have a problem in my project.I want to implement Tab bar function under a drop down selection and when once tab bar is clicked it has to be navigated to a data grid.Can any body suggest me the proper direction to implement it.
Thanks,
Brenda
I have the following html code:
<mytag>
Just Some Text
</mytag>
And I have this jQuery command
$('mytag').each(function () { alert($(this).html()); });
In all browsers except IE I'm getting the inner HTML, in IE I'm not. Anyone can shed any light on this mystery? I've tested this with IE8, Mozilla, Opera, Chrome and Safari
I have a set of folders, and I want to be able to run a function that will find the most recently edited file and tell me the name of the file and the folder it is in.
Folder layout:
root
Folder A
File A
File B
Folder B
File C
File D
etc...
Any tips to get me started as i've hit a bit of a wall.
Hi,
i have a variable like the following and i want a function to only keep the first 20 lines, so it will strips any additional \n lines more than 20.
<?php
$mytext="Line1
Line2
Line3
....."
keeptwentyline($mytext);
?>