Can JavaScript see the target name of a window that was opened by a regular "href". Here is an example:
<a href="http://www.cnn.com" target="_blanknewWindow" name="NewWindowName">
How can I go to an anchor tag on the page when the myDropDownList_SelectedIndexChanged() event fires?
I am using regular ASP.NET Forms.
Update: The following is valid for an ASP.NET Button. I would like to achieve the same functionality (going to #someAnchor) when I select an option from the Dropdown list.
<asp:Button ID="btnSubmit" runat="server" Text="Do IT" Width="186px" PostBackUrl="#myAnchor" CausesValidation="false" />
What would be the best way to set up my routes so different types of posts have different URLs?
For example, regular posts are /posts/slug while featured posts are /featured/slug
Both link to the same controller and action /posts/view/slug.
I experimented with different ways of doing this but with little success. Currently my link params look something like the following:
array('controller' => 'posts', 'action' => 'view', 'featured' ,$post['Post']['slug'])
First, I can assume that all urls that end with jpeg, jpg, bmp, png or gif are images, and others aren't.
I thought of, and tried two solutions:
Matching the regular expression .(jpe?g|bmp|png|gif)$
Using ends-with to check each separately
But, it appears that neither of these exist in XPath 1.0, or at least, they don't exist in Firefox (I am writing a greasemonkey script, so it is only important for the path to work in Firefox).
hopefully the question doesn't sound stupid, but there are lots of examples out there of achieving certain things in javascript/dom using jQuery. Using jQuery is not always an option (or even a want) which can make understanding the examples of javascript solutions written in jQuery hard.
Is there an easy way to convert jQuery code to regular javascript? I guess without having to access or understand the jQuery source code...
edit (future readers): pretend there is a logical reason why jQuery isn't available!
Hi,
How to properly construct regular expression for "grep" linux program, to find all email in, say /etc directory ?
Currently, my script is following:
grep -srhw "[[:alnum:]]*@[[:alnum:]]*" /etc
It working OK - a see some of the emails, but when i modify it, to catch the one-or-more charactes before- and after the "@" sign ...
grep -srhw "[[:alnum:]]+@[[:alnum:]]+" /etc
.. it stops working at all
Also, it does't catches emails of form "[email protected]"
Help !
I want a regular expression to check that
Password Must be contain at least 8 characters, including at least 1 number and
includes both lower and uppercase letters and special characters (e.g., #, ?, !)
Cannot be your old password or contain your username, "password", or "websitename"
And here is my validation expression which is for 8 characters including 1 uppercase letter, 1 lowercase letter, 1 number or special character.
(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$"
How I can write it for password must be 8 characters including 1 uppercase letter, 1 special character and alphanumeric characters?
Hey Everyone,
I need to search a bunch of files for anything that contains either "tblPayment" or "tblInvoice"
I also want to match any tables named "tblPaymentMethod", "tblInvoiceItem", "tblInvoicePayment"
Anybody care to help me out with how to write a regular expression for this?
Thanks again!
I'm trying to use a PreparedStatement with code similar to this:
SELECT * FROM ? WHERE name = ?
Obviously, what happens when I use setString() to set the table and name field is this:
SELECT * FROM 'my_table' WHERE name = 'whatever'
and the query doesn't work. Is there a way to set the String without quotes so the line looks like this:
SELECT * FROM my_table WHERE name = 'whatever'
or should I just give it up and use the regular Statement instead (the arguments come from another part of the system, neither of those is entered by a user)?
is it possible for me to intercept the text messages that get sent to my cellphone if i connect to my cellphone via bluetooth or USB or some other connection to my computer?
i want to create a database with all of my received text messages and be able to control my cell phone through my computer by using it to send text messages
i have a regular motorola flip phone
I am not able to validate passord with ()-=_+ , i.e it should accept these special characters but its not working when i use the regular expression as
`validates_format_of :password, :with => /^[A-Za-z0-9. ! @ # $ % ^ & * ( ) _ - + = ]*\z/`
its only excepting till * but not accepting ()-=_+ in ruby on rails.
I downloaded a webpage in my python script.
In most cases, this works fine.
However, this one had a response header: GZIP encoding, and when I tried to print the source code of this web page, it had all symbols in my putty.
How do decode this to regular text?
Not interested in any source control OR shell integration.
This is basically to make regular gets on certain third party archives. I would really prefer not to deal with SVN in any way in my shell or visual studio.
Native / C# preferred (as i have those runtimes already installed).
Anyone a recommendation under those circumstances?
I'm being an idiot.
Someone cut and pasted some text from microsoft word into my lovely html files.
I now have these unicode characters instead of regular quote symbols, (i.e. quotes appear as <92 in the text)
I want to do a regex replace but I'm having trouble selecting them.
:%s/\u92/'/g
:%s/\u5C/'/g
:%s/\x92/'/g
:%s/\x5C/'/g
...all fail. My google-fu has failed me.
i will be printing the access report. the report will not be printed a regular white people. it will be printed on top of a paper with checkboxes and fields on it. i need those checkboxes and fields to be printed on according to the access data.
are there any libraries for access that make this easier? is there a feature that will help to print on specific coordinates?
Hi All
I'm trying to extract/match data from a string using regular expression but I don't seem to get it.
I wan't to extract the highlighted characters from the following string:
/xubuntu/daily/current/lucid-alternate-**i386**.iso
This should also work in case of:
/xubuntu/daily/current/lucid-alternate-**amd64**.iso
Thanks a lot for your help.
hey guys,
a curl function returns a string $widget that contains regular html - two divs where the first div holds a table with various values inside of <td>'s.
i wonder what's the easiest and best way for me to extract only all the values inside of the <td>'s so i have blank values without the remaining html.
any idea what the pattern for the preg_match should look like?
thank you.
Hi,
i need a function (c#) or regular expression that makes me a nice URL out of a string. (and replaces invalid characters)
Something like here on stackoverflow..
example:
Short URL or long URL for SEO - short-url-or-long-url-for-seo
Thanks
Just wondering if anybody has run Scala app or web-app on Java Real-Time system?
I assume because scala is bytecode compatible with regular JVM, then it should not take much effort to run it on a Real Time JVM such as Sun Java Real-Time System ?
When indenting java code with annotations, vim insists on indenting like this:
@Test
public void ...
I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not sure if I can use that together with regular cindent.
edit: The filetype plugin was already turned on I just got a bit confused about indenting plugins. The accepted answer may be a bit hackish but works for me as well.
In C# VS2008 how to replace
new SqlParameter("@Description", SqlDbType.NChar, 1500)
or
new SqlParameter("@IsRequired", SqlDbType.Bit)
to
"@Description", SqlDbType.NChar, 1500
or
"@IsRequired", SqlDbType.B
the idea is to remove new SqlParameter() and leave the parameters inside it.
I have thounds of lines code have this pattern. I just want to pass compile by using some regular expression.
I have
stringA = "xxxxxxFoundAaaaaaaaaaaaaaaFoundBxxxxxxx"
stringB = "FoundA"
stringC = "FoundB"
How do I do a regular expression in python in order to return aaaaaaaaaaaaaa?
Please help.
Thanks in advance.
I have Perl code:
my $s = "The+quick+brown+fox+jumps+over+the+lazy+dog+that+is+my+dog";
I want to replace every + with space and dog with cat.
I have this regular expression:
$s =~ s/\+(.*)dog/ ${1}cat/g;
But, it only matches the first occurrence of + and last dog.
VB.NET 2.0 Framework
I developed a control that implements IExtenderProvider in order to attach to controls and display a form for translating of the text of that control. This works great on regular controls on the form but the IExtenderProvider is not attaching to controls on UserControls, which makes sense.
Is it possible to modify the UserControls or my IExtenderProvider control to enable it to attach to controls on a UserControl?
Thanks!