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
$('#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.
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?
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.
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?
Hi,
I'm writing a little jQuery component that animates in response to button presses and also should go automatically as well. I was just wondering if this function recursive or not, I can't quite work it out.
function animate_next_internal() {
$('#sc_thumbnails').animate(
{ top: '-=106' },
500,
function() {
animate_next_internal();
}
);
}
My actual function is more complicated to allow for stops and starts, this is just a simplified example.
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 ?
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'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 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?
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 !
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();
}
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
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);
};
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)
Basically, I want this:
h2 {
font: bold 36px/2em "Times New Roman"
}
To this:
h2 {
font-size: 36px;
font-weight: bold;
line-height: 2em;
font-family: "Times New Roman"
}
And other variations, of course. Does anyone know of a function that does this so I don't have to code it myself? :)
Where are functions stored in a C++ program?
For example
int abc()
{
//where am I stored?
}
I know that we can take the address of a function, that means functions are stored somewhere in memory. But I have already read at many places that no memory allocation for functions takes place.
I am confused. My question may seem vague to many of you but I can't help.
pthread_t thread1;
pthread_create(&thread1,NULL,.......,NULL);// Here I want to attach a thread to a member funtion of class
How can i pass the Member function of a class in the above code.
Hi
I need function which returns:
for any number from range = result
[0.001,0.01) => 0.01
[0.01,0.1) => 0.1
[0.1,1) => 1
[1,10) => 10
[10,100) => 100
etc.
My first idea was to use if, but this the worst way. Is there a simple solution?
I can compile DLLs properly using mingw and do the exports/imports stuff. What I am looking for is defining the dll onload function properly as you would in MS VC products. Google didn't turn up anything. Anyone have any ideas or a link to a tutorial?
It was suggested that this code snippet be added to the question:
extern "C" DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD Reason, LPVOID LPV)
And yes, this is what I am trying to do, but with mingw.