I want my regex to catch:
monday mon thursday thu ...
So it's possible to write something like this:
(?P<day>monday|mon|thursday|thu ...
But I guess that there should be a more elegant solution.
I can use this verb in the Python Windows SDK. But not in production. Why? What am I doing wrong?
The error message includes (only seen via firebug or fiddler)
Malformed request
or something like that
My code looks like:
from google.appengine.ext import db
from google.appengine.ext import webapp
class Handler(webapp.RequestHandler):
def delete(self):
key = self.request.get('key')
item = db.get(key)
item.delete()
self.response.out.write(key)
This one has me stumped, I need to re-write all requests to the javascript folder (js) to a special library handler system.
e.g.
rewrite http://localhost/admin/js/bar.js --> http://localhost/_lib/=admin/js/bar.js
Any ideas? I have tried the following which creates an error
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule ^(.*)$ /%1/_lib/$1 [NC]
(36)File name to long: cannot map GET /admin/js/bar.js to file
Write a program that computes the sum of the logarithms of all the primes from 2 to some number n, and print out the sum of the logs of the primes, the number n, and the ratio of these two quantities. Test this for different values of n.
Hello friends,
I am using blackberry using java eclips
I have a lengthy of code in single class.so I need to divide code into different classess(need to implement methode in diffferent classes), how to write code in diff classes and how to access diiferent classes methodes in a single class. Can you please give me suggesion.
Is anyone familiar with a library or tool that can determine which format an excel file is in? Or, failing that, documentation on the different formats that would allow me to write my own?
Currently we use log4net and create a new folder (usually below C:) with write and create access rights for the worker process user. Is there perhaps a standard windows folder we should or could be using such as LOCALAPPDATA? I'm guessing that LOCALAPPDATA is a bad choice in the general case because IIS users tend to be non-interactive users and thus I don't think they have the usual user folder structrues available.
I know that boost.asio has a mechanism that calls a callback function whenever a packet is received but is there an option to emit a signal instead?
Do I have to write a function that emits the signal?
If it is so, why?
Hi,
While considering another problem one question appeared.
I do not know how to write html when I want to redirect page when select option changes.
In other words user chooses option from select list and page is redirected after that.
Have you met anything like this?
Regards,
Is it possible to access Firefox info from my program? Specificly I need to read URL of opened site in active tab. Is something like this possible?
I guess I can write extension that will allow me to do something like this, but I wanted to know if it is posible with some FF api...
I am trying to program according to Behavior Driven Development,
which states that no line of code should be written without writing
failing unit test first.
My question is, how to use BDD with private methods?
How can I unit test private methods?
Is there better solution than:
- making private methods public first and then making them private
when I write public method that uses those private methods;
or
- in C# making all private methods internal and using InternalsVisibleTo
attribute.
Robert
I'm trying to grab content where id = 3 OR id = 9 OR id = 100... Keep in mind, I can have a few hundred of these ids.
What is the most efficient way to write my query?
$sql = "SELECT name FROM artists WHERE (id=3 OR id=9 OR .... id-100)"
i need to write a vba script that will find a file. the file could be in three different locations
how do i find where the file is?
the file must have a specific string as part of the file name
my file name could be 9424.bas or 9424a.esy or 9424_.bas or 9424...esy, i dotn know what the file name exactly is but i know the important characters 9424
Rules are simple. Write an obfuscated function in any language that takes in an integer and returns the same integer. Try to use math tricks and not language tricks. IE. Try to make your function portable.
In a MySQL master-slave replication enviroment if I have 4 slave servers how can I execute load balanced select queries?
Should I write a PHP class to dealing with the 4 slaves or it is possible to address queries to MySQL's own load balancer solution? Is there a MySQL load balancing solutions?
Can I use some other tool to distribute my queries? What is the typical set up in situations like this?
Thanks for all answers!
Hello!
How to write the exprission shorter:
return '%.0f' % float_var if float_var else float_var
or
if float_var:
return formatted_string
else:
return None
Thanks!
I am trying to update a datetime column in an android sqlite db to use international date format (yyyy-mm-dd) instead of the current format (mm/dd/yyyy). I want to use the sqlite date() function to reformat the current value of the column. I thought it would be as simple as the following:
update tblename set thedate = date(thedate)
but the above does not work.
How would i write the sql statement to accomplish this?
thanks
patrick
Say I have a table with a unique positive integer field. I currently have rows with id's of [1, 2, 3, 4, 5, 8, 12, 35]. Is there a insert query that I could write that would assign the id field to the lowest unique positive integer (in this case 6)? It would have to do this atomically so there isn't the possibility of concurrent inserts wiping out each other or failing.
I am using mod_rewrite to remap the URLs in my website in the following format:
http://www.mydomain.com/health/54856
http://www.mydomain.com/economy/strategy/911025/
http://www.mydomain.com/tags/obama/new
The problem is that I am making AJAX calls to a file: http://www.mydomain.com/login.php
And I don't want to write the FULL url or even use the ../ trick because there isn't a fixed level of folders.
So, what i want is something to access the login.php from the root, whatever the domain name is:
$.ajax({
type: "POST",
url: "http://www.mydomain.com/login.php"
});
Is it possible to work with an encrypted SQLite database directly in Qt? Or, do I have to read it entirely into memory, decrypt in memory, do work, encrypt in memory, write to disk?
I have this code that saves a pdf file.
FileStream fs = new FileStream(SaveLocation, FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Flush();
fs.Close();
It works fine. However sometimes it does not release the lock right away and that causes file locking exceptions with functions run after this one run.
Is there a ideal way to release the file lock right after the fs.Close()
For example, let's use the Add method of the ArrayList class. If I am using the default compiler settings in Visual Studio C# project in which arithmetic overflow is not checked, would ArrayList.Add() throw an OverflowException if I added too many items? Would surrounding the method call with checked or unchecked make any difference?
BTW, I would write a test program to determine the answer to this question if I had Visual Studio available to me right now.
How would I write a regular expression (C#) which will check a given string to see if any of its characters are characters OTHER than the following:
a-z
A-Z
Æ æ Å å Ø ø - '
Thanks!
I want to use implicit linking in my project , and nmake really wants a .def file . The problem is , that this is a class , and I don't know what to write in the exports section .
Could anyone point me in the right direction ?
The error message is the following :
NMAKE : U1073: don't know how to make 'DLLCLASS.def'
P.S: I'm trying to build using Windows CE Platform Builder .