Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 105/269 | < Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >

  • Checkbox has the wrong values

    - by Praesagus
    I have a page with several checkboxes on it, along with a dropdownlist of users. The checkboxes correlate to the user's permissions so each user is different. When a different user is chosen, the check boxes should change to match that user's permissions. The codebehind is correct, I stepped through it and the checkbox.checked value is being assigned to the box with the correct value to match the user. chk.Checked = viewable; No matter what I assign to the checked property the value stays the same as the very first submittal. I tried chk.EnableViewState = false; but that did not help. I am sure it is dot net trying to be helpful (grrr). Thank you for your help. There is no databinding per se. I will be saving the values from the textboxes via xmlhttp when the user clicks on them. I never want the check boxes to fill with values other than what I give them. Here is the essence of the code. foreach (DataRow dRow in dTable.Rows) { viewable = Convert.ToBoolean(dRow["Viewable"]); table.Rows.Add(CreatePageRow(Convert.ToString(dRow["SitePageViewName"]), Convert.ToString(dRow["SitePageName"]), folderDepth, maxFolderDepth, viewable)); } FileTree.Controls.Add(table); private TableRow CreatePageRow(String ViewName, String FileName, Int32 folderDepth, Int32 maxFolderDepth, Boolean viewable) { TableRow tr = new TableRow(); tr.Cells.Add(CreateCheckboxCell(viewable, folderDepth+3)); tr.Cells.Add(CreateImageCell("/images/icon/sm/report_graph.gif", "Page: " + ViewName)); tr.Cells.Add(CreateTitleCell(ViewName, maxFolderDepth - (folderDepth+1), FileName)); return tr; } private TableCell CreateCheckboxCell(Boolean viewable, Int32 colSpan) { TableCell td = new TableCell(); if (colSpan > 1) td.ColumnSpan = colSpan; CheckBox chk = new CheckBox(); chk.Checked = viewable; chk.EnableViewState = false; td.Controls.Add(chk); td.CssClass = "right"; return td; }

    Read the article

  • Restructure XML nodes using XSLT

    - by Brian
    Looking to use XSLT to transform my XML. The sample XML is as follows: <root> <info> <firstname>Bob</firstname> <lastname>Joe</lastname> </info> <notes> <note>text1</note> <note>text2</note> </notes> <othernotes> <note>text3</note> <note>text4</note> </othernotes> I'm looking to extract all "note" elements, and have them under a parent node "notes". The result I'm looking for is as follows: <root> <info> <firstname>Bob</firstname> <lastname>Joe</lastname> </info> <notes> <note>text1</note> <note>text2</note> <note>text3</note> <note>text4</note> </notes> </root> The XSLT I attempted to use is allowing me to extract all my "note", however, I can't figure out how I can wrap them back within a "notes" node. Here's the XSLT I'm using: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:template match="notes|othernotes"> <xsl:apply-templates select="note"/> </xsl:template> <xsl:template match="*"> <xsl:copy><xsl:apply-templates/></xsl:copy> </xsl:template> </xsl:stylesheet> The result I'm getting with the above XSLT is: <root> <info> <firstname>Bob</firstname> <lastname>Joe</lastname> </info> <note>text1</note> <note>text2</note> <note>text3</note> <note>text4</note> </root> Thanks

    Read the article

  • Team matchups for Dota Bot

    - by Dan
    I have a ghost++ bot that hosts games of Dota (a warcraft 3 map that is played 5 players versus 5 players) and I'm trying to come up with good formulas to balance the players going into a match based on their records (I have game history for several thousand games). I'm familear with some of the concepts required to match up players, like confidence based on sample size of the number of games they played, and also perameter approximation and degrees of freedom and thus throwing out any variables that don't contribute enough to the r^2. My bot collects quite a few variables for each player from each game: The Important ones: Win/Lose/Game did not finish # of Player Kills # of Player Deaths # of Kills player assisted The not so important ones: # of enemy creep kills # of creep sneak attacks # of neutral creep kills # of Tower kills # of Rax kills # of courier kills Quick explination: The kills/deaths don't determine who wins, but the gold gained and lost from this usually is enough to tilt the game. Tower/Rax kills are what the goal of the game is (once a team looses all their towers/rax their thrown can be attacked if that is destroyed they lose), but I don't really count these as important because it is pretty random who gets the credit for the tower kill, and chances are if you destroy a tower it is only because some other player is doing well and distracting the otherteam elsewhere on the map. I'm getting a bit confused when trying to deal with the fact that 5 players are on a team, so ultimately each individual isn't that responsible for the team winner or losing. Take a player that is really good at killing and has 40 kills and only 10 deaths, but in their 5 games they've only won 1. Should I give him extra credit for such a high kill score despite losing? (When losing it is hard to keep a positive kill/death ratio) Or should I dock him for losing assuming that despite the nice kill/death ratio he probably plays in a really greedy way only looking out for himself and not helping the team? Ultimately I don't think I have to guess at questions like this because I have so much data... but I don't really know how to look at the data to answer questions like this. Can anyone help me come up with formulas to help team balance and predict the outcome? Thanks, Dan

    Read the article

  • Conflicting ruby versions

    - by DavidP6
    I am having problems with conflicting versions of Ruby that I have installed. I had 1.8.6 and then installed 1.8.7 and it has caused problems. I get the following error when trying to run my ruby on rails app: /usr/local/lib/ruby/1.8/i686-linux/rbconfig.rb:7: ruby lib version (1.8.6) doesn't match executable version (1.8.7) (RuntimeError) I would like to remove 1.8.7 somehow and just use 1.8.6 but have no idea how to go about doing this.

    Read the article

  • Can you do Logic Programming in Scala?

    - by Alex R
    I read somewhere that Pattern Matching like that supported by the match/case feature in Scala was actually borrowed from Logic languages like Prolog. Can you use Scala to elegantly solve problems like the Connected Graph problem? e.g. https://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_15.html

    Read the article

  • SQL Joins on varchar fields timing out

    - by CL4NCY
    Hi, I have a join which deletes rows that match another table but the joining fields have to be a large varchar (250 chars). I know this isn't ideal but I can't think of a better way. Here's my query: DELETE P FROM dbo.FeedPhotos AS P INNER JOIN dbo.ListingPhotos AS P1 ON P.photo = P1.feedImage INNER JOIN dbo.Listings AS L ON P.accountID = L.accountID WHERE P.feedID = @feedID This query is constantly timing out even though there are less than 1000 rows in the ListingPhotos table. Any help would be appreciated.

    Read the article

  • RegEx, Php, Preg_match, Phone numbers, Oh my!

    - by Kirk
    How do I find phone number of the following format and store them to a variable. It needs to match 3334445555, 333.444.5555, 333-444-5555, 333 444 5555, (333) 444 5555 and all combinations thereof. Here is the frame of it $regex = expression; if (preg_match ('/$regex/', matches)) { $phone = matches[1]; }

    Read the article

  • vbscript multiple replace regex

    - by George
    How do you match more than one pattern in vbscript? Set regEx = New RegExp regEx.Pattern = "[?&]cat=[\w-]+" & "[?&]subcat=[\w-]+" // tried this regEx.Pattern = "([?&]cat=[\w-]+)([?&]subcat=[\w-]+)" // and this param = regEx.Replace(param, "") I want to replace any parameter called cat or subcat in a string called param with nothing. For instance string?cat=meow&subcat=purr or string?cat=meow&dog=bark&subcat=purr I would want to remove cat=meow and subcat=purr from each string.

    Read the article

  • How to convert a string into a Point?

    - by NateD
    I have a list of strings of the format "x,y". I would like to make them all into Points. The best Point constructor I can find takes two ints. What is the best way in C# to turn "14,42" into new Point(14,42);? I know the Regex for doing that is /(\d+),(\d+)/, but I'm having a hard time turning those two match groups into ints in C#.

    Read the article

  • Finding duplicate files by content across multiple directories

    - by gagneet
    I have downloaded some files from the internet related to a particular topic. Now I wish to check if the files have any duplicates. The issue is that the names of the files would be different, but the content may match. Is there any way to implement some code, which will iterate through the multiple folders and inform which of the files are duplicates?

    Read the article

  • Lucene.Net Keyword based case insensitive query ?

    - by Yoann. B
    Hi, I need to make a Lucene exact case insensitive keyword match query. I tried using KeywordAnalyzer but it's case sensitive ... Sample : Keyword : "Windows Server 2003" = Got Results Keyword : "windows server 2003" = No results ... Another sample (multi keywords) : Keywords : "ASP.NET, SQL Server" = Got results Keywords : "asp.net, sql server" = No results

    Read the article

  • Weird Javascript Regex Replace Backreference Behavior

    - by arshaw
    why does the following js expression: "test1 foo bar test2".replace(/foo.bar/, "$'") result in the following string? "test1 test2 test2" is the $' in the replace string some sort of control code for including everything after the match??? this behavior was screwing with me most of the day. can anyone explain this? thanks a lot ps- this is the case in all browsers i've tested

    Read the article

  • Scala compiler says unreachable code, why?

    - by taotree
    I'm new to Scala... Here's the code: def ack2(m: BigInt, n: BigInt): BigInt = { val z = BigInt(0) (m,n) match { case (z,_) => n+1 case (_,z) => ack2(m-1,1) // Compiler says unreachable code on the paren of ack2( case _ => ack2(m-1, ack2(m, n-1)) // Compiler says unreachable code on the paren of ack2( } } I'm trying to understand that... why is it giving that error?

    Read the article

  • Markdown heading regex

    - by Jorm
    I like markdowns clean "tags", put i dont want to use their huge class they got. I just want some simple tags like the heading regex but i cant find it in the file. Ive been playing around with http://gskinner.com/RegExr/ but its damn hard So I'm looking for a regex that will match '# text' and close it after a linebreak (instead of </blabla> in bbcode) Hi How you doing? Anyone got this?

    Read the article

  • String regex matching in Erlang

    - by portoalet
    How would I do regex matching in Erlang? All I know is this: f("AAPL" ++ Inputstring) - true. The lines that I need to match "AAPL,07-May-2010 15:58,21.34,21.36,21.34,21.35,525064\n" In Perl regex: ^AAPL,* (or something similar) In Erlang?

    Read the article

  • regular expression

    - by Jeeenda
    Hi I need a regular expression that'll give me something like this part ./something\", [something.sh from something like this string ("./something\", [something.sh", ["./something\", [something.sh"], [/* 37 vars */]) is that possible? I'm having real trouble making this since there's that \" escape sequence and also that ',' character, so I cannot simply use match everything instead of these characters. I'm working on unix so it's also possible to use pipeline of few greps or something like that. Thanks for advice.

    Read the article

  • Regex in Python

    - by newToProgramming
    SO, I am trying create a simple regex that matches the following string: ..."chrX:33267175-33267784 610bp TGATGTTTGGCGAGGAACTC GCAGAGTTTGAAGAGCTCGG\nTGATGTTTGGCGAGGAACTCtactattgttacacttaggaaaataatcta\natccaaaggctttgcatctgtacagaagagcgagtagatactgaaagaga\ntttgcagatccactgttttttaggcaggaagaatgctcgttaaatgcaaa\ncgctgctctggctcatgtgtttgctccgaggtataggttttgttcgactg\nacgtatcagatagtcagagtggttaccacaccgacgttgtagcagctgca\ntaataaatgactgaaagaatcatgttaggcatgcccacctaacctaactt\ngaatcatgcgaaaggggagctgttggaattcaaatagactttctggttcc\ncagcagtcggcagtaatagaatgctttcaggaagatgacagaatcaggag\naaagatgctgttttgcactatcttgatttgttacagcagccaacttattg\ngcatgatggagtgacaggaaaaacagctggcatggaaggtaggattatta\naagctattacatcattacaaatacaattagaagctggccatgacaaagca\ntatgtttgaacaagcagctgttggtagctggggtttgttgCCGAGCTCTT\nCAAACTCTGC\n"... I have created the following regex: <PRE>[.|[\n]]*</PRE>' yet it won't match the string above. Does anyone have a solution to this conundrum and perhaps a reasoning as toward why this doesn't work.

    Read the article

  • Scala giving me "illegal start of definition"

    - by Malvolio
    I'm trying to get started with Scala and cannot get out of the starting gate. A file consisting of the line package x gives me error: illegal start of definition Regardless of what x is and regardless of where I put the file (I had a theory that I had to place the file in a directory hierarchy to match the package definition, but no). I get the same error with the example code from the web site and with the REPL.

    Read the article

< Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >