Can C/C++ be choice of keeping all your logic (business/domain) for web application?
Why?
I've two resources (cousins) having knowledge on C/C++ and me also good in C/C++, Python, HTML, CSS and JavaScript.
We like to utilize our free time to work on our some good ideas we developed together. The ideas require knowledge of web applica...
When running a Python program that reads from stdin, I get the following error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 320: ordinal not in range(128)
How can I fix it?
Note: The error occurs internal to antlr and the line looks like that:
self.strdata = unicode(data)
Since I don't want to modi...
I have a __new__ method as follows:
class MyClass(object):
def __new__(cls, *args):
new_args = []
args.sort()
prev = args.pop(0)
while args:
next = args.pop(0)
if prev.compare(next):
prev = prev.combine(next)
else:
new_args.append(prev)
prev = next...
I want to find the span tag beween the LI tag and its attributes. Trying with beautful soap but no luck. Details of my code. Is any one point me right methodlogy
In this this code, my getId function should return me id = "0_False-2"
Any one know right method?
from BeautifulSoup import BeautifulSoup as bs
import re
html = '<ul>\
<li...
I want to create a Python dictionary which holds values in a multidimensional accept and it should be able to expand, this is the structure that the values should be stored :-
userdata = {'data':[{'username':'Ronny Leech','age':'22','country':'Siberia'},{'username':'Cronulla James','age':'34','country':'USA'}]}
Lets say I want to add ...
I have a large textfile, which has linebreaks at column 80 due to console width. Many of the lines in the textfile are not 80 characters long, and are not affected by the linebreak. In pseudocode, this is what I want:
Iterate through lines in file
If line matches this regex pattern: ^(.{80})\n(.+)
Replace this line with a new string c...
I'm trying to install pylucene on Windows XP.
I installed JDK on C:\Programme\Java\jdk1.6.0_18 .
I also installed Visual Studio C++ Express to have a C++ compiler.
As first step I'm trying to integrate jcc into python2.6 through the command: C:\Python26\python.exe setup.py build
This gives me the following result:
C:\Installfiles\pylu...
Is there any good open-source implementation of Mersenne Twister and other good random number generators in Python available? I would like to use in for teaching math and comp sci majors? I am also looking for the corresponding theoretical support.
Edit: Source code of Mersenne Twister is readily available in various languages such as ...
There is function in python called eval that takes string input and evaluates it.
>>> x = 1
>>> print eval('x+1')
2
>>> print eval('12 + 32')
44
>>>
What is Haskell equivalent of eval function?
...
I want to merge two cells in excel using pyExcelerator ,
ws.write_merge(r1=0,r2=1,c1=0, c2=0, label='test1', style=style1)
#merge cell1(row=0, column=0) with cell2(row=1, column=0)
Why the errors happen?
AssertionErrors,0 < 0 errors
...
Is there any way to set the directory where you want to start a SimpleHTTPServer or BaseHTTPServer?
Thanks
...
Dear list,
I would like to send a mail with a s/mime v3 attachment through SMTP.
The excellent HOWTO below describes the procedure in detail for s/mime v2.
http://sandbox.rulemaker.net/ngps/m2/howto.smime.html
I would greatly appreciate any help in doing the same for s/mime v3.
Arye.
...
I have a Python CGI. I want to print the data in the page. There will be a print button and when the user clicks teh button, I need to do some processing and send the data to the printer. I similarly want to implement 'Export to excel'. Please let me know how to do these
...
Hello,
I'm building a range between two numbers (floats) and I'd like this range to be of an exact fixed length (no more, no less). range and arange work with steps, instead. To put things into pseudo Python, this is what I'd like to achieve:
start_value = -7.5
end_value = 0.1
my_range = my_range_function(star_value, end_value, length...
for this,
import os.path
def f(data_file_path=os.path.join(os.getcwd(),'temp'),type):
...
return data
I get this,
SyntaxError: non-default argument follows default argument
Is there a way to make this work or do I have to define a variable such as,
rawdata_path = os.path.join(os.getcwd(),'temp')
and then plug that into ...
Hello.
Are there any modules for python, that can be used as tftp server? I tried Tftpy, but when I try to upload something, it says:
ERROR:tftpy:Write requests not implemented at this time.
In fact, it's the only function that I need.
...
Hi,
I want to store a number of url patterns in my django model which a user can provide parameters to which will create a url.
For example I might store these 3 urls in my db where %s is the variable parameter provided by the user:
www.thisissomewebsite.com?param=%s
www.anotherurl/%s/
www.lastexample.co.uk?param1=%s&fixedparam=2
A...
I have the following code:
from selenium import selenium
selenium = selenium("localhost", 4444, "*chrome", "http://some_site.com/")
selenium.start()
sel = selenium
sel.open("/")
sel.type("ctl00_ContentPlaceHolder1_SuburbTownTextBox", "Adelaide,SA,5000")
sel.click("ctl00_ContentPlaceHolder1_SearchImageButton")
#text = sel.get_body_tex...
I downloaded Pydev plugin for Eclipse (3.5.2) today on Mac OSX 10.5.8. To be able to use Pydev, I need to configure the interpreter in Eclipse. I am not clear what exactly I need to do here, or what this step does. I want to make sure that when I run programs from Eclipse using Pydev, it uses the Enthought Python Distribution (EPD) I hav...
The C function myfunc operates on a larger chunk of data. The results are returned in chunks to a callback function:
int myfunc(const char *data, int (*callback)(char *result, void *userdata), void *userdata);
Using ctypes, it's no big deal to call myfunc from Python code, and to have the results being returned to a Python callback fu...