Search Results

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

Page 87/269 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • Uncommitted reads in SSIS

    - by OldBoy
    I'm trying to debug some legacy Integration Services code, and really want some confirmation on what I think the problem is: We have a very large data task inside a control flow container. This control flow container is set up with TransactionOption = supported - i.e. it will 'inherit' transactions from parent containers, but none are set up here. Inside the data flow there is a call to a stored proc that writes to a table with pseudo code something like: "If a record doesn't exist that matches these parameters then write it" Now, the issue is that there are three records being passed into this proc all with the same parameters, so logically the first record doesn't find a match and a record is created. The second record (with the same parameters) also doesn't find a match and another record is created. My understanding is that the first 'record' passed to the proc in the dataflow is uncommitted and therefore can't be 'read' by the second call. The upshot being that all three records create a row, when logically only the first should. In this scenario am I right in thinking that it is the uncommitted transaction that stops the second call from seeing the first? Even setting the isolation level on the container doesn't help because it's not being wrapped in a transaction anyway.... Hope that makes sense, and any advice gratefully received. Work-arounds confer god-like status on you.

    Read the article

  • Why this C# Regular Expression crashes my program?

    - by robert_d
    using System; using System.IO; using System.Net; using System.Text.RegularExpressions; namespace Working { class Program4 { static string errorurl = "http://www.realtor.ca/propertyDetails.aspx?propertyId=8692663"; static void Main(string[] args) { string s; s = getWebpageContent(errorurl); s = removeNewLineCharacters(s); getFields(s); Console.WriteLine("End"); } public static void getFields(string html) { Match m; string fsRE = @"ismeasurement.*?>.*?(\d+).*?sqft"; m = Regex.Match(html, fsRE, RegexOptions.IgnoreCase); } private static string removeNewLineCharacters(string str) { string[] charsToRemove = new string[] { "\n", "\r" }; foreach (string c in charsToRemove) { str = str.Replace(c, ""); } return str; } static string getWebpageContent(string url) { WebClient client = new WebClient(); client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); Stream data = client.OpenRead(url); StreamReader reader = new StreamReader(data); string s = reader.ReadToEnd(); data.Close(); reader.Close(); return s; } } } This program hangs. It runs correctly when I remove RegexOptions.IgnoreCase option or when I remove call to removeNewLineCharacters() function. Could someone tell me what is going on, please?

    Read the article

  • Is there a better way to change user password in cakephp using Auth?

    - by sipiatti
    Hi, I am learning cakephp by myself. I tried to create a user controller with a changepassword function. It works, but I am not sure if this is the best way, and I could not googled up useful tutorials on this. Here is my code: class UsersController extends AppController { var $name = 'Users'; function login() { } function logout() { $this->redirect($this->Auth->logout()); } function changepassword() { $session=$this->Session->read(); $id=$session['Auth']['User']['id']; $user=$this->User->find('first',array('conditions' => array('id' => $id))); $this->set('user',$user); if (!empty($this->data)) { if ($this->Auth->password($this->data['User']['password'])==$user['User']['password']) { if ($this->data['User']['passwordn']==$this->data['User']['password2']) { // Passwords match, continue processing $data=$this->data; $this->data=$user; $this->data['User']['password']=$this->Auth->password($data['User']['passwordn']); $this->User->id=$id; $this->User->save($this->data); $this->Session->setFlash('Password changed.'); $this->redirect(array('controller'=>'Toners','action' => 'index')); } else { $this->Session->setFlash('New passwords differ.'); } } else { $this->Session->setFlash('Typed passwords did not match.'); } } } } password is the old password, passwordn is the new one, password2 is the new one retyped. Is there any other, more coomon way to do it in cake?

    Read the article

  • How to implement a collection (list, map?) of complicated strings in Java?

    - by Alex Cheng
    Hi all. I'm new here. Problem -- I have something like the following entries, 1000 of them: args1=msg args2=flow args3=content args4=depth args6=within ==> args5=content args1=msg args2=flow args3=content args4=depth args6=within args7=distance ==> args5=content args1=msg args2=flow args3=content args6=within ==> args5=content args1=msg args2=flow args3=content args6=within args7=distance ==> args5=content args1=msg args2=flow args3=flow ==> args4=flowbits args1=msg args2=flow args3=flow args5=content ==> args4=flowbits args1=msg args2=flow args3=flow args6=depth ==> args4=flowbits args1=msg args2=flow args3=flow args6=depth ==> args5=content args1=msg args2=flow args4=depth ==> args3=content args1=msg args2=flow args4=depth args5=content ==> args3=content args1=msg args2=flow args4=depth args5=content args6=within ==> args3=content args1=msg args2=flow args4=depth args5=content args6=within args7=distance ==> args3=content I'm doing some sort of suggestion method. Say, args1=msg args2=flow args3=flow == args4=flowbits If the sentence contains msg, flow, and another flow, then I should return the suggestion of flowbits. How can I go around doing it? I know I should scan (whenever a character is pressed on the textarea) a list or array for a match and return the result, but, 1000 entries, how should I implement it? I'm thinking of HashMap, but can I do something like this? <"msg,flow,flow","flowbits" Also, in a sentence the arguments might not be in order, so assuming that it's flow,flow,msg then I can't match anything in the HashMap as the key is "msg,flow,flow". What should I do in this case? Please help. Thanks a million!

    Read the article

  • Basic question in XSL regarding preceding text

    - by Rachel
    I am new to XSL and i have a basic question on the context of using preceding text. My template match is on the text node. I am iterating over an xml file and within my for loop i am trying to take the preceding text of the text node. Unfortunately preceding::text() is not working if i use it within a for loop. I want to use it within the for loop but how can do it? <xsl:template match="text()"> <xsl:variable name="this" as="text()" select="."/> <xsl:for-each select="$input[@id = generate-id(current())]"> <xsl:variable name="preText" as="xsd:integer" select="sum(preceding::text()[. >> //*[@id=@name]]/string-length(.))"/> ... ... </xsl:for-each> </xsl:template>

    Read the article

  • How to capture strings using * or ? with groups in python regular expressions

    - by user1334085
    When the regular expression has a capturing group followed by "*" or "?", there is no value captured. Instead if you use "+" for the same string, you can see the capture. I need to be able to capture the same value using "?" >>> str1='This string has 29 characters' >>> re.search(r'(\d+)*', str1).group(0) '' >>> re.search(r'(\d+)*', str1).group(1) >>> >>> re.search(r'(\d+)+', str1).group(0) '29' >>> re.search(r'(\d+)+', str1).group(1) '29' More specific question is added below for clarity: I have str1 and str2 below, and I want to use just one regexp which will match both. In case of str1, I also want to be able to capture the number of QSFP ports >>> str1='''4 48 48-port and 6 QSFP 10GigE Linecard 7548S-LC''' >>> str2='''4 48 48-port 10GigE Linecard 7548S-LC''' >>> When I do not use a metacharacter, the capture works: >>> re.search(r'^4\s+48\s+.*(?:(\d+)\s+QSFP).*-LC', str1, re.I|re.M).group(1) '6' >>> It works even when I use the "+" to indicate one occurrence: >>> re.search(r'^4\s+48\s+.*(?:(\d+)\s+QSFP)+.*-LC', str1, re.I|re.M).group(1) '6' >>> But when I use "?" to match for 0 or 1 occurrence, the capture fails even for str1: >>> re.search(r'^4\s+48\s+.*(?:(\d+)\s+QSFP)?.*-LC', str1, re.I|re.M).group(1) >>>

    Read the article

  • Namespaced controller redirect urls

    - by bajki
    Hello, i have probably a simple question. I have created a namespace panel with categories controller. After creating or editing a category, rails redirects me to website.com/categories/:id instead of website.com/panel/categories/:id. I've noticed that in the _form view, the @panel_categories argument of form_for() function points to /categories nor /panel/categories and that's causing this behaviour. Offcourse i can add a :url => '/panel/categories' param but i feel that it's not the best solution... Can you provide me any better solution? Thanks in advance Files: routes.rb: Photowall::Application.routes.draw do resources :photos resources :categories resources :fields resources :users, :user_sessions match 'login' => 'user_sessions#new', :as => :login match 'logout' => 'user_sessions#destroy', :as => :logout namespace :panel do root :to => "photos#index" resources :users, :photos, :categories, :fields end namespace :admin do root :to => "users#index" resources :users, :photos, :categories, :fields end end categories_controller.rb: http://pastebin.com/rWJykCCF model is the default one form: http://pastebin.com/HGmkZZHM

    Read the article

  • Filtering a select list via input box & jquery

    - by zSysop
    Hi all, I was wondering if i could get some help with filtering a select list using an input box via jquery. Here's what my js looks like, but it doesnt seem to work. I'm guessing this is because options within a select list are not hide-able. <script type="text/javascript"> $(document).ready(function() { $("#inputFilter").change(function() { var filter = $(this).val(); $("#selectList option").each(function() { var match = $(this).text().search(new RegExp(filter, "i")); if (match > 0) { $(this).show(); // Does not work } else $(this).hide(); }); }); }); </script> and here's my html <input id="inputFilter" /> <select id="selectList"> <option value="1111" text="1111 - London" /> <option value="1112" text="1111 - Paris" /> </select>

    Read the article

  • Parsing CSS by regex

    - by Ross
    I'm creating a CSS editor and am trying to create a regular expression that can get data from a CSS document. This regex works if I have one property but I can't get it to work for all properties. I'm using preg/perl syntax in PHP. Regex (?<selector>[A-Za-z]+[\s]*)[\s]*{[\s]*((?<properties>[A-Za-z0-9-_]+)[\s]*:[\s]*(?<values>[A-Za-z0-9#, ]+);[\s]*)*[\s]*} Test case body { background: #f00; font: 12px Arial; } Expected Outcome Array( [0] => Array( [0] => body { background: #f00; font: 12px Arial; } [selector] => Array( [0] => body ) [1] => Array( [0] => body ) [2] => font: 12px Arial; [properties] => Array( [0] => font ) [3] => Array( [0] => font ) [values] => Array( [0] => 12px Arial [1] => background: #f00 ) [4] => Array( [0] => 12px Arial [1] => background: #f00 ) ) ) Real Outcome Array( [0] => Array ( [0] => body { background: #f00; font: 12px Arial; } [selector] => body [1] => body [2] => font: 12px Arial; [properties] => font [3] => font [values] => 12px Arial [4] => 12px Arial ) ) Thanks in advance for any help - this has been confusing me all afternoon!

    Read the article

  • Adding up fractions in PHP

    - by Gamemorize
    I would like to create a loop that keeps adding a set fraction, here in my example 1/3, and which later I can check against for matches with integer values. Obviously when php adds 1/3 + 1/3 + 1/3 the result is 0.9999999, so i thought I could use the occasional round to help me, but this isn't working either. The idea that I had would be that .333 + .333 becomes .666 and that if rounded that would become .667, then + .333 and the result is 1. However round only seems to work, for me, if the number of digits actually decreases. so round (0.666, 3) remains 0.666 <?php $denom = 3; $frac = 1/$denom; $frac = round($frac,3); $value = 0; $max =24; for($f = 1; $f <= $max; $f++){ echo "old value is now at ".$value.".<br/>"; $value = $value+$frac; echo "value is now at ".$value.".<br/>"; $value = round($value,3); echo "rounded value is now at ".$value.".<br/>"; $valueArray[$f] = $value; //and here for ease of testing.... if (($value==1)OR ($value==2)OR ($value==3)OR ($value==4)OR ($value==5)OR ($value==6)OR ($value==7)OR ($value==8)){ echo "match!<br/>"; }else{ echo "no match!<br/>"; } } ?> Am I going about this in a totally stupid way? Accuracy when the value is not an integer is not needed, just that it can == with integers.

    Read the article

  • Applying a function to a custom type in F#

    - by Frederik Wordenskjold
    On my journey to learning F#, I've run into a problem I cant solve. I have defined a custom type: type BinTree = | Node of int * BinTree * BinTree | Empty I have made a function which takes a tree, traverses it, and adds the elements it visits to a list, and returns it: let rec inOrder tree = seq{ match tree with | Node (data, left, right) -> yield! inOrder left yield data; yield! inOrder right | Empty -> () } |> Seq.to_list; Now I want to create a function, similar to this, which takes a tree and a function, traverses it and applies a function to each node, then returns the tree: mapInOrder : ('a -> 'b) -> 'a BinTree -> 'b BinTree This seems easy, and it probably is! But I'm not sure how to return the tree. I've tried this: let rec mapInOrder f tree = match tree with | Node(data, left, right) -> mapInOrder f left Node(f(data), left, right) mapInOrder f right | Empty -> () but this returns a unit. I havent worked with custom types before, so I'm probably missing something there!

    Read the article

  • Recoverable error while running XSL

    - by Kate
    XSL: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" exclude-result-prefixes="wp wne w10 w ve o r m v" version="2.0"> <xsl:output method="text"/> <xsl:param name="styleName"/> <xsl:template match="w:p"> <xsl:apply-templates/><xsl:text>&#10;</xsl:text> </xsl:template> <xsl:template match="w:r[not ((parent::w:hyperlink[@w:anchor[matches(.,concat('^(',$styleName,')')),'i']]))]"> <xsl:value-of select="replace(., '.', '&#xFF00;')"/> </xsl:template> </xsl:stylesheet> While processing the above XSL, I am getting the below error, Recoverable Error: Recoverable error on line 11 FORG0006: An error occurred matching pattern {w:r[not ((parent::w:hyperlink[@w:anchor[matches(.,concat('^(',$styleName,')')),'i']]))]}: Effective boolean value is not defined for a sequence of two or more items starting with a boolean Please Help. I am not able to figure out this.

    Read the article

  • Visual SourceSafe (VSS): "Access to file (filename) denied" error

    - by tk-421
    Hi, can anybody help with the above SourceSafe error? I've spent hours trying to find a fix. I've also Googled the heck out of it but couldn't find a scenario matching mine, because in my case only a few files (not all) are affected. Here's what I found: only a few files in my project generate this error other files in the same directory (for example, App_Code has one of the problem files) work fine I've tried checking out from both the VSS client and Visual Studio another developer can check out the main problem file without any problems This sounds like a permission issue for my user, right? However: I found the location of one of the problem files in VSS's data directory (using VSS's naming format, as in 'fddaaaaa.a') and checked its permissions; everything looks fine and its permissions match those of other files I can check out successfully I can see no differences in the file properties between working and non-working files What else can I check? Has anyone encountered this problem before and found a solution? Thanks. P.S.: SourceGear, svn or git are not options, unfortunately. P.P.S.: Tried unsuccessfully to add tag "sourcesafe." EDIT: Hey Paddy, I tried to click 'add comment' to respond to your comment, but I'm getting a javascript error when loading this page in IE8 ("jquery undefined," etc.) so this isn't working. This is when checking out files, and yes, I've obliterated my local copy more times than I can remember. ;) EDIT 2: Thanks for the responses, guys (again I can't 'add comment' due to jQuery not loading, maybe blocked as discussed in Meta). If the problem was caused by antivirus or a bad disk, would other users still be able to check out the file(s)? That's the case here, which makes me think it's a permission issue specific to my account. However I've looked at the permissions and they match both other users' settings and settings on other files which I can check out.

    Read the article

  • Help with a loop to return UIImage from possible matches

    - by Canada Dev
    I am parsing a list of locations and would like to return a UIImage with a flag based on these locations. I have a string with the location. This can be many different locations and I would like to search this string for possible matches in an NSArray, and when there's a match, it should find the appropriate filename in an NSDictionary. Here's an example of the NSDictionary and NSArray: NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"franceFlag", @"france", @"greeceFlag", @"greece", @"spainFlag", @"spain", @"norwayFlag", @"norway", nil]; NSArray *array = [NSArray arrayWithObjects: @"france" @"greece" @"spain" @"portugal" @"ireland" @"norway", nil]; Obviously I'll have a lot more countries and flags in both. Here's what I have got to so far: -(UIImage *)flagFromOrigin:(NSString *)locationString { NSRange range; for (NSString *arrayString in countryArray) { range = [locationString rangeOfString:arrayString]; if (range.location != NSNotFound) { return [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[dictionary objectForKey: arrayString] ofType:@"png"]]; } } return nil; } Now, the above doesn't actually work. I am missing something (and perhaps not even doing it right in the first place) The issue is, the locationString could have several locations in the same country, described something like this "Barcelona, Spain", "Madrid, Spain", "North Spain", etc., but I just want to retrieve "Spain" in this case. (Also, notice caps for each country). Basically, I want to search the locationString I pass into the method for a possible match with one of the countries listed in the NSArray. If/When one is found, it should continue into the NSDictionary and grab the appropriate flag based on the correct matched string from the array. I believe the best way would then to take the string from the array, as this would be a stripped-out version of the location. Any help to point me in the right direction for the last bit is greatly appreciated.

    Read the article

  • compact XSLT code to drop N number of tags if all are null.

    - by infant programmer
    This is my input xml: <root> <node1/> <node2/> <node3/> <node4/> <othertags/> </root> The output must be: <root> <othertags/> </root> if any of the 4 nodes isn't null then none of the tags must be dropped. example: <root> <node1/> <node2/> <node3/> <node4>sample_text</node4> <othertags/> </root> Then the output must be same as input xml. <root> <node1/> <node2/> <node3/> <node4>sample_text</node4> <othertags/> </root> This is the XSL code I have designed :: <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="/root/node1[.='' and ../node2/.='' and ../node3/.='' and ../node4/.=''] |/root/node2[.='' and ../node1/.='' and ../node3/.='' and ../node4/.=''] |/root/node3[.='' and ../node1/.='' and ../node2/.='' and ../node4/.=''] |/root/node4[.='' and ../node1/.='' and ../node2/.='' and ../node3/.='']"/> As you can see the code requires more effort and becomes more bulky as the number of nodes increase. Is there any alternative way to overcome this bottleneck?

    Read the article

  • std::map keys in C++

    - by Soumava
    I have a requirement to create two different maps in C++. The Key is of type CHAR * and the Value is a pointer to a struct. I am filling 2 maps with these pairs, in separate iterations. After creating both maps I need find all such instances in which the value of the string referenced by the CHAR * are same. For this i am using the following code : typedef struct _STRUCTTYPE { .. } STRUCTTYPE, *PSTRUCTTYPE; typedef pair {CHAR *,PSTRUCTTYPE} kvpair; .. CHAR *xyz; PSTRUCTTYPE abc; after filling the information; Map.insert (kvpair(xyz,abc)); the above is repeated x times for the first map, and y times for the second map. after both are filled out; std::map {CHAR *, PSTRUCTTYPE} :: iterator Iter,findIter; for (Iter=iteratedMap-begin();Iter!=iteratedMap-end();mapIterator++) { char *key = Iter-first; printf("%s\n",key); findIter=otherMap-find(key); //printf("%u",findIter-second); if (findIter!=otherMap-end()) { printf("Match!\n"); } } The above code does not show any match, although the list of keys in both maps show obvious matches. My understanding is that the equals operator for CHAR * just equates the memory address of the pointers. My question is, what should i do to alter the equals operator for this type of key or could I use a different datatype for the string? *note : {} has been used instead of angle brackets as the content inside angle brackets was not showing up in the post.

    Read the article

  • Update table using SSIS

    - by thursdaysgeek
    I am trying to update a field in a table with data from another table, based on a common key. If it were in straight SQL, it would be something like: Update EHSIT set e.IDMSObjID = s.IDMSObjID from EHSIT e, EHSIDMS s where e.SITENUM = s.SITE_CODE However, the two tables are not in the same database, so I'm trying to use SSIS to do the update. Oh, and the sitenum/site_code are varchar in one and nvarchar in the other, so I'll have to do a data conversion so they'll match. How do I do it? I have a data flow object, with the source as EHSIDMS and the destination as EHSIT. I have a data conversion to convert the unicode to non-unicode. But how do I update based on the match? I've tried with the destination, using a SQL Command as the Data Access mode, but it doesn't appear to have the source table. If I just map the field to be updated, how does it limit it based on fields matching? I'm about to export my source table to Excel or something, and then try inputting from there, although it seems that all that would get me would be to remove the data conversion step. Shouldn't there be an update data task or something? Is it one of those Data Flow transformation tasks, and I'm just not figuring out which it is?

    Read the article

  • C# comparing two files regex problem.

    - by Mike
    Hi everyone, what I'm trying to do is open a huge list of files (about 40k records, and match them on a line in a file that contains 2 millions records. And if my line from file A matches a line in file B write out that line. File A contains a bunch of files without extensions and file B contains full file paths including extensions. i'm using this but i cant get it to go... string alphaFilePath = (@"C:\Documents and Settings\g\Desktop\Arrp\Find\natst_ready.txt"); List<string> alphaFileContent = new List<string>(); using (FileStream fs = new FileStream(alphaFilePath, FileMode.Open)) using (StreamReader rdr = new StreamReader(fs)) { while (!rdr.EndOfStream) { alphaFileContent.Add(rdr.ReadLine()); } } string betaFilePath = @"C:\Documents and Settings\g\Desktop\Arryup\Find\eble.txt"; StringBuilder sb = new StringBuilder(); using (FileStream fs = new FileStream(betaFilePath, FileMode.Open)) using (StreamReader rdr = new StreamReader(fs)) { while (!rdr.EndOfStream) { string betaFileLine = rdr.ReadLine(); string matchup = Regex.Match(alphaFileContent, @"(\\)(\\)(\\)(\\)(\\)(\\)(\\)(\\)(.*)(\.)").Groups[9].Value; if (alphaFileContent.Equals(matchup)) { File.AppendAllText(@"C:\array_tech.txt", betaFileLine); } } } This doesnt work because the alphafilecontent is a single line only and i'm having a hard time figuring out how to get my regex to work on the file that contains all the file paths (Betafilepath) here is a sample of the beta file path. C:\arres_i\Grn\Ora\SEC\DBZ_EX1\Nes\001\DZO-EX00001.txt Here is the line i'm trying to compare from my alpha DZO-EX00001

    Read the article

  • Named captured substring in pcre++

    - by VDVLeon
    Hello, I want to capture named substring with the pcre++ library. I know the pcre library has the functionality for this, but pcre++ has not implemented this. This is was I have now (just a simple example): pcrepp::Pcre regex("test (?P<groupName>bla)"); if (regex.search("test bla")) { // Get matched group by name int pos = pcre_get_stringnumber( regex.get_pcre(), "groupName" ); if (pos == PCRE_ERROR_NOSUBSTRING) return; // Get match std::string temp = regex[pos - 1]; std::cout << "temp: " << temp << "\n"; } If I debug, pos return 1, and that is right, (?Pbla) is the 1th submatch (0 is the whole match). It should be ok. But... regex.matches() return 0. Why is that :S ? Btw. I do regex[pos - 1] because pcre++ reindexes the result with 0 pointing to the first submatch, so 1. So 1 becomes 0, 2 becomes 1, 3 becomes 2, etc. Does anybody know how to fix this?

    Read the article

  • Cross-Application User Authentication

    - by Chris Lieb
    We have a webapp written in .NET that uses NTLM for SSO. We are writing a new webapp in Java that will tightly integrate with the original application. Unfortunately, Java has no support for performing the server portion of NTLM authentication and the only library that I can find requires too much setup to be allowed by IT. To work around this, I came up with a remote authentication scheme to work across applications and would like your opinions on it. It does not need to be extremely secure, but at the same time not easily be broken. User is authenticated into .NET application using NTLM User clicks link that leaves .NET application .NET application generates random number and stores it in the user table along with the user's full username (domain\username) Insecure token is formed as random number:username Insecure token is run through secure cipher (likely AES-256) using pre-shared key stored within the application to produce a secure token The secure token is passed as part of the query string to the Java application The Java application decrypts the secure key using the same pre-shared key stored within its own code to get the insecure token The random number and username are split apart The username is used to retrieve the user's information from the user table and the stored random number is checked against the one pulled from the insecure token If the numbers match, the username is put into the session for the user and they are now authenticated If the numbers do not match, the user is redirected to the .NET application's home page The random number is removed from the database

    Read the article

  • Replace beginning words(SQL SERVER 2005, SET BASED)

    - by Newbie
    I have the below tables. tblInput Id WordPosition Words -- ----------- ----- 1 1 Hi 1 2 How 1 3 are 1 4 you 2 1 Ok 2 2 This 2 3 is 2 4 me tblReplacement Id ReplacementWords --- ---------------- 1 Hi 2 are 3 Ok 4 This The tblInput holds the list of words while the tblReplacement hold the words that we need to search in the tblInput and if a match is found then we need to replace those. But the problem is that, we need to replace those words if any match is found at the beginning. i.e. in the tblInput, in case of ID 1, the words that will be replaced is only 'Hi' and not 'are' since before 'are', 'How' is there and it is not in the tblReplacement list. in case of Id 2, the words that will be replaced are 'Ok' & 'This'. Since these both words are present in the tblReplacement table and after the first word i.e. 'Ok' is replaced, the second word which is 'This' here comes first in the list of ID category 2 . Since it is available in the tblReplacement, and is the first word now, so this will also be replaced. So the desired output will be Id NewWordsAfterReplacement --- ------------------------ 1 How 1 are 1 you 2 is 2 me My approach so far: ;With Cte1 As( Select t1.Id ,t1.Words ,t2.ReplacementWords From tblInput t1 Cross Join tblReplacement t2) ,Cte2 As( Select Id, NewWordsAfterReplacement = REPLACE(Words,ReplacementWords,'') From Cte1) Select * from Cte2 where NewWordsAfterReplacement <> '' But I am not getting the desired output. It is replacing all the matching words. Urgent help needed*.( SET BASED )* I am using SQL SERVER 2005. Thanks

    Read the article

  • page variable in a repeater

    - by carrot_programmer_3
    Hi I'm having a bit of an issue with a asp.net repeater I'm building a categories carousel with the dynamic categories being output by a repeater. Each item is a LinkButton control that passes an argument of the category id to the onItemClick handler. a page variable is set by this handler to track what the selected category id is.... public String SelectedID { get { object o = this.ViewState["_SelectedID"]; if (o == null) return "-1"; else return (String)o; } set { this.ViewState["_SelectedID"] = value; } } problem is that i cant seem to read this value while iterating through the repeater as follows... <asp:Repeater ID="categoriesCarouselRepeater" runat="server" onitemcommand="categoriesCarouselRepeater_ItemCommand"> <ItemTemplate> <%#Convert.ToInt32(Eval("CategoryID")) == Convert.ToInt32(SelectedID) ? "<div class=\"selectedcategory\">":"<div>"%> <asp:LinkButton ID="LinkButton1" CommandName="select_category" CommandArgument='<%#Eval("CategoryID")%>' runat="server"><img src="<%#Eval("imageSource")%>" alt="category" /><br /> </div> </ItemTemplate> </asp:Repeater> calling <%=SelectedID%> in the item template works but when i try the following expression the value of SelectedID returns empty.. <%#Convert.ToInt32(Eval("CategoryID")) == Convert.ToInt32(SelectedID) ? "match" : "not a match"%> the value is being set as follows... protected void categoriesCarouselRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { SelectedID = e.CommandArgument); } Any ideas whats wrong here?

    Read the article

  • php clean up regex

    - by David
    hey can i clean up a preg_match in php from this: preg_match_all("/(".$this->reg['wat'].")?(".$this->reg['wat'].")?(".$this->reg['wat'].")?(".$this->reg['wat'].")?(".$this->reg['wat'].")?(".$this->reg['wat'].")?(".$this->reg['wat'].")?/",$value,$match); to look like this: preg_match_all("/ (".$this->reg['wat'].")? (".$this->reg['wat'].")? (".$this->reg['wat'].")? (".$this->reg['wat'].")? (".$this->reg['wat'].")? (".$this->reg['wat'].")? (".$this->reg['wat'].")? /",$value,$match); right now each space, it counts as a ling break so it wont return any finds when searching. but it just looks cleaner and easier to read is why i ask you know. i was looking for one of those letters to add after the closing "/" in the regex. thanks

    Read the article

  • Dynamic Select boxes page load

    - by Chris
    Hello, I have a dynamic chained select box that I am attempting to show the value of on a page load. In my chained select box, it will default to the first option within the select box on page load, could anyone provide assitance? I stumbled upon this thread, but I can't seem to translate what they are doing with that answer to my language of CF. Dynamic chained drop downs on page refresh Here is the JS script I am using. function dynamicSelect(id1, id2) { // Feature test to see if there is enough W3C DOM support if (document.getElementById && document.getElementsByTagName) { // Obtain references to both select boxes var sel1 = document.getElementById(id1); var sel2 = document.getElementById(id2); // Clone the dynamic select box var clone = sel2.cloneNode(true); // Obtain references to all cloned options var clonedOptions = clone.getElementsByTagName("option"); // Onload init: call a generic function to display the related options in the dynamic select box refreshDynamicSelectOptions(sel1, sel2, clonedOptions); // Onchange of the main select box: call a generic function to display the related options in the dynamic select box sel1.onchange = function() { refreshDynamicSelectOptions(sel1, sel2, clonedOptions); } } } function refreshDynamicSelectOptions(sel1, sel2, clonedOptions) { // Delete all options of the dynamic select box while (sel2.options.length) { sel2.remove(0); } // Create regular expression objects for "select" and the value of the selected option of the main select box as class names var pattern1 = /( |^)(select)( |$)/; var pattern2 = new RegExp("( |^)(" + sel1.options[sel1.selectedIndex].value + ")( |$)"); // Iterate through all cloned options for (var i = 0; i < clonedOptions.length; i++) { // If the classname of a cloned option either equals "select" or equals the value of the selected option of the main select box if (clonedOptions[i].className.match(pattern1) || clonedOptions[i].className.match(pattern2)) { // Clone the option from the hidden option pool and append it to the dynamic select box sel2.appendChild(clonedOptions[i].cloneNode(true)); } } } Thanks so much for any assistance

    Read the article

  • Panel in Windows Forms Application not clearing

    - by SwiftStriker00
    I'm working on my project: [Beer Pong Management System][1], a Windows Forms application. I am currently trying to add a whole tournament mode to it. In a nutshell, I've created a TabControl, with the first tab page with the settings and setup and the second page the brackets. There is a feature for each of the match-ups, that once there is a winner is decided, a yellow cancel button will appear in order to revert the tournament. However my issue is when i click the button the next match-up does not get removed in the series is going. See below: Image Here(not high enough rep to insert image) I have tried to set the MatchUp to null, I've tried dispose(), close(). even Parent.Controls.Remove(). Even after I switch tabs which is supposed to clear all, they still sit there when i come back. I have a feeling I might be loosing a reference or something because I can't even push new teams into them, they just sit there with their buttons. Does anyone have any tips or know of any known issues that might be causing this? Thanks. [1] _http://www.cs.rit.edu/~rmb1201/pages/code.shtml

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >