I am dynamically creating a hyperlink in the c# code behind file of ASP.NET. I need to call a JavaScript function on client click. how do i accomplish this?
thanks in advance
Hi,
I am trying to implement my own version of pow() and sqrt() function as my custom library doesn't have pow()/sqrt() floating point support.
Can anyone help?
Sometime back I used a windows tool to see what a process is doing. This tool allowed me to inspect functions exported from DLL. It also allowed me to change the values passed to a function on the fly.
I cannot recollect the name(not sure if that was free or commercial one). Could any one point to me solution that can do this?
(Tools like ProcessExplorer, ProcessMonitor helps a bit.. this was better)
Cheers,
Jayan
I've found many definitions of the 'var' statement but most of them are incomplete (usually from introductory guides/tutorials). Should I use 'var' if the variable & scope has been declared in the params list?
someFunc = function(someVar)
{
// Is it considered good practice to use 'var', even if it is redundant?
var someVar = cheese;
};
Is there a debugging system that allows me to record javascript function calls and their parameters as they occur? this would allow me to trace and debug applications in live/client situations without the performance hit due to manual logging.
Edit: I'm not talking about manually calling functions using a 'console' window and viewing the results, or manually adding 'trace' or 'log' commands into my javascript. I need it to work with any running javascript.
$('#calendar').fullCalendar
(
{
editable: true,
events:
$.ajax
(
{
type: "POST",
url: "Calender.aspx/GetCDCatalog",
contentType: "application/json; charset=utf-8",
data: "{}",
dataType: "json"
}
)
}
)
calender.aspx is page and getcddialog is function which return type is array which doest not bind calender.
public CD[] GetCDCatalog()
{
XDocument docXML =
XDocument.Load(Server.MapPath("mydata.xml"));
var CDs =
from cd in docXML.Descendants("Table")
select new CD
{
title = cd.Element("title").Value,
star = cd.Element("star").Value,
endTime = cd.Element("endTime").Value,
};
return CDs.ToArray<CD>();
}
Hello,
I want to plot a piecewise function, but I don't want any gaps to appear
at the junctures, for example:
t=[1:8784];
b=(26.045792 + 13.075558*sin(0.0008531214*t - 2.7773943)).*((heaviside(t-2184))-(heaviside(t-7440)));
plot(b,'r','LineWidth', 1.5);grid on
there should not be any gaps appearing in
the plot between the three intervals , but they do.
I want the graph to be continueous without gaps.
Any suggestions on how to achieve that.
Thanks in advance.
When I click on the hx:commandButton the method should get called but the method is not getting called. My code is as follows:
function test() {
alert('ss');
return "true";
}
and method calling is :
<hx:commandExButton
type="submit"
value="Search"
styleClass="action2" id="searchButton"
onclick="return test();"
action="#{pc_WorkInProgressUserGrid.doSearchButtonAction}"
immediate="true">
</hx:commandExButton>
Any suggestion would be helpful.
I have this function in .net code:
public class StringGenerator
{
public static string GenerateString(string hash)
{
return hash.GetHashCode();
}
}
I want to be able to call this from PHP page. Any idea how?
Hi everyone,
I am having little problem with importing classes in python. My work flow goes like this
index.py
class Template:
def header():
def body():
def form():
def footer():
display.py
I want to call function header(), body() and footer () in my display.py page. Will anyone make me clear about this issue in python. Thanks for your concern.
Which virtual table will be pure virtual function located? In the base class or derived class?
For example, what does the virtual table look like in each class?
class Base {
virtual void f() =0;
virtual void g();
}
class Derived: public Base{
virtual void f();
virtual void g();
}
I've Got a program that uploads/downloads files into an online server,Has a callback to report progress and log it into a textfile, The program is built with the following structure:
public void Upload(string source, string destination)
{
//Object containing Source and destination to pass to the threaded function
KeyValuePair<string, string> file = new KeyValuePair<string, string>(source, destination);
//Threading to make sure no blocking happens after calling upload Function
Thread t = new Thread(new ParameterizedThreadStart(amazonHandler.TUpload));
t.Start(file);
}
private void TUpload(object fileInfo)
{
KeyValuePair<string, string> file = (KeyValuePair<string, string>)fileInfo;
/*
Some Magic goes here,Checking The file and Authorizing Upload
*/
var ftiObject = new FtiObject ()
{ FileNameOnHDD = file.Key,
DestinationPath = file.Value,
//Has more data used for calculations.
};
//Threading to make sure progress gets callback gets called.
Thread t = new Thread(new ParameterizedThreadStart(amazonHandler.UploadOP));
t.Start(ftiObject);
//Signal used to stop progress untill uploadCompleted is called.
uploadChunkDoneSignal.WaitOne();
/*
Some Extra Code
*/
}
private void UploadOP(object ftiSentObject)
{
FtiObject ftiObject = (FtiObject)ftiSentObject;
/*
Some useless code to create the uri and prepare the ftiObject.
*/
// webClient.UploadFileAsync will open a thread that
// will upload the file and report
// progress/complete using registered callback functions.
webClient.UploadFileAsync(uri, "PUT", ftiObject.FileNameOnHDD, ftiObject);
}
I got a callback that is registered to the Webclient's UploadProgressChanged event , however it is getting called twice per sent request.
void UploadProgressCallback(object sender, UploadProgressChangedEventArgs e)
{
FtiObject ftiObject = (FtiObject )e.UserState;
Logger.log(ftiObject.FileNameOnHDD, (double)e.BytesSent ,e.TotalBytesToSend);
}
Log Output:
Filename: C:\Text1.txt Uploaded:1024 TotalFileSize: 665241
Filename: C:\Text1.txt Uploaded:1024 TotalFileSize: 665241
Filename: C:\Text1.txt Uploaded:2048 TotalFileSize: 665241
Filename: C:\Text1.txt Uploaded:2048 TotalFileSize: 665241
Filename: C:\Text1.txt Uploaded:3072 TotalFileSize: 665241
Filename: C:\Text1.txt Uploaded:3072 TotalFileSize: 665241
Etc...
I am watching the Network Traffic using a watcher, and only 1 request is being sent.
Some how i cant Figure out why the callback is being called twice, my doubt was that the callback is getting fired by each thread opened(the main Upload , and TUpload), however i dont know how to test if thats the cause.
Note: The reason behind the many /**/ Comments is to indicate that the functions do more than just opening threads, and threading is being used to make sure no blocking occurs (there a couple of "Signal.WaitOne()" around the code for synchronization)
I am trying to visualize some values on a form. They range from 0 to 200 and I would like the ones around 0 be green and turn bright red as they go to 200.
Basically the function should return color based on the value inputted. Any ideas ?
I am looking for a javascript beautifier with a very specific function. I need a beautifier that can sort functions and vars alphabetically based off of their names. I have a very long javascript file that is an eyesore to look at. Does anyone know of any javascript beautifiers that will do this?
I'm running GM_xmlhttpRequest and storing the responseText into a newly created HTML element:
var responseHTML = document.createElement('HTML');
onload: function() { responseHTML.innerHTML = response.responseText; }
And then I am trying to find an element in responseHTML.
console.log(responseHTML.getElementsByTagName('div'));
console.log(responseHTML.getElementById('result_0'));
The first works fine, but not the second. Any ideas?
HI I try to run :
select
year,
regr_slope(sum(sale_count),year) as slope,
from products
group by year
It throws "00937. 00000 - "not a single-group group function"" .When i delete year from select clause problem disapears. Shouldn't I be able to select column with which I'm grouping?
Oracle 11.2 sqldeveloper
ty for help !
Hi,
I would like to open a webpage and run a javascript function from within a java app.
For example I would like to open the page www.mytestpage.com and run the following javascript code:document.getElementById("txtEmail").value="[email protected]";submit();void(0);
This works in a browser...how can I do it programatically?
Thanks!
I have this code:
function render_message(id)
{
var xmlHttp;
xmlHttp=new XMLHttpRequest();
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.getElementById('message').innerHTML=xmlHttp.responseText;
document.getElementById('message').style.display='';
}
}
var url="include/javascript/message.php";
url=url+"?q="+id;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
For some reason it does not work in IE and an error is being reported on this line "document.getElementById('message').innerHTML=xmlHttp.responseText;" with an "Unknown Runtime Error".
Can anyone help?
Edit: The code being added to the div is valid code ect.
Here is the response:
<div style="margin-left:auto;margin-right:auto;width:400px;">
<img src="/forum/img/avatars/2.gif" width="90" height="89" style="float:left;">
<div style="margin-left:100px;">
<span style="font-size:16pt;">Sam152</a></span><br>
<span style="font-size:10pt;text-transform:uppercase;font-weight:bold;">From Sam152</span><br>
<span style="font-size:10pt;font-weight:bold;">Recieved April 17, 2009, 9:44 am</span><br>
<br><br>
</div>
</div>
<div style="margin-left:auto;margin-right:auto;width:400px;">
asd</div>
<div style="margin-left:auto;margin-right:auto;width:400px;text-align:right;padding-top:10px;">
<span onClick="requestPage('http://www.gametard.com/include/scripts/delete_message.php?id=14');document.getElementById('message14').style.display='none';document.getElementById('message').style.display='none';" class="button">Delete</span>
<span onClick="document.getElementById('message').style.display='none';" class="button">Close</span>
<span onClick="document.getElementById('to').value ='Sam152';document.getElementById('to').style.color ='#000';document.getElementById('newmessage').style.display='';" class="button">Reply</span>
</div>
Hi
I am getting this error : "Unhandled exception at 0x00411690 in tim.exe: 0xC0000005: Access violation reading location 0x00000008" when I execute a program this is compiled and linked successfully and the problem is that localtime() function is not correctly recognized by Visual C++ 2008. (With VC++6, this program works fine).
Is there any idea and thanks for replies:
i am doing a project about shell, and i want the code that gives me the path the system() function uses.
example, when i enter the command
type dir
the reply will be
dir is external command (/bin/dir)
How to implement a static function in an abstract class?? Where do I implement this?
class Item{
public:
//
// Enable (or disable) debug descriptions. When enabled, the String produced
// by descrip() includes the minimum width and maximum weight of the Item.
// Initially, debugging is disabled.
static enableDebug(bool);
};
Anyone know of a good implementation of this whose license is compatible with non-free iPhone apps?
As suggested in this question, Boost looks absolutely wonderful. But as best I can tell, it is only available in C++.
http://stackoverflow.com/questions/2328258/cumulative-normal-distribution-function-in-c