|
I want to create an array of arrays of strings. Here's what I tried doing:
my (@arrayOfArrays, @array);
This is inside a FOR Loop
{
@array = (@array, "myString");
@arrayOfArrays = (@arrayOfArrays, \@array);
}
That should create an array of array references, where each reference points to an array of increasing size (i.e. one more element than the previous array).
Now, what if I want to add a string value directly to one of the subarrays, say the 5th array (index=4). How would I do it? Is this how?
$arrayOfArrays->[4] = ($arrayOfArrays->[4], "2ndString");
Probably not, because it's not working. Please help with this. Thanks.
|
|
|
|
|
(Assuming that @arrayOfArrays is still in the scope):
<br />
$arrayOfArrays[4] = [ @{$arrayOfArrays[4]}, "2ndString" ];<br />
Basically, @{$arrayOfArrays[4]} dereferences the arrayref, then the [] creates a new arrayref using the contents of @{$arrayOfArrays[4]} and "2ndString" .
- Mike
|
|
|
|
|
Oh yeah, if you want to modify the array directly instead of creating a new array:
<br />
push(@{$arrayOfArrays[4]},"2ndString");<br />
- Mike
|
|
|
|
|
I'm writing code to capture ASP performance data such as response time, etc.
One very important piece of data I require is the actual processor time used by the specific IIS thread handling the ASP execution.
Any thoughts on the best manner to obtain this?
Ed Thayer
|
|
|
|
|
Yeah, use the Performance Monitor application / MMC snap-in (depending on the version of Windows) with the many various ASP counters. On most systems, you can type perfmon to get started. Add the counters you're interested in, and you're set.
BTW, writing an ISAPI filter would definitely not be the right way. Generally, you want to write the counters into the code which will be monitored. This isn't to say that the counters should be right there, intruding in all source lines, but they should be integrated. There are some great articles and examples of this in the .NET documentation. The practices apply to most implementations and platforms (if not all).
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
I have 3 datagrid custom controls and want to add in my page at run time check that either it should be add or not.
And also which one should have priority 1 it should be at first rest of the grids come after that.
Ather Ali Shaikh
|
|
|
|
|
Hi..
I make a css file with the following lines:
input <br />
{ <br />
border-right: white thin solid; <br />
border-top: white thin solid; <br />
border-left: white thin solid; <br />
color: white; <br />
border-bottom: white thin solid; <br />
background-color: #0033ff; <br />
}
I want to apply the style for <input type=button> only not all input controls..
How can I do it ?
|
|
|
|
|
You can't. CSS is for elements, not attributes. What you can do instead is define an element class, either: input.button (limits class to input elements) or a stand-alone class like .button (can be used on any element). Then, specify the class attribute in your code: <input type=button class=button> .
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
In CSS2 one can match attributes (see Attribute selectors[^]). But IE doesn't support CSS2, one have to go with style classes
|
|
|
|
|
Hi.
I insert new rows in a *.mdb file using (rs.AddNew)
It works fine on localhost but when I try it on the server I get :
Microsoft JET Database Engine error '80040e09'
Cannot update. Database or object is read-only
the Directory containing the file that makes the insertion has write permissions..
any suggestions please ?
|
|
|
|
|
Check the optional settings in your connection object... the default is read-only, but changing the mode or cursor type can override that - I forget which. Sorry for being so vague, but it's 2AM and I haven't looked at my last web project for a month, but I ran into the same problem... A change to the connection string or the parameters passed with the .Open command fixed it.
"The Lion shall lie down with the Lamb; but the Lamb will not get much sleep..." Lazarus Long
|
|
|
|
|
thank u
the connection is ok.. as i said it worked on localhost
the solution is i need to give write permission to the database folder .. not only the script folder coz Access needs to create *.ldb file (a locking information file)
|
|
|
|
|
Ah, I'll have to remember that in case I run into it again! Glad you solved it.
"The Lion shall lie down with the Lamb; but the Lamb will not get much sleep..." Lazarus Long
|
|
|
|
|
Hi all,
whats "onfiltered" DHTML event used for?
Thanks alot.
|
|
|
|
|
|
In JavaScript, in my script (i.e. not in the XHTML code), how would I add multiple functions to an event handler? For example, in JS you can do this:
onload = MyFunction();
And in C# you can do this:
event = EventHandler
event += AnotherEventHandler
But can you do something similar in JS?
-Domenic Denicola- [CPUA 0x1337]
“I was born human. But this was an accident of fate—a condition merely of time and place. I believe it's something we have the power to change…”
|
|
|
|
|
Perhaps you can create a single set of functions that serve as an event dispatcher and bundle them up as a .js:
function HookEvent(oElement, cEventName, fFunction) {
var iIndex = -1;
if (oElement.EventList == null)
oElement.EventList = new Array();
else
iIndex = FindEventIndex(oElem, cEventName);
SetEventFunction(oElement, cEventName, iIndex, fFunction);
}
function FindEventIndex(oElem, cEventName) {
var aEvents = oElem.EventList;
if (aEvents != null)
{
for (var iLup = 0; iLup < aEvents.length; iLup++)
{
if (aEvents[iLup][0] == cEventName)
return iLup;
}
}
return -1;
}
function SetEventFunction(oElement, cEventName, iIndex, fFunction) {
if (iIndex > -1)
{
var aEventFcns = oElement.EventList[iIndex][1];
aEventFcns[aEventFcns.length] = fFunction;
}
else
{
oElement.EventList[oElement.EventList.length] = new Array(cEventName, new Array(fFunction))
}
eval("oElement." + cEventName + " = ProcessEventHandlers");
}
function ProcessEventHandlers() {
var oElem = window.event.srcElement;
var cEvent = "on" + window.event.type;
var iIndex = FindEventIndex(oElem, cEvent);
if (iIndex > -1)
{
var aFcns = oElem.EventList[iIndex][1];
if (aFcns == null)
return;
for (var iLup = 0; iLup < aFcns.length; iLup++)
{
eval(aFcns[iLup]);
}
}
}
NOTE: THis is just something i typed in and is not guaranteed to work. Just for example purposes.
onwards and upwards...
|
|
|
|
|
First, don't use eval. Never ever as it'll recompile the current script plus the stuff inside the eval
To attach more than one event handler to an element, use the method attachEvent (IE) or for w3c browsers addEventListener[^]:
<br />
var el = document.getElementById("foo");<br />
el.attachEvent("onclick", foo);<br />
el.attachEvent("onclick", function () { alert("2nd handler"); });<br />
<br />
function foo(event) {<br />
alert("1st handler");<br />
}<br />
|
|
|
|
|
I have a desktop, non-networked, standalone program that writes HTML text out to a set of files based on the data that it has processed, making a nice user interface for those that need to review what data was generated.
I want to provide the capability to have a second program be started with a filename as a command line parameter (?) when a user clicks on a filename within the HTML, to perform some additional processing on the contents of the selected file. I am guessing that this would have to be an anchor tag of some sort, but I don't know what kind and can't seem to find anything about it.
How can I write the HTML to start a specific program with the selected file as a parameter when a link is selected? Can I do this without having the file extension associated with my program?
Thanks,
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
The only way that I'm aware of is by having file associations. Otherwise, it's ActiveX time.... good luck.
onwards and upwards...
|
|
|
|
|
Do you know of anything within any of the scripting variations (VBscript, JavaScript, etc) that could be called when a link is selected, and that then could start execution of a program?
I would like to stay away from having to create file associations because if the data, the HTML, and the program are provided on a CD-ROM, for example, then there really isn't any "installation." It would just appear to the user that when they selected a certain link, a program would start using the selected file.
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
David Chamberlain wrote:
Do you know of anything within any of the scripting variations (VBscript, JavaScript, etc) that could be called when a link is selected, and that then could start execution of a program?
Due to security concerns and "sandboxing", these script languages are designed not to allow you to spawn an executable program from browser scripting.
David Chamberlain wrote:
It would just appear to the user that when they selected a certain link, a program would start using the selected file.
By just specifying the data file, the OS will prompt them the first time to browse for the program to open the file with. Instruct them to browse to the CD.
Sorry, those are the best answers I can give..
onwards and upwards...
|
|
|
|
|
If you are hosting the browser control in your app yuou can use window.external to route the click to your app and launch the other program from there.
I know there are some examples out there, I just can't remember them at the moment.
|
|
|
|
|
I would like to change Text on a webpage on the fly. I know about the innerText property for ie. I cann't use this however becuase I am not using ie. Or netscape for that matter. I need a way that is very browser nonspecific. Is there anyway to do this using javascript or JSP. I want to be able to change the text on the screen without reloading the page.
Thank you.
Mardigin.
|
|
|
|
|
hi..
you can put that portion that changes in a separate frame(myFrame)..
then make a link with target = myFramee .. when the user clicks the link the page in (myFrame) loads with new values So you can make it in asp to accept arguments..Got it ?
|
|
|
|