R= repeats allowed -> 2
A= alphabet (1-10)
S= space = 4;
So we want example:
[1][1][4][5]
[1][7][4][5]
[5][1][4][5]
But need a fancy math formula to calculate this and all combinations ?
Hi,
My Drupal site sends email to a GMail account, but the emails sent all go into the Spam folder, and GMail puts up a bar with the message "This message was likely forged and did not originate from your account."
Although I can create a filter to prevent them going to Spam, I want to start sending newsletters, and I suspect they'll have the same problem.
I suspect the problem is with the way I've set up either PHP or Drupal to send mail. As far as I know it's just using the sendmail function. I've set the from address to "info@..." where ... is the site domain. Any tips on how I can make set up my outgoing mail so it won't be refused by GMail (and presumably other major mail providers)?
Thanks,
James
What is the practice to pass arguments from HTML to jQuery events function.
For example getting id of row from db:
<tr class="jq_killMe" id="thisItemId-id">
...
</tr>
and jQuery:
$(".jq_killMe").click(function () {
var tmp = $(this).attr('id).split("-");
var id = tmp[0]
// ...
}
What's the best practise, if I want to pass more than one argument?
Is it better not to use jQuery? For example:
<tr onclick="killMe('id')">
...
</tr>
I didn't find the answer on my question, I will be glad even for links.
Thanks.
I'm building a test web application ASP.NET VB from a tutorial see it at http://www.latinosnetwork.net/aspnetsystem/Login.aspx after successful log-in using user name jose and password abad the formsauthentication.redirectfromloginpage method redirect the application to a default.aspx at the root directory where it do not exist also the application is not at the root directory.
Any help on that.
Here's my code:
Public Class Form1
End Class
Public Class Form1Handler
Inherits Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("I")
End Sub
End Class
I'm trying to get Form1Handler to process Form1's events automatically. How can I do this? Should I use a module instead? I'm doing this in VB 2010.
I don't want to have to make an event handler in Form1 and then pipe it to the other class / module, is there some way to automatically "pipe" the events from form1 to form1handler?
heyy there
i want to parse a text,let's name it 'post', and 'urlize' some strings if they contain a particular character, in a particular position.
my 'pseudocode' trial would look like that:
def urlize(post)
for string in post
if string icontains ('#')
url=(r'^searchn/$',
searchn,
name='news_searchn'),
then apply url to the string
return urlize(post)
i want the function to return to me the post with the urlized strings, where necessary (just like twitter does).
i don't understand: how can i parse a text, and search for certain strings?
is there ok to make a function especially for 'urlizing' some strings? The function should return the entire post, no matter if it has such kind of strings.
is there another way Django offers?
Thank you
I am using textarea to capture book description but textarea doesn't have attribute "value", How to pass the value to bean.
But the following mechanism to capture value doesn't seem to work
<textarea cols="80" rows="3" spellcheck="false">#{_book.description}</textarea>
Good morning everyone,
Actually I'm having a small issue in image processing and I'm in need of some help. First of all, let me explain what i want to do, i have an image that was split into 4 other small images. I currently have like 6 small images that i need to figure out which ones are part of the real image. Second, what i currently know is that that i should compare these images edges or last column with the first column of the other image.
I'm not sure yet what exactly should be done, anyone is able to put me on the same tracks, with some detailed hints and how to compare the edges of 2 images.
Some links and example codes will be help full.
One more thing, how am i able to read .Raw images using java, c# or python ?
I am using <%# MyFormatClass(Eval("fieldname")) % to display data in a grid view on my page. MyFormatClass works fine, but now I want to move it to a central location that can be used by many pages. When I try to access the class <%# Utils.MyFormatClass(Eval("fieldname")) % it no longer works. Is this something we are allowed to do?
and i really need a code to remove the ending slash when a user put their link.
for example i need them to put their url to grab their avatar, but in some cases they put their url ending with a slash (.com/) how can i remove that slash automatically? because when they put their url like that the avatar doesn't show i need them to end like this (.com) in order to show their avatar.
I was looking for a remove trailing slash php code, but any solution will be appreciated.
i tried to use this code but didn't work
$string = rtrim($string, '/');
I'm writing an application in WPF using the MVVM pattern. In my application I've got an IPopupWindowService which I use to create a popup dialog window.
So to show a ViewModel in a popup window you'd do something like this:
var container = ServiceLocator.Current.GetInstance<IUnityContainer>();
var popupService = container.Resolve<IPopupWindowService>();
var myViewModel = container.Resolve<IMyViewModel>();
popupService.Show((ViewModelBase)myViewModel);
This is all well and good. What I want to do is be able to set the MinHeight and MinWidth on the View bound to myViewModel and have the popup window use those settings so that a user cannot make the window smaller than its contents will allow. At the moment when the user shrinks the window the contents stops resizing but the window doesn't.
EDIT:
I map my Views to my ViewModels in ResourceDictionarys like so:
<DataTemplate DataType="{x:Type ViewModels:MyViewModel}">
<Views:MyView />
</DataTemplate>
And my popup view looks like this:
<Window x:Class="TheCompany.Cubit.Shell.Views.PopupWindowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner">
<DockPanel x:Name="panelContent">
<StackPanel HorizontalAlignment="Right" DockPanel.Dock="Bottom" Orientation="Horizontal" Visibility="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=ButtonPanelVisibility}">
<Button Width="75" IsDefault="True" x:Uid="ViewDialog_AcceptButton" Click="OnAcceptButtonClick" Margin="4">OK</Button>
<Button Width="75" IsCancel="True" x:Uid="ViewDialog_CancelButton" Click="OnCancelButtonClick" Margin="0,4,4,4">Cancel</Button>
</StackPanel>
<ContentPresenter Content="{Binding}" />
</DockPanel>
Hi. I aw working on cross site authentication (some domains have got common authentication). So I want to send authentication data (login, password) to main domain from others.
How should I use protect_from_forgery and how can I check if data received from valid domain?
What I am thinking now is to turn off protect_from_forgery for session controller and check domain name of received data.
But maybe I can configure CSRF protection for not only one domain?
I love microsoft development products!
I hate microsoft browsers...
I have made the decision to cut ties with internet explorer until they add support for some common W3 approved items. Namely 'multiple' in forms as well as about 5 other things...
and as such I would like to urge my visitors to use a better browser.
is there a way to setup an http handler or perhaps something in the asax file to route all ie users to a custom page?
Thanks for the help!
p.s. microsoft why must you make me love you and hate you.
How does one draw text (with onClick event) in a caption bar on vista with aero Like Windows 7 ?
The example at delphi.about.com doesn't work on Vista with aero. Do you have any ideas?
Thanks to all.
Sorry for my bad english.
say ive got a matrix that looks like:
[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]
how can i make it on seperate lines:
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]]
and then remove commas etc:
0 0 0 0 0
And also to make it blank instead of 0's, so that numbers can be put in later, so in the end it will be like:
_ 1 2 _ 1 _ 1
(spaces not underscores)
thanks
I have a file of names and addresses as follows (example line)
OSCAR ,CANNONS ,8 ,STIEGLITZ CIRCUIT
And I want to read it into a dictionary of name and value. Here self.field_list is a list of the name, length and start point of the fixed fields in the file. What ways are there to speed up this method? (python 2.6)
def line_to_dictionary(self, file_line,rec_num):
file_line = file_line.lower() # Make it all lowercase
return_rec = {} # Return record as a dictionary
for (field_start, field_length, field_name) in self.field_list:
field_data = file_line[field_start:field_start+field_length]
if (self.strip_fields == True): # Strip off white spaces first
field_data = field_data.strip()
if (field_data != ''): # Only add non-empty fields to dictionary
return_rec[field_name] = field_data
# Set hidden fields
#
return_rec['_rec_num_'] = rec_num
return_rec['_dataset_name_'] = self.name
return return_rec
I end up doing a lot of this to draw forms in boxes. This does an address block:
position: absolute;top: .2em; left: .2em; width: 2.4em;height: 1.2em;
position: absolute;top: .2em; left: 3em; width: 12.4em; height: 1.2em;
position: absolute;top: 1.7em; left: 3em; width: 12.4em;height: 1.2em;
position: absolute;top: 3.2em; left: 3em; width: 12.4em;height: 1.2em;
position: absolute;top: 4.7em; left: 3em; width: 12.4em;height: 1.2em;
position: absolute;top: 6.2em; left: 3em; width: 7.6em; height: 1.2em;
position: absolute;top: 6.2em; left: 10.9em; width: 1.6em; height: 1.2em;
position: absolute;top: 6.2em; left: 12.8em; width: 2.5em; height: 1.2em;
position: absolute;top: 7.7em; left: 3em; width: 7.6em;height: 1.2em;
position: absolute;top: 9.2em; left: 3em; width: 7.6em;height: 1.2em;
position: absolute;top: 10.7em; left: 3em; width: 1.2em;height: 1.2em;
position: absolute;top: 10.7em; left: 4.5em; width: 10.9em; height: 1.2em;
but what I really need is some Javascript that allows me to draw my forms on screen, then generate the CSS for my real ASP.NET MVC 2 partial views, allowing nudge and cell resizing with keystrokes. Anyone have any suggestions for something like this?
I have a large webform, and would like to prompt the user to login if their session expires, or have them login when they submit the form. It seems that having them login when they submit the form creates alot of challenges because they get redirected to the login page and then the postback data for the original form submission is lost.
So I'm thinking about how to prompt them to login asynchrounsly when the session expires. So that they stay on the original form page, have a panel appear telling them the session has expired and they need to login, it submits the login asynchronously, the login panel disapears, and the user is still on the original partially filled form and can submit it. Is this easily doable using the existing ASP.NET Membership controls? When they submit the form will I need to worry about the session key? I mean, I am wondering if the session key the form submits will be the original one from before the session expired which won't match the new one generated after logging in again asynchrounously(I still do not understand the details of how ASP.NET tracks authentication/session IDs).
Edit: Yes I am actually concerned about authentication expiration. The user must be authenticated for the submitted data to be considered valid.
Hi,
first please (bare with me)... :-(
Im having a course at University ( Theory of Computation ) at first it was easy and simple BUT then we reach the context free grammer specialy the part where we should convert a grammer to Normal forms (Greibach & Chomsky) the thing that I couldnt understand so as usual I went to google and start searching for tutorials or videos I found many(tutorials not videos) but the problem that in tutorials they always explain things as if Im an expert or aware of every thing ... so can anyone please provide me with docs or links where they explaine the methods step by step ...
(Please dont tell me to go back to my instructor because if he is useful I wont be asking your help )
thanx in advance
Trying to calculate total sales for 5 items, 3 stores.
Here's a s/s of what Im getting, along with my code.
What am I missing/doing wrong?
(p.s. It's not returning an error code in 'debug')
Public Class Form1
Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
Dim ttlsales As Double
'set up array data
Dim sales(,) As Integer = {{25, 64, 23, 45, 14},
{12, 82, 19, 34, 63},
{54, 22, 17, 43, 35}}
Dim price() As Double = {12.0, 17.95, 95.0, 86.5, 78.0}
'mark totals
Dim totals(2) As Double
For store As Integer = 0 To 2
For item As Integer = 0 To 4
Next
Next
'display output
lstOut.Items.Add("Sales Per Store")
For store As Integer = 0 To 2
lstOut.Items.Add(store + 1 & ":" &
FormatCurrency(totals(store)))
ttlsales += totals(store)
Next
lstOut.Items.Add("Total Sales: " &
FormatCurrency(ttlsales))
End Sub
End Class
Hi all,
i am using jCarousel as a menu in my website. there is a list of links there which is longer than its containing elements and jCarousel is used as a scroll bar to view that list.
my problem is that whenever a link is clicked and a new page is loaded, jCarousel resets to its begining position thus sometimes an active link is no longer visible after the page reloads. any idea how i can make jCarousel focus on the specific active link?
you can see an example of what i mean here:
http://174.133.190.8/~goldarch/index.php?option=com_content&view=article&id=50&Itemid=57
(check out the menu on top)
thank you all.
my purpose is user enter only email or mobile number.i have the partial success in that.code notify user in OR logic but....IF user entered the incorrect mobile & email @same time then user must be notified for dat.
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailaddressVal = $("#UserEmail").val();
////email & mobile input cheak
if(emailaddressVal == '' && $("#mobile").val() == '') {
$("#UserEmail").after('<p><span class="error">Please enter your email address.</span></p>')
$("#mobile").after('<p><span class="error">Please enter your Mobile number.</span></p>')
hasError = true;
}
//////validating currect email
else if(!emailReg.test(emailaddressVal)) {
$("#UserEmail").after('<p><span class="error">Enter a valid email address.</span></p>')
hasError = true;
}
//////Mobile number
else if( $("#mobile").val()) {
$("#mobile").after('<p><span class="error">Enter currect Mobile number.</span></p>')
hasError = true;
}
Hi. I aw working on cross site authentication (some domains have got common authentication). So I want to send authentication data (login, password) to main domain from others.
How should I use protect_from_forgery and how can I check if data received from valid domain?
What I am thinking now is to turn off protect_from_forgery for session controller and check domain name of received data.
But maybe I can configure CSRF protection for not only one domain?
I'm trying to modify the HTML of the dialog boxes in CKEditor. The HTML inside each of those boxes is an absolute nightmare, and even worse, the source code is compressed and it's unclear what the path of execution is.
I want to take something like this:
<div class="cke_dialog_ui_select" id="44_uiElement" role="presentation"><label style="" for="42_select" id="43_label" class="cke_dialog_ui_labeled_label">Link Type</label><div role="presentation" class="cke_dialog_ui_labeled_content"><select aria-labelledby="43_label" class="cke_dialog_ui_input_select" id="42_select"><option value="url"> URL</option><option value="anchor"> Link to anchor in the text</option><option value="email"> E-mail</option></select></div></div>
and turn it into something more legible and easier to style, removing one of the divs. These are for the Image and Anchor dialog boxes (Modal dialogues) respectively.
Thanks for your help.
I'm in the process of Moving a project from Visual Studio 2003 to 2005 and have just seen the
The event Click is read-only and cannot be changed
when using inherited forms regardless of the Modifier on the Base Forms Controls will make all the Controls from the Base Readonly in the designer (Though in 2003 it didn't work this way).
I found this post metioning that this functionality has been temporarily" disabled
http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/c25cec28-67a5-4e30-bb2d-9f8dbd41eb3a
Can anyone confirm whether this feature is used anymore? or how to program around it to be able to use the Base Control Events and still have a designer?
This is one way I've found but quite painfull when it used to do the plumbing for you. even just hiding one of the controls you have manually do now.
Public Class BFormChild
Friend Overrides Sub cmdApply_Click(ByVal sender As Object, ByVal e As System.EventArgs)
MyBase.cmdApply_Click(sender, e)
End Sub
Friend Overrides Sub cmdCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs)
MyBase.cmdCancel_Click(sender, e)
End Sub
Friend Overrides Sub cmdOk_Click(ByVal sender As Object, ByVal e As System.EventArgs)
MyBase.cmdOk_Click(sender, e)
End Sub
End Class