What the articles fails to mention is that instead of being dropped, Places has been scheduled for inclusion in Firefox 3 for which will begin developing later this year.
Graham Nimbley
Posts
-
'Places' dropped from Firefox 2 -
Asterisk width in cssYou are right in saying that * is reserved, but not for autosizing. It used to select all elements in the current DOM. E.g.
div * { }
will apply styling to all descendant (i.e. children of children, etc) elements of div elements Graham -
The IS operatorUtini wrote:
why if (control == TextBox) generates an error - can anyone illuminate me?
Because it's suppose to be:
control.GetType()==typeof(TextBox)
-
Regular Expression to convert from PHP to C#That's okay. That's my alotment of regexs used up for the night! :cool:
-
Regular Expression to convert from PHP to C#They both do the same job. The first it a straight substitution, the second a regex. The first would be marginally faster to perform. Have you read my edit on the harder solution?
-
Regular Expression to convert from PHP to C#The easy way would be to treat the opening and closing tags independently of each other.
using System;
using System.Text.RegularExpressions;public class Testy
{
public static void Main()
{
string input="This is a [color=red]red sentence with [color=blue]some blue[/color] words[/color].";// Replace open color tag input=Regex.Replace(input,@"\\\[color=(\[^\\\]\]\*?)\\\]","<color=$1>"); // Replace close color tag input=Regex.Replace(input,@"\\\[/color\\\]","</color>"); Console.WriteLine(input); }
}
The hard way would involve some complex regexs. Will try to come up with something. Graham. [Edit] Hmmm. It appears that this might be pretty difficult. The problem is that regexs by definition match up by looking forward. To look for nested tags, requires searching the text in tree-wise fashion. To do this in linear text requires requires bilaterial searching, looking forward from the left at the same time looking backwards from the right. Problem is that regexes are virtually impossible to do proper backwards searching. It may be possible to achieve the same effect with some creative code along side regexs. -- modified at 19:13 Monday 26th June, 2006
-
Regular Expression to convert from PHP to C#string regex=@"\[color=([^\]]*?)\](.*?)\[/color\]";
string replace=@"<color=$1>$2</color>";string output=Regex.Replace(input,regex,replace);
If you are intending to place bbcode for a certain number of tags, it might be easier to use a generic regex. -- modified at 17:58 Monday 26th June, 2006
-
Free open source Rich Text Editor -
Regular Expression to convert from PHP to C#Hi
using System;
using System.Text.RegularExpressions;public class Testy
{
public static void Main()
{
string input="This is a [color=red]red[/color] color and this is a [color=blue]blue[/color] color.";
string regex=@"\[color=[^\]]*?\](.*?)\[/color\]";string output=Regex.Replace(input,regex,"$1"); Console.WriteLine(output); }
}
There was a couple of things wrong with the regex. The original was greedy, and is now lazy. Also some escaping of ']' and '[' was needed. Graham -- modified at 14:41 Monday 26th June, 2006
-
Regular Expression to convert from PHP to C#Good to know. :) Regexs are good fun, but can be a pain in the a**e sometimes!! :rolleyes:
-
Regular Expression to convert from PHP to C#This should be it.
string regex=@"(.+)\#(.+)\r\n";
string replace=String.Format("{0}$1{1}$2{2}\r\n","Left","Center","Right");string output=Regex.Replace(input,regex,replace);
I've tweaked the regex as I was having problem with it. I've dumped the code I used to test it:
using System;
using System.Text.RegularExpressions;public class Testy
{
public static void Main()
{string input="bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.\r\n\r\n"+
"toto toto toto # toto toto toto\r\n"+
"toto toto toto # toto toto toto\r\n"+
"toto toto toto # toto toto toto\r\n"+
"toto toto toto # toto toto toto\r\n\r\n"+
"bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla";string regex=@"(.+)\\#(.+)\\r\\n"; string replace=String.Format("{0}$1{1}$2{2}\\r\\n","Left","Center","Right"); string output=Regex.Replace(input,regex,replace); Console.WriteLine(output); }
}
-
Bit of design advice needed:confused: Seems a strange move to me. For me, state and zip code are easily represented by string. And creating a wrapper for a primitive type is useless as at some point you will need to interact with the primitive type (in some manner). Classes can't be created without use the
new
keyword. (Although you can do with reflection) -- modified at 16:22 Sunday 25th June, 2006 -
bug in HScrollBar control objectThis is quoted from MSDN: The value of a scroll bar cannot reach its maximum value through user interaction at run time. The maximum value that can be reached is equal to the Maximum property value minus the LargeChange property value plus 1. The maximum value can only be reached programmatically. So in your case LargeChange=10. You could get round this by adding LargeChange to Maximum; -- modified at 16:12 Sunday 25th June, 2006
-
picture box - help!!Hi, I can't see anything wrong with the code above. What control is
picture
? I'm assuming it's a panel or something. Might be handy to post the code used to gain the list of files. -
How is Embedding (.swf) in web pages?What are you wanting to do? Embed the swf in the webpage or download the swf? If you want to embed the swf, just use the standard object/embed tags. http://www.alistapart.com/articles/flashsatay/[^] details a method embedding swf using XHTML Strict. If you are trying to download the swf, then will you need to change the mime-type of the swf to application/octet-stream
<%@ Page Language="VB" %>
Sub Page_Load(sender as Object,e as EventArgs)Dim fileName as String="/test.swf"; Response.ContentType="application/octet-stream" Response.AddHeader("Content-Disposition","filename="&fileName) Response.WriteFile(Server.MapPath(fileName)) End Sub
-
Regular Expression to convert from PHP to C#string regex=@"[\r\n]{1,2}(.+)\#(.*)[\r\n]{1,2}";
string replace=String.Format("{0}\\1{1}\\2{2}\r",myRightVar,myCenterVar,myLeftVar);string output=Regex.Replace(input,regex,replace);
Haven't got VS in front of me, but this (hopefully) should work. Graham. -- modified at 15:34 Sunday 25th June, 2006
-
for xml guideIf you just want a general introduction into XML and it's related technologies check out W3Schools.com[^]
-
Is there any way to display a linked text?Yes, the control handles the user interaction of the hyperlink for you and renders the text and link both at the same time. It will even change the color of the hyperlink when visited (akin to IE/Firefox and other browsers). Just locate the control as the position you require using
.Location
-
How can I check if a specific registry entry exists?How about this. Will check to see if registry key exists.
using Microsoft.Win32;
...
string keyName=...;
string valueName=...;
object defaultValue=...;object o=Registry.GetValue(keyName,valueName,defaultValue);
if (o!=null) {
// Key does not exist
}
else {
// Do something with key
} -
Problems in converting colorsJust adding on to what Christian has answered: This should work. (I hope!)
Color c=Color.FromArgb(int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber));
[Edit] Yay! It works! :-D -- modified at 18:57 Sunday 18th June, 2006