http://something.com:80/somedir/index.html?type=test;one=onevalue#nose
This is typical URI structure my question is what is "#nose" and how i can use/utilize it as web developer ?
Thanks all.
We are implementing a single sign on mechanism in an enterprise environment, where the token is shared between applications using HTTP header. Now, in order to do the integration test, I need to write an application to simulate this.
Is there any way in ASP.NET where I can redirect to another web-page and pass a custom HTTP header in the process?
Thanks
I've found a lot of examples that reference Java and C for this, but how do I, or can I, check for the existence of an external file with XSL.
First, I realize that this is only a snippet, but it's part of a huge stylesheet, so I'm hoping it's enough to show my issue.
<!-- Use this template for Received SMSs -->
<xsl:template name="ReceivedSMS">
<!-- Set/Declare "SMSname" variable (local, evaluates per instance) -->
<xsl:variable name="SMSname">
<xsl:value-of select=" following-sibling::Name"/>
</xsl:variable>
<fo:table font-family="Arial Unicode MS" font-size="8pt" text-align="start">
<fo:table-column column-width=".75in"/>
<fo:table-column column-width="6.75in"/>
<fo:table-body>
<fo:table-row>
<!-- Cell contains "speakers" icon -->
<fo:table-cell display-align="after">
<fo:block text-align="start">
<fo:external-graphic src="../images/{$SMSname}.jpg" content-height="0.6in"/>
What I'd like to do, is put in an "if" statement, surronding the {$SMSname}.jpg line. That is:
<fo:block text-align="start">
<xsl:if test="exists( the external file {$SMSname}.jpg)">
<fo:external-graphic src="../images/{$SMSname}.jpg" content-height="0.6in"/>
</xsl:if>
<xsl:if test="not(exists( the external file {$SMSname}.jpg))">
<fo:external-graphic src="../images/unknown.jpg" content-height="0.6in"/>
</xsl:if>
</fo:block>
Because of "grouping", etc., I'm using XSLT 2.0. I hope that this is something that can be done. I hope even more that it's something simple.
As always, thanks in advance for any help.
LO
Hi all;
<% int i = Eval("NAME").ToString().IndexOf("."); string str = Eval("NAME").ToString().Substring(i + 1); %>
<img src="../images/img_<%= str %>.gif" alt="" />
EVAL("test.txt")
I need "txt" how to make ? Please Help
Thank you
We have recently downloaded, installed and compiled gcc-3.0.4 code. gcc compiler has built successfully and we where able to compile some same test cpp file. I would like to know how we can modify gcc source code so that we add additional run time debugging statements like the binary in execution compiled by my gcc should print below statement in a log file:
filename.cpp::FunctionName#linenumber-statement
or any additional information that I can insert via this tailored compiler code Any references would be highly appreciable.
I am writing a script to run under the korn shell on AIX. I'd like to use the mkdir command to create a directory. But the directory may already exist, in which case I don't want to do anything. So I want to either test to see that the directory doesn't exist, or suppress the "File exists" error that mkdir throws when it tries to create an existing directory.
Any thoughts on how best to do this?
I have this (simplification):
$(li).click(function{alert("test");});
<li>
<input>
</li>
What's the best way to bind an event to li but not fire when the user clicks on the input element?
I'm developing a website that will connect to a credit card processing gateway webservice. For security purposes this webservice accepts requests only from IP addresses that were previously informed to them.
Since I'm developing locally, my IP changes almost every day. Is there a way for me to change the IP address of a HttpWebRequest so that I can test the Webservice calls locally?
This webservice is accessed through a https address and the methods must be sent via POST.
I know from experience that b-trees have awful performance when data is added to them sequentially (regardless of the direction). However, when data is added randomly, best performance is obtained.
This is easy to demonstrate with the likes of an RB-Tree. Sequential writes cause a maximum number of tree balances to be performed.
I know very few databases use binary trees, but rather used n-order balanced trees. I logically assume they suffer a similar fate to binary trees when it comes to sequential inputs.
This sparked my curiosity.
If this is so, then one could deduce that writing sequential IDs (such as in IDENTITY(1,1)) would cause multiple re-balances of the tree to occur. I have seen many posts argue against GUIDs as "these will cause random writes". I never use GUIDs, but it struck me that this "bad" point was in fact a good point.
So I decided to test it. Here is my code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T1](
[ID] [int] NOT NULL
CONSTRAINT [T1_1] PRIMARY KEY CLUSTERED ([ID] ASC)
)
GO
CREATE TABLE [dbo].[T2](
[ID] [uniqueidentifier] NOT NULL
CONSTRAINT [T2_1] PRIMARY KEY CLUSTERED ([ID] ASC)
)
GO
declare @i int, @t1 datetime, @t2 datetime, @t3 datetime, @c char(300)
set @t1 = GETDATE()
set @i = 1
while @i < 2000 begin
insert into T2 values (NEWID(), @c)
set @i = @i + 1
end
set @t2 = GETDATE()
WAITFOR delay '0:0:10'
set @t3 = GETDATE()
set @i = 1
while @i < 2000 begin
insert into T1 values (@i, @c)
set @i = @i + 1
end
select DATEDIFF(ms, @t1, @t2) AS [Int], DATEDIFF(ms, @t3, getdate()) AS [GUID]
drop table T1
drop table T2
Note that I am not subtracting any time for the creation of the GUID nor for the considerably extra size of the row. The results on my machine were as follows:
Int: 17,340 ms
GUID: 6,746 ms
This means that in this test, random inserts of 16 bytes was almost 3 times faster than sequential inserts of 4 bytes.
Would anyone like to comment on this?
Ps. I get that this isn't a question. It's an invite to discussion, and that is relevant to learning optimum programming.
I am using method to create folder on ftp i want get exception if folder already exsists how to make it over write the existing folder
using System; using System.Net;
class Test {
static void Main()
{
WebRequest request = WebRequest.Create("ftp://host.com/directory");
request.Method = WebRequestMethods.Ftp.MakeDirectory;
request.Credentials = new NetworkCredential("user", "pass");
using (var resp = (FtpWebResponse) request.GetResponse())
{
Console.WriteLine(resp.StatusCode);
}
} }
it is "remote server returned error (550) file not found"
Hello,
i need to execute command line from .NET windows application.
I tried with this code but i get error
'C:\Documents' is not recognized as an
internal or external command, operable
program or batch file.
var command ="\"C:\\Documents and Settings\\Administrator\\My Documents\\test.exe\" \"D:\\abc.pdf\" \"C:\\Documents and Settings\\Administrator\\My Documents\\def.pdf\"";
var processInfo = new ProcessStartInfo("cmd","/c " + command)
{
UseShellExecute = false,
RedirectStandardError = true,
CreateNoWindow = true
};
var p = Process.Start(processInfo);
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!
Hello friends i am moving from php to ruby on rails. Suppose u want to create a application in ruby on rails
rails depot -d mysql
This will create a application depot with database mysql right..!!!
Now config/database.yml has a definition of three databases ie depot_development, depot_test and depot_production under environment development , test and production respectiviely
Whats the significance of creating these three databases.. (Please explain considering this is my first day with ruby on rails and i am takin help from Agile Web Development with Rails)
Hey Everyone,
I was wondering if any one had compiled a list of the most commonly used Android devices so I can get an idea of what I should test for. Even better would be suggested configurations for emulating each device.
Thanks,
Rob
Here is the situation
I create a instance of a class
$newobj = new classname1;
Then I have another class writtern below and I want to this class to access the object above
class newclass {
public function test() {
echo $newobj->display();
}
}
It is not allowed, is there a way define a variable globally through a class?
I have the following code:
[TestMethod]
public void TestFoo()
{
Foo(null);
}
private void Foo (object bar)
{
Console.WriteLine("Foo - object");
}
private void Foo (string bar)
{
Console.WriteLine("Foo - string");
}
and when I run the test "TestFoo()", the console output is "Foo - string". How does the compiler decide which method to call?
Hello there,
I am using C and my knowledge is very basic.
I want to scan a file and get the contents after the first or second line only ...
I tried :
fscanf(pointer,"\n",&(*struct).test[i][j]);
But this syntax simply starts from the first line =\
How is this possible ?
Thanks.
First time using "JSON" and I've just been working away at my dissertation and I'm integrating a few features from the steam API.. now I'm a little bit confused as to how to create arrays.
function test_steamAPI()
{
$api = ('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.get_Steam_api().'&steamids=76561197960435530');
$test = decode_url($api);
var_dump($test['response']['players'][0]['personaname']['steamid']);
}
//Function to decode and return the data.
function decode_url($url)
{
$decodeURL = $url;
$data = file_get_contents($url);
$data_output = json_decode($data, true);
return $data_output;
}
So ea I've wrote a simple method to decode Json as I'll be doing a fair bit..
But just wondering the best way to print out arrays..
I can't for the life of me get it to print more than 1 element without it retunring an error e.g. Warning: Illegal string offset 'steamid' in /opt/lampp/htdocs/lan/lan-includes/scripts/class.steam.php on line 48
string(1) "R"
So I can print one element, and if I add another it returns errors.
EDIT -- Thanks for help,
So this was my solution:
function test_steamAPI()
{
$api = ('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.get_Steam_api().'&steamids=76561197960435530,76561197960435530');
$data = decode_url($api);
foreach($data ['response']['players'] as $player)
{
echo "Steam id:" . $player['steamid'] . "\n";
echo "Community visibility :" . $player['communityvisibilitystate'] . "\n";
echo "Player profile" . $player['profileurl'] ."\n";
}
}
//Function to decode and return the data.
function decode_url($url)
{
$decodeURL = $url;
$json = file_get_contents($decodeURL);
$data_output = json_decode($json, true);
return $data_output;
}
Worked this out by taking a look at the data.. and a couple json examples, this returns an array based on the Steam API URL (It works for multiple queries.... just FYI) and you can insert loops inside for items etc.. (if anyone searches for this).
Looking for example code that uses semantic HTML that I can use to test stylesheets with. The version/doctype is unimportant though HTML5 would be great. When I say "comprehensive" - I am looking for use of definition lists, forms, tables, plus all the usual.
Thanks
I have a big solution with more than 40 projects. Almost half of them are test projects.
In my project we use both Code Contracts, Code Analysis, Style Analysis.
I want to be able to build the projects that are not dependent in parallel on my quad core CPU.
How can I setup msbuild to build the projects in parallel?
Hi all,
I'm adding a label to a page using the code below, how would I set the position of the label (i.e top right)?
Label lbl = new Label();
lbl.Text = "Test";
lbl.ForeColor = System.Drawing.Color.Black;
lbl.Font.Size = 10;
lbl.Font.Bold = false;
lbl.Font.Name = "Arial";
Page.Controls.Add(lbl);
Thanks
I have this piece of code:
function func1(text) {
var pattern = /([\s\S]*?)(\<\?(?:attrib |if |else-if |else|end-if|search |for |end-for)[\s\S]*?\?\>)/g;
var result;
while (result = pattern.exec(text)) {
if (some condition) {
throw new Error('failed');
}
...
}
}
This works, unless the throw statement is executed. In that case, the next time I call the function, the exec() call starts where it left off, even though I am supplying it with a new value of 'text'.
I can fix it by writing
var pattern = new RegExp('.....');
instead, but I don't understand why the first version is failing. How is the regular expression persisting between function calls? (This is happening in the latest versions of Firefox and Chrome.)
Edit Complete test case:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Test Page</title>
<style type='text/css'>
body {
font-family: sans-serif;
}
#log p {
margin: 0;
padding: 0;
}
</style>
<script type='text/javascript'>
function func1(text, count) {
var pattern = /(one|two|three|four|five|six|seven|eight)/g;
log("func1");
var result;
while (result = pattern.exec(text)) {
log("result[0] = " + result[0] + ", pattern.index = " + pattern.index);
if (--count <= 0) {
throw "Error";
}
}
}
function go() {
try { func1("one two three four five six seven eight", 3); } catch (e) { }
try { func1("one two three four five six seven eight", 2); } catch (e) { }
try { func1("one two three four five six seven eight", 99); } catch (e) { }
try { func1("one two three four five six seven eight", 2); } catch (e) { }
}
function log(msg) {
var log = document.getElementById('log');
var p = document.createElement('p');
p.innerHTML = msg;
log.appendChild(p);
}
</script>
</head>
<body><div>
<input type='button' id='btnGo' value='Go' onclick='go();'>
<hr>
<div id='log'></div>
</div></body>
</html>
The regular expression continues with 'four' as of the second call on FF and Chrome, not on IE7 or Opera.
Is there a one fix solution for all IE6 problems? One HTC/jQuery file that fixes IE6 problems like PNG, background position, hover, (even) rounded corners...
I'm just tired to look for all fixes, test them and put them seperately.