Trying to save files in python:
g = open('~/ccna_pages/'+filename, 'w')
g.write(page)
g.close()
Get this error:
Traceback (most recent call last): File "dl-pages.py", line 50, in
g = open('~/ccna_pages/'+filename, 'w') IOError: [Errno 2] No such file or directory: '~/ccna_pages/1.0.1.1.html'
However, the directory does exist at that location.
This syntax seems to be the what the python docs recommend.. http://docs.python.org/release/1.5/tut/node46.html
What am I missing? Thanks..
I want to have a toast message to display "Enter numeric characters only" whenever the user presses a non-numeric key on the virtual keyboard. Any clue?
I'm a novice ...in that i've taken a few courses n poured through bunches of cool flash widgets, components and techniques. now it's time for my own website ... I do graphic design n really want to use some of the ready mades for convenience and economy...r there similar non flash products?
I need a regular expression to validate string with one or more of these characters:
a-z
A-Z
'
àòèéùì
simple white space
FOR EXAMPLE these string are valide:
D' argon calabrò
maryòn l' Ancol
these string are NOT valide:
hello38239
my_house
work [tab] with me
I tryed this:
re.match(r"^[a-zA-Z 'òàèéìù]+$", self.cleaned_data['title'].strip())
It seems to work in my python shell but in Django I get this error:
SyntaxError at /home/
("Non-ASCII character '\\xc3' ...
Why ?
I need to Install a software, and this software only can run in the Windows Server system. But I don't have Windows Server, I have Ubuntu Server.
I want install a virtual machine Windows on this Ubuntu Server, but it non GUI, how can I install it?
I'm trying to get the last tweet from the people I follow using the twitter api (http://api.twitter.com/1/statuses/friends.json&screen_name=[username]), but I noticed that if the user's last tweet is a retweet, the json data does not contain a "status" element.
Using the "user timeline" api does not work either, the last tweet is the last non retweeted tweet.
Is there a way to get the real last status, even if it's a RT, through the twitter API?
Database i am using is MySQL 5.1. I specified, i believe, right connectionstring in my web.config. but when i run my web app. it throws this exception:-
MySql.Data.MySqlClient.MySqlException: The user specified as a definer ('root'@'%') does not exist
Any help. Why am i getting this?
What is going on?
Is this a result of a programming class assignment or someting?
Find the list at Wikipedia (older revision, somone removed them as non-notable)
http://en.wikipedia.org/w/index.php?title=Comparison_of_File_synchronization_software&oldid=361345181
i have 2 tables in access
this is what i need:
1. if the PK from table1 exists in table2, then delete the entire record with that PK from table2 and add the entire record from table1 into table2
2. if the PK does not exist then add the record
i need help with both the sql statement and the VBA
i guess the VBA should be a loop, going through every record in table1. inside the loop i should have the select statement
I have the following code in my Root htaccess file
RewriteCond %{HTTP_HOST} ^paperviewmagazine.com
RewriteRule (.*) http://www.paperviewmagazine.com/$1 [R=301,L]
It works fine for the main site, but for my forums at /forums/ if someone misses off the www it will show the page and not redirect to the www.paperviewmagazine.com/forums/ instead.
I need to force the WWW to prevent anyone from logging in by accident on the non-www as it wont have the correct cookie credentials for accessing the site at www./forums/
Can anyone help?
Thanks.
I have a question about idioms and readability, and there seems to be a clash of Python philosophies for this particular case:
I want to build dictionary A from dictionary B. If a specific key does not exist in B, then do nothing and continue on.
Which way is better?
try:
A["blah"] = B["blah"]
except KeyError:
pass
or
if "blah" in B:
A["blah"] = B["blah"]
"Do and ask for forgiveness" vs. "simplicity and explicitness".
Which is better and why?
I've encountered this a couple of times and been perplexed.
Cat c = new Cat("Fluffy");
return (Animal)c;
Cat c = new Cat("Fluffy");
return c as Animal;
What's the reason for both of these syntaxes to exist?
I am thinking of using McClim for an application, where can I find a tutorial that covers buttons, keyboard/mouse I/O, drawing images, etc. STFW for mcclim tutorial and clim tutorial didn't help much. Any pointers?
If such a tutorial doesn't exist, please point that out and I';; try to RTFM (maybe eventually write such a tutoriial)
Hi Folks.
I'm looking for a way to determine the difference between two dates.
A normal SQL DATEDIFF statement won't cut it because I need to excluded non working Hours and days Namely Weekends and any time between 16:00 - 7:00.
Something similar to the NETWORKDAYS function in excel.
I'm codeing an excel spreadsheet. Using VBA connect to a SQL server to pull data.
What is the best way to vertically center the content of a div when the height of the content is variable. In my particular case, the height of the container div is fixed, but it would be great if there were a solution that would work in cases where the container has a variable height as well. Also, I would love a solution with no, or very little use of CSS hacks and/or non-semantic markup.
Probably an easy regex question.
How do I remove all non-digts except leading + from a phone number?
i.e.
012-3456 = 0123456
+1 (234) 56789 = +123456789
I prefer to edit in one large file rather than many independent files, but due to limitations in languages, source control, and the preference of team mates I need to output to many files.
What I'm looking for would recurse through all the files in a source directory and generate a single file to edit in VIM, with special file seperator markers. On save it would save the the changes to the correct file(s) ideally in a smart manner, based only on changes made.
Does something like this exist?
I already check some of asp.net mvc hosting sites listed here: http://stackoverflow.com/questions/637567/affordable-stable-asp-net-mvc-hosting-exist
I worry entering credit card number, all of them required credit card number. Do you know which ASP.NET MVC web hosting that has paypal payment option?
The Faking User Roles document in SDN appears to give exactly what I need. I have a few "roles" that I have access to through stored procedure calls I don't control, read-only, via a CRM I don't have direct access to.
Unfortunately, I can't find the method AddRole, or even the class UserItem, by its present name. Does this functionality exist in Sitecore 6.2? If so, where is it?
I have a table:
id, datetime, event
i also have table dates:
date (Y-m-d format)
the problem is some days don't have any events, I would like them to show 0 (or null)
SELECT DATE_FORMAT(table.timestamp, '%Y-%m-%d') ydm, count(table.fkUID) FROM `table` where table.fkUID=$var group by ydm;
is there some way to join or use conditional statements to make the result show:
date|count
----------
2010-05-23| 5
2010-05-24| 0 <--- this line just doesn't exist in my query.
2010-05-26| 3
The folloqing is the excpetion I am getting
The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value type.
below is my LINQ Statement where QuestionId is the primary key in my table
var questionViewsData = from questionViews in objDc.SC_QuestionsViews
join questions in objDc.SC_Questions
on questionViews.QuestionId equals questions.QuestionId into qs
from questions in qs.DefaultIfEmpty()
where questionViews.CreatedDate.Date == new DateTime(2010, 4,27)
select new
{
Selected =(questions == null ?-1:questions.QuestionId),
QuestioinTitle = questions.Title,
VotesCount = questions.VotesCount
};
Let me know how to resolve this
I have an silverlight 4 application, and I want to upload recursively a local folder on the server.
For upload files separatly, there is OpenFileDialog method, But I can not select a folder path.
Does exist an equivalent of the WPF "FolderBrowseDialog" method in silverlight ?
Hello,
I would like du create a basic webdesktop in silverlight 4.
How can I do a windows manager ?
I want to move, resize, minimized, maximized each windows like http://mesh.com...
Does it exist something to create easily a windows manager ?
Do I have to create everything from scratch ?
How ?