Hi,
Is there anyway to wrap a TextView around an image?
It's the typical thing that people do in CSS like this http://www.echoecho.com/htmlimages08.htm
Thanks,
Tee
I've written a simple XML Document that I am trying to transform with an XSLT file, but I get no results when I run the code. Here is my XML document:
<?xml version="1.0" encoding="utf-8" ?>
<Employee xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns="XSLT_MVC.Controllers">
<ID>42</ID>
<Name>Russ</Name>
</Employee>
And here is the XSLT file:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
xmlns:ex="XSLT_MVC.Controllers" >
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:copy>
<!--<xsl:apply-templates select="@* | node()"/>-->
<xsl:value-of select="ex:Employee/Name"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Here is the code (from a C# console app) I am trying to run to perform the transform:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Xsl;
using System.Xml.XPath;
namespace XSLT
{
class Program
{
static void Main(string[] args)
{
Transform();
}
public static void Transform()
{
XPathDocument myXPathDoc = new XPathDocument(@"docs\sampledoc.xml");
XslTransform myXslTrans = new XslTransform();
myXslTrans.Load(@"docs\new.xslt");
XmlTextWriter myWriter = new XmlTextWriter(
"results.html", null);
myXslTrans.Transform(myXPathDoc, null, myWriter);
myWriter.Close();
}
}
}
When I run the code I get a blank html file. I think I may have problems with the namespaces, but am not sure. Can anyone help with this?
Hi,
I want my unit tests suite to load a SQL file in my database. I use a command like
"C:\Program Files\PostgreSQL\8.3\bin"\psql --host 127.0.0.1 --dbname unitTests --file C:\ZendStd\www\voo4\trunk\resources\sql\base_test_projectx.pg.sql --username postgres 2>&1
It run fine in command line, but need me to have a pgpass.conf Since I need to run unit tests suite on each of development PC, and on development server I want to simplify the deployment process. Is there any command line wich include password?
Thanks,
Cédric
Hello,
If you visit this site:
http://www.catswhocode.com/blog/
You would see that there is an image and summary for each post. What is the proper way to implement that?
Is this done using wordpress custom fields?
Or whether this is coded in image.php file present in theme folder?
How do i do that?
Thanks
I want to include a hash and list inside a YAML file that I'm parsing with the following command:
APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml")
My YAML file looks like this:
feeds: [{:url => 'http://www.google.com', :label => 'default'}]
But this doesn't seem to work.
How would I go about achieving such a thing?
Thanks,
Yuval
I'm using the Pascal FC implementation for Windows Vista found on http://www-users.cs.york.ac.uk/burns/pf.html
I'm trying to run the dining philophers problem found on the link but I don't get how to make the compiler work.
Screenshot
Some of the web sites started with www2 or www3 (www[n]) which is because balancing computing mentioned here at Stackoverflow )
I want to know how to do this ? and also has it any benefit or not ?
Hi,
I'm looking for an algorithm to calculate total cost of licenses purchased based on the "FogBugz for your server" pricing scheme (http://www.fogcreek.com/FogBugz/PriceList.html).
Fogbugz pricing is:
1 License $299
5 License Pack $999
10 License Pack $1,899
20 License Pack $3,499
50 License Pack $7,999
If you ask a quote for let's say 136 licenses they calculate it as $22,694.
How can I do this in C# or LINQ?
Any help will be appreciated.
I have searched through internet & found that there are no any direct method that disable nodes of CTreeCtrl control.
check one post at http://www.ucancode.net/faq/MFC_CTreeCtrl-CListCtrl.htm & also on codeguru.com but not clear about how to disable node of CTreeCtrl.
Can I use Google Maps Data API to get the IP Address informations such as Country, LatLong, City, etc. The result will be in JSON or XML format that I can parse through C#. Is there any C# Library for Google Maps Data API?
I found this interesting site
http://www.ipinfodb.com/ip_location_api_json.php
this guys even offer their IP address location database
http://ipinfodb.com/ip_database.php
Here is my first attempt at validating XML with XSD.
The XML file to be validated:
<?xml version="1.0" encoding="utf-8" ?>
<config xmlns="Schemas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="config.xsd">
<levelVariant>
<filePath>SampleVariant</filePath>
</levelVariant>
<levelVariant>
<filePath>LegendaryMode</filePath>
</levelVariant>
<levelVariant>
<filePath>AmazingMode</filePath>
</levelVariant>
</config>
The XSD, located in "Schemas/config.xsd" relative to the XML file to be validated:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="config">
<xs:complexType>
<xs:sequence>
<xs:element name="levelVariant">
<xs:complexType>
<xs:sequence>
<xs:element name="filePath" type="xs:anyURI">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Right now, I just want to validate the XML file precisely as it appears currently. Once I understand this better, I'll expand more. Do I really need so many lines for something as simple as the XML file as it currently exists?
The validation code in C#:
public void SetURI(string uri)
{
XElement toValidate = XElement.Load(Path.Combine(PATH_TO_DATA_DIR, uri) + ".xml");
// begin confusion
string schemaURI = toValidate.Attributes("xmlns").First().ToString()
+ toValidate.Attributes("xsi:noNamespaceSchemaLocation").First().ToString();
XmlSchemaSet schemas = new XmlSchemaSet();
schemas.Add("", XmlReader.Create( SOMETHING ));
XDocument toValidateDoc = new XDocument(toValidate);
toValidateDoc.Validate(schemas, null);
// end confusion
root = toValidate;
}
Any illumination would be appreciated.
How would I Redirect user in php without revieling referer of page that redirected
I figured I'd simply do something like this :: ( code example 2 ) ::
http://www.mustap.com/phpzone_post_62_how-to-bypass-the-referer-se
with the Get method , Simple example of what im trying to do is redirect to google without the referer of the php page I am referred from.
thanks
How can you open windows program by pressing a button on web page
I develop web app in asp.net, and I want to do some action in windows when press button on
the web page,
For example: when you press Messenger button in http://www.msn.com/?ocid=hmlogout
windows live messenger will open in your computer,
Is there a certain technique to do that ?
thanks for any suggestion.
Dani.
I need to upload large (100 meg max) binairies to server using WCF. I followed instructions from this: http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/fileuploadsilverlightwcf07142009104020AM/fileuploadsilverlightwcf.aspx
it workds for anything less than 50K. going above that I get 415 errors. any idea?
I am evaluating two object databases, db4o (http://www.db4o.com) and Eloquera Database (http://eloquera.com) for a coming project. I have to choose one. My basic requirement is scalability, multi user support and easy type evolution for RAD.
Please share your real world experience.
If you have both, can you compare these two? Which do you prefer?
i need to know how to pass everything after the .php part in this link
"http://wreckedclothing.net/help/[email protected]&t=985559"
to a iframe on the same page. "hosted on the same site"
like this
"<iframe>
src="http://www.wreckedclothing.net/[email protected]&t=985559"
frameborder="0"
width="829"
name="tree"></iframe>
see how it adds everything to the link in src
whenever i needed to test my web site, i used to press ctrl and f5.
i recently installed installed iis service.
kept an html page accessed it from host
kept an fully developed default.aspx page in the www directory
tried to access gave error of XML something....
that means i can only use HTML pages,
?
so what to do if i am using c# asp.net?
The question says it all: is it coke-ah, co-co, co-co-ah or something else entirely?
I've read articles claiming different pronunciations, although there seems to be some consensus towards co-co (e.g. http://www.cocoacrumbs.com/blog/?p=5) Any definitive references that will answer the question for sure?
Ive managed to get asp.net mvc up and running on an iis6 server, but I keep getting silly messages like 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial'
I've got all the required dlls and even installed mvc from
http://www.microsoft.com/downloads/details.aspx?FamilyID=c9ba1fe1-3ba8-439a-9e21-def90a8615a9&displaylang=en
any clues about what Im missing?
Cheers
Hi all
I developing a Ipad application I am trying to use Webview but not able to open the URL in webview I am using following code
NSURL *fileURL = [[[NSURL alloc] initWithString:@"http://www.google.com/"] autorelease];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:fileURL];
[webview loadRequest:requestObj];
this code working well for Iphone app not not working for Ipad app. Is anything wrong.
Thanks Amit Battan
I have a browser in my application that is developed using standard Web Browser control in .Net compact framework. Getting UriFormatExceptions while navigating to some sites eg: WWW.oosai.com. I tried to catch that exception but din workout. Is their any way to catch and handle all the Web Browser related exceptions
Hey everyone. This question is about the number 169716931325235658326303.
According to http://www.alpertron.com.ar/ECM.HTM it is prime.
According to my miller-rabin implementation in python with 7 repetitions is is composite. With 50 repetitions it is still composite. With 5000 repetitions it is STILL composite.
I thought, this might be a problem of my implementation. So I tried GNU MP bignum library, which has a miller-rabin primality test built-in. I tested with 1000000 repetitions. Still composite.
This is my implementation of the miller-rabin primality test:
def isprime(n, precision=7):
if n == 1 or n % 2 == 0:
return False
elif n < 1:
raise ValueError("Out of bounds, first argument must be > 0")
d = n - 1
s = 0
while d % 2 == 0:
d //= 2
s += 1
for repeat in range(precision):
a = random.randrange(2, n - 2)
x = pow(a, d, n)
if x == 1 or x == n - 1: continue
for r in range(s - 1):
x = pow(x, 2, n)
if x == 1: return False
if x == n - 1: break
else: return False
return True
And the code for the GMP test:
#include <gmp.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
mpz_t test;
mpz_init_set_str(test, "169716931325235658326303", 10);
printf("%d\n", mpz_probab_prime_p(test, 1000000));
mpz_clear(test);
return 0;
}
As far as I know there are no "exceptions" (which return false positives for any amount of repetitions) to the miller-rabin primality test. Have I stumpled upon one? Is my computer broken? Is the Elliptic Curve Method wrong? What is happening here?
EDIT
I found the issue, which is http://www.alpertron.com.ar/ECM.HTM. I trusted this applet, I'll contact the author his applet's implementation of the ECM is faulty for this number. Thanks.
EDIT2
Hah, the shame! In the end it was something that went wrong with copy/pasting on my side. NOR the applet NOR the miller-rabin algorithm NOR my implementation NOR gmp's implementation of it is wrong, the only thing that's wrong is me. I'm sorry.