I just "finished" expanding my Palindrome Tester, made in C#. To allow for phrases I added a simple regex match for all non-alphanumeric characters. At the end of the program it states " is(n't) a palindrome." But now with the regex it prints the no spaces/punctuation version of it.
I would like to be able to print the original user input. How do I do that?
Here is my program: http://gist.github.com/384565
How do I type a floating point infinity literal in python?
I have heard
inf = float('inf')
is non portable. Thus, I have had the following recommended:
inf = 1e400
Is either of these standard, or portable? What is best practice?
hi everyone. I can't seem to make my regular expression work.
I'd like to have some alpha text, no numbers, an underscore and then some more aplha text.
for example: blah_blah
I have an non-working example here
^[a-z][_][a-z]$
Thanks in advance people.
EDIT: I applogize, I'd like to enforce the use of all lower case.
Hi Guys,
I need to work out a period of 6 months (backwards) from a given date.
Example date:
07/06/2010 00:00:00
needs to count back 6 months and display:
07/12/2009 00:00:00
I have been scanning through: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html and non of these functions make sense to me :(
Hope this makes sense and any help would be appriciated.
Kyle
I am using the delete() function from django.contrib.comments.views.moderation module. The staff-member is allowed to delete ANY comment posts, which is completely fine. However, I would also like to give registered non-staff members the privilege to delete their OWN comment posts, and their OWN only. How can I accomplish this?
Is there a way to see the memory usage of NIO buffers? There is the non-heap memory section in JConsole, but I do not think this includes the NIO buffers?
Operating system is Linux (Ubuntu or CentOS) if that would matter.
regards,
Wim
Hi,
I want to run the 'time' unix command from a Python script, to time the execution of a non Python app. I would use the os.system method.
Is there any way to save the output of this in Python? My goal is to run the app several times, save their execution times and then do some statistics on them.
Thank You
Hi all, I am using Expression Engine in part of a site I am developing and other parts are just using my own PHP. My question is how can I tell who the user is logged in as on a non-EE page? I have access to the EE cookies and the EE database but couldn't find a way to use these values to figure out who the user is. I have a list of all the cookie keys/values at: http://andrewgjohnson.com/cookies.html
I know wordpress,joomla,drupal etc ( most of php_mysql stack ) can auto detect update in software itself or/and plugin and either ask for user permission to update or auto update it.
How to do similar thing on google app engine like cloud computing ?
I am creating an open source software which is targeted towards non-computer people. who can not clone my code and update their application easily.
what is the easier way to do this ?
I want to use Ninject to use in a non MVC ASP.NET 3.5 web application.
Can someone write please what do I need to download from ninject home site and what steps I need to take (what ddls I need to reference etc.)? I also want to use Moq objects.
This is the connection string that is currently working on a non-password protected MS Access database.
db.url = jdbc:odbc:Driver\={Microsoft Access Driver (*.mdb)}Dbq\=C:\Inventory.mdb;DriverID\=22;READONLY\=true
How do I add a password to this connection string?
Thanks!
Is there any tool to log current observers of a given object, in the spirit of what "gdb info gc-roots" does? I found "gdb info gc-references" could do that (sort of) as a by-product of its original purpose, but that won't work with non garbage collected apps. Thanks!
I have created a web test in vs2010. which browse through the products.
I have 3 roles in my site guest (non logged in ), logged in not verified, logged in verified.
How I can use single test for all 3 roles?
Can you please explain impersonation in the view of non-technical users.Then please explain it in .NET world.Impersonation is quite evil or good?.Do we apply it for FORMS AUTHENTICATION?
Does anyone know what is the worst possible asymptotic slowdown that can happen when programming purely functionally as opposed to imperatively (i.e. allowing side-effects)?
Clarification from comment by itowlson: is there any problem for which the best known non-destructive algorithm is asymptotically worse than the best known destructive algorithm, and if so by how much?
I am developing a web app that is about to be opened for public beta. Does anyone know of or has prepared a checklist of the various steps that one needs to take to ensure a smooth beta implementation?
The web app is coded using Java, MySQL on the server side and HTML, Javascript on the client side with a little Flash in one or two screens.
I know this question is very non-specific, but I am looking for best practices/guidelines here.
Thanks in advance.
In my app users need to be able to enter numeric values with decimal places. The iPhone doesn't provides a keyboard that's specific for this purpose - only a number pad and a keyboard with numbers and symbols.
Is there an easy way to use the latter and prevent any non-numeric input from being entered without having to regex the final result?
Thanks!
I'm not sure if this has anything to do with the recent Safari update, but I'm beginning to notice this a lot. There is a drastic difference in the way each browser is rendering fonts.
for instance, I took screenshots of what I am seeing here on stackoverflow...
http://twitpic.com/q43eh
I have verified that this is a trend via my co-workers machines.
has anyone noticed this or have any thoughts on non-hack solutions?
Something like:
for (a,b) in kwargs.iteritems():
if not b : del kwargs[a]
This code raise exception because changing of dictionary when itering...
I discover only non pretty solution with another dictionary:
res ={}
res.update((a,b) for a,b in kwargs.iteritems() if b is not None)
Thanks
I need to send email over smtp with ssl using java client. I'm not sure how to do that.
If I have my server certificate installed on my Windows machine, how do I use it?
If I want it to work on a non-Windows machine, do I need to get the certificates in a different way?
BTW: If the SMTP server that I use is using SSL, can I be sure that it will send the mail to the recipient using SSL?
The standard way to deal with situations where the browser does not support the HTML5 <canvas> tag is to embed some fallback content, usually a polite version (and sometimes a less polite version) of
<canvas>Your browser sucks</canvas>
But the rest of the page remains the same, which may be inappropriate or misleading. I'd like some way of detecting canvas non-support so that I can present the rest of my page accordingly. What would you recommend?
My guess is that the src file needs to be XML-friendly, but of course none of the JS file is since it's using all sorts of non-XML compliant entities.
getScript() may be expecting an XML file =/
Any thoughts?
if(is_def(pObj)){
$.getScript(pObj.src,function(){
pObj.stat = STATUS_OK;
$a.dequeue(pObj);
});
}
AppStore now rejects applications made with non-Apple like languages. (with modified contract)
However, is it allowed using declarative mark-up language formed with XML? (like XHTML, but different schema) The declarative mark-up is a code too, but not a script or logic code. Just a passive, static data, but forms some layout and part of an application logic.