|
Code Jockey posted:
No, it can't. You'd have to use VS 2008 express.
|
# ? Jul 9, 2009 17:13 |
|
|
# ? May 11, 2024 16:46 |
|
Nurbs posted:No, it can't. You'd have to use VS 2008 express. Crap, I looked it up and the site I was reading said it'd work, but it was just talking about referencing the new assemblies, not taking advantage of the new syntax and compilers what not. Fffffuck. Well, I'll grab Express and work on convincing him to get me the full thing.
|
# ? Jul 9, 2009 17:21 |
|
It's worth it. LINQ is like sex without the bodily fluids. Actually, at this point, I would really look to jump to 4.0 rather than 3.5. And the full-blown VS 2010 is in public beta and reputedly pretty solid. No real seat-time with NH, but does it specify the string or a connection string name? I think you can also provide the connection string when you initiate the session, which is probably what your code should be doing anyhow.
|
# ? Jul 9, 2009 18:00 |
|
Ok, I have narrowed down my imaging thing quite a bit (with IsaacNewtons very helpful hints), now here is my only stumbling block... I am creating 1's and 0's, and need to put these into an array of bytes, I think you can do this with some sort of <<< operator or something... So I will loop through the pixels and start adding ones and zeros to a byte, every eight bit I will add the current byte to an array, then create a new byte, something like this Create a new byte (0000 0000) Read in the pixel Add a 0 or 1 depending on the brightness( (byte now contains 1000 0000) Read next pixel Add another bit, in this case a 0 (byte now contains 1000 0000) Read next pixel Add another bit (byte now contains 1010 0000) ... etc. (byte now contains 1010 1101) Add that byte to my byte[] array and start with a new one When we reach the end of the row just add the last byte we are working with to the array (that will take care of the padding) and start with the next row Thats the last missing piece is how to create these bytes, I have everything else solved including determining the bytes per row and converting it to a hexidecimal string.
|
# ? Jul 9, 2009 18:35 |
|
Welp teach me to follow a tutorial without actually reading about what the gently caress I'm doing Thank god the table I accidentally wiped out with my NHibernate tutorial was on the development server.
|
# ? Jul 9, 2009 22:08 |
|
Anyone know of a method that will strip BR tags from the beginning of a string? I have a series of records where some of the columns have preceding break tags in XHTML format and appear as "<BR>", "<BR />", "<BR/>". I need to have the mechanism strip only from the beginning of the string and nowhere else. Anyone know if there is a regex option or something simple that is not a perf hit?
|
# ? Jul 9, 2009 22:38 |
|
Fiend posted:Anyone know of a method that will strip BR tags from the beginning of a string? I have a series of records where some of the columns have preceding break tags in XHTML format and appear as "<BR>", "<BR />", "<BR/>". I need to have the mechanism strip only from the beginning of the string and nowhere else. I suppose you could take the first x characters in each string and regex those.
|
# ? Jul 10, 2009 03:59 |
|
Ok, I figured it outcode:
|
# ? Jul 10, 2009 04:45 |
|
Fiend posted:Anyone know of a method that will strip BR tags from the beginning of a string? I have a series of records where some of the columns have preceding break tags in XHTML format and appear as "<BR>", "<BR />", "<BR/>". I need to have the mechanism strip only from the beginning of the string and nowhere else. I would probably use Regex.Replace(input, @"^<[Bb][Rr]\s?/?>", "");
|
# ? Jul 10, 2009 14:00 |
|
^^ On that same note, I'd like to pull out the "action" attribute of a form tag. I'm terrible with regular expressions and even after a bit of googling couldn't get this to work. The form tag looks like this: code:
code:
|
# ? Jul 10, 2009 16:01 |
|
mintskoal posted:Any help? code:
|
# ? Jul 10, 2009 16:06 |
|
IsaacNewton posted:
gently caress me it works! Thank you!!!!
|
# ? Jul 10, 2009 16:17 |
|
If you're trying to do HTML parsing, use HtmlAgilityPack and not a regex. It's A) a lot easier to write XPath to find what you want and B) not going to gently caress up if the HTML changes slightly.
|
# ? Jul 10, 2009 16:25 |
|
^^^This. Or, if you can guarantee it is XML, just use XElment or XmlDocument or whatever you want to pull xpath from.
|
# ? Jul 10, 2009 16:46 |
|
Free Bees posted:If you're trying to do HTML parsing, use HtmlAgilityPack and not a regex. It's A) a lot easier to write XPath to find what you want and B) not going to gently caress up if the HTML changes slightly. I can't believe I haven't seen this before. Thanks!
|
# ? Jul 10, 2009 17:38 |
|
tk posted:I would probably use Regex.Replace(input, @"^<[Bb][Rr]\s?/?>", ""); hrm.... code:
Output posted:<br><br><br /><br/> <br/><br /><br>Lorem ipsum dolor sit amet<br/> I'm not sure what is going on here, but pretty sure I know dick about regular expressions
|
# ? Jul 10, 2009 19:05 |
|
It's replacing the first <br> as indicated by the regular expression.
|
# ? Jul 10, 2009 19:59 |
|
Fiend posted:hrm.... Oh, you probably want something more like @"^(\s*<[Bb][Rr]\s?/?>)+". Also, http://www.regular-expressions.info/tutorial.html
|
# ? Jul 10, 2009 20:16 |
|
tk posted:Also, http://www.regular-expressions.info/tutorial.html This website is second only to google in # of hits per month. I write a lot of regexes and it's invaluable. Also EditPad. It makes developing the little bastards really simple, just type in a bunch of text, fire up the search, turn on highlight and you get a realtime display of how your regex will match the string(s).
|
# ? Jul 10, 2009 20:21 |
|
Check out Expresso for all your RegEx creation/checking needs. It provides a nice little logic tree that really illustrates what your regex is being interpreted to mean.
|
# ? Jul 10, 2009 20:39 |
|
I like to use http://www.nregex.com/. I've never tried out EditPad/Expresso/RegexBuddy, but I'm on different computers all day long so a website is easy for me.
|
# ? Jul 10, 2009 20:42 |
|
gibbed posted:It's replacing the first <br> as indicated by the regular expression. tk posted:Oh, you probably want something more like @"^(\s*<[Bb][Rr]\s?/?>)+". ... NOM NOM NOM NOM NOM / • • • • • •
|
# ? Jul 10, 2009 21:41 |
|
Fiend posted:It's good that you are able to explain the problem and meet me halfway with my problem and all. Thank you for bumping the thread I guess. gibbed fucked around with this message at 23:23 on Jul 10, 2009 |
# ? Jul 10, 2009 22:10 |
|
I just did some testing, the old method that used a while loop took 23 seconds to perform the replacement 1,000,000 times while the regex method took about 5. Regex is definitely something I need to become more familiar with. Thanks again tk. Yeah, I overreacted and should not have responded. Fiend fucked around with this message at 23:02 on Jul 10, 2009 |
# ? Jul 10, 2009 22:52 |
|
Fiend posted:Or maybe an answer instead of a statement that addresses the problem instead of a pompous statement to stroke your ego? Alternately, you quit being a dickhead and google "regular expressions" and try to learn something for yourself instead of waiting for someone to do it for you. At the very least accept the apology with a little bit of class.
|
# ? Jul 10, 2009 22:56 |
|
Fiend posted:Or maybe an answer instead of a statement that addresses the problem instead of a pompous statement to stroke your ego? His statement wasn't pompous, even if it wasn't all that specific. You're just being a dick.
|
# ? Jul 10, 2009 22:58 |
|
MrHyde posted:Alternately, you quit being a dickhead and google "regular expressions" and try to learn something for yourself instead of waiting for someone to do it for you. At the very least accept the apology with a little bit of class. No Safe Word posted:His statement wasn't pompous, even if it wasn't all that specific. You're just being a dick.
|
# ? Jul 10, 2009 23:04 |
|
Fiend posted:Regex is definitely something I need to become more familiar with. Man if I had a nickel for every time I or someone else uttered those words. One of the situations I often find myself in when I decide to replace some string functions with regex is that I'll come up with something based on my cheatsheets and references that "works", but then I see someone doing something similar with a regex that's five times as long and I realize they're probably catching all sorts of edge cases I'm not accounting for.
|
# ? Jul 11, 2009 18:58 |
|
WinForms TreeView help: I have very little WinForms experience so this may be dumb but I couldn't find anything in searching (it seems like the WPF TreeView is much nicer). I have a TreeView that I want to be able to filter the contents of as you type in a TextBox on the form. Besides the fact that generally iterating through it is not as easy as I'd like, what do I need to do to accomplish this so that updating the tree is done quickly? In particular, the methods on the TreeView I'm using now cause it to be redrawn/collapsed each time you type, forcing you to then expand out the nodes you want which obviously makes this functionality not nearly as nice (almost to the point of not being worth implementing). Is there a way to keep the tree expanded in whatever state it's in and just hide elements? Or do I have iterate over the whole tree, adding the elements I want to a new TreeNodeCollection, tracking their expanded state, and then use that new tree as the root of my TreeView?
|
# ? Jul 11, 2009 20:09 |
|
derelict515 posted:WinForms TreeView help: Try something like this: code:
Whompy fucked around with this message at 06:35 on Jul 12, 2009 |
# ? Jul 12, 2009 05:44 |
|
Kekekela posted:they're probably catching all sorts of edge cases I'm not accounting for. This is one of the big reasons I love regex. Properly written, they can handle all sorts of things traditional string search methods might miss.
|
# ? Jul 12, 2009 10:17 |
|
I'm having trouble with WinForms again, and the solution is probably simple. I'm creating a level editor and I have a main form where the level is displayed, along with the properties for the selected item and the level components. I want it to work so that when you want to add a new sprite to the level, a box pops up and you select the sprite to add. I've gotten this far, but my problem is telling the other form to add in the sprite, how do I get the sprite form to tell the level editor form what to do?
|
# ? Jul 12, 2009 11:43 |
|
seregrail7 posted:I'm having trouble with WinForms again, and the solution is probably simple. Your sprite dialog probably has an Ok and a Cancel button. Set their DialogResult properties to "OK" and "Cancel". Also add a public function "GetSprite()" that returns the selected sprite, if any. In your level editor, test the DialogResult you're getting from the sprite dialog. If it's "Ok", then call the GetSprite() function to get the sprite. So you don't let the sprite form tell the level form what to do. Instead, you have the level form ask the sprite form what the result was.
|
# ? Jul 12, 2009 12:35 |
|
Thanks, that works perfectly.
|
# ? Jul 12, 2009 12:43 |
|
Whompy posted:Try something like this: But there's no Visible property on TreeNodes That's what threw me off before. There's only a settable Visible property on a TreeView but the nodes themselves just have an IsVisible that's only a getter, there doesn't seem to be a way to hide nodes short of removing them entirely. But then I have to save any removed node's structure (with all it's children) somewhere and restore it to how it was every time another character changes in the textbox which seems like it's going to be doing a lot of allocating on every character entered and just generally a pain to implement.
|
# ? Jul 12, 2009 20:19 |
|
Can someone tell me if such a thing as I describe is possible? I'd like to run an application that tells me the url of every incoming request on port 80, but does not block the request from being processed by IIS. I don't want to handle the request itself; just keep a log of all requests coming in, and what's being requested. The web application I'm interested in using this with in particular is not written in asp.net, so an http module won't work.
|
# ? Jul 12, 2009 20:55 |
|
This is probably a newbie questions but I couldn't get good info online on this. I want to have a button on my VB 2008 form take a person online to a specific website but I'm not sure what code I have to put in to open the browser much less open it with the site itself. What code am I missing here?
|
# ? Jul 12, 2009 21:26 |
|
NYIslander posted:This is probably a newbie questions but I couldn't get good info online on this. string url = "http://cnn.com"; System.Diagnostics.Process.Start(url); // May be System.Diagnostics.Process.Run - I can't remember
|
# ? Jul 12, 2009 21:45 |
|
Nurbs posted:string url = "http://cnn.com"; Got 3 errors with Process.Start Error 1 'String' is a class type and cannot be used as an expression. (under string) Error 2 '.' expected. (under url) Error 3 Name 'url' is not declared. (under url on the second line)
|
# ? Jul 12, 2009 22:10 |
|
|
# ? May 11, 2024 16:46 |
|
NYIslander posted:Got 3 errors with Process.Start I wrote it in C# out of habit. For VB I believe it goes like this Dim url as string url = "http://cnn.com" System.Diagnostics.Process.Start(url)
|
# ? Jul 12, 2009 22:29 |