Why are Python exceptions named "Error" (e.g. ZeroDivisionError, NameError, TypeError etc)
and not "Exception" (e.g. ZeroDivisionException, NameException, TypeException etc).
I come from a Java background and started to learn Python recently, as such this is confusing because in java there is a distinction between error and exception.
Is there a difference in Python also or not? Can someone explain or point me to some documentation explaining it?
Thank you!
I got this from for a login form tutorial:
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
Could some one explain exactly what this does? I know that the 'clean' var is called up afterwards to sanitize the fields; I.e. $email = clean($_POST['email']);
how get the date and time of the last modified particular TYPE file in that directory
let me explain with an example
there are many files in directory say y:\tempfiles now i want to get the date and time of last modified file of txt format files like
9-03-2010 11.35 arun.reo
9-03-2010 11.31 arun1.reo
9-03-2010 11.31 arun.txt
9-03-2010 11.31 arun.avi
now i want the out put as 9-03-2010 11.35 which is last modified file for reo type files .
I'm using restful authentication in rails. Now I just want to change it to Authlogic.
I used
acts_as_authentic do |c|
c.transition_from_restful_authentication = true
end
and changed the password and salt field to 128 characters.But, if I create a new user crypted password length is 40 characters length(Its not changing to 128 as in authlogic).
Plz suggest me, how to change from restful to Authlogic from the start.
i.e I have restful authentication now.(how to change it to authlogic..plz explain from start)
Hi all
I have encountered this topic lately and couldn't understand why they are needed ...
Can you explain me why i should use them in my projects and how they can ease my life .
Examples will be great, and where from i can learn this topic little more .
Thanks.
Can one please explain with example what does $obj-$a()-$b mean? I've used PHP OOP quite a long time and have seen in some places this structure and not just this $obj-$a(); In what cases should I use it?
Thanks in advance!
Recently I was asked the following question at interview.
"What are the different way to bind a Data Control in ASP.Net".
I have answered
Typed DataSet
Collections
Stored Procedure.
The interviewer expecting a lot more. Can anyone explain me the different way that we can bind the data controls?
I want to create two grids in the WPF Page. One grid need scrollbar or scroll viewer. Another grid is static.The grids are placed one by one in the page. How to create and set the scroll in first grid.? plz explain me.
Hello guys, I'm stuck with some sort of error which i don't really understand in prolog. I get this error when calling a rule(which seems to work sometimes?) :
error(instantiation_error,Var0)
Can anyone explain to me what this means?
Thanks
I am using CKEditor/CKFinder as wysiwyg editor on my MVC.NET site.
I have set [ValidateInput(false)] and it works when debugging it locally, but I receive the following error when I have published the site:
A potentially dangerous Request.Form value was detected from the client (message="<p>
<em>Testing</e...").
can anyone explain why the published site is different from the locally site, especially when I have set [ValidateInput(false)]?
I have a .swc file and I learned how to add that swc file into the library. I will be happy if any one explain how to use this .swc file into my flex project and run that with an example .
Got this code snippet from some website:
int num = 1;
if(*(char *)&num == 1)
{
printf("\nLittle-Endian\n");
}
else
{
printf("Big-Endian\n");
}
Can anyone explain this step-by-step?
&num - Adress of a
(char *)&num - Type-cast address of a into a string
*(char *)&num - Points to the first character of the string
Am I missing anything here?
$fp = fopen("http://feeds.reuters.com/Reuters/PoliticsNews?format=xml","r")
or die("Error reading RSS data.");
The above coding working correctly in localhost;;;
but in server display "Error reading RSS data."...
i dont know why....
anybody please explain me...
i am waiting...
thanks
I tried to implement XOR sort in python.
x,y= 10,20
x,y,x = x^y,x^y,x^y
print('%s , %s'%(x,y))
OUTPUT:
30 , 30
I am not new to python but I am unable to explain this output. It should have been 20,10.
What is going on under the hood?
Hey,
For some time i see that employers demand from programmers knowing Sharepoint, but I have problem with understand what it is :/
But today I was at IT training, and main guy told something like that:" Sharepoint is platform for commit code for programmer, control of version etc..."
It is true? It looks like SVN tool... Can someone explain me what advantages it have for c# programmer?
Thanks ;)
I have two branches master and exp
i tried to cherry pick some of the commit in the exp to master.I am getting
the following error.
git cherry-pick 209c4b154d3c15fa8086d4cc15fa34e53b8a65a3
fatal: Dirty index: cannot cherry pick
Can anyone explain this error.
Hi,
guys could anyone explain to my like to a not very inteligent child what is declared here:
(this is taken from another post on this forum)
template<typename C> static char (&f(ChT<int Fallback::*, &C::x>*))[1];
how I read it is:
template of static function f called with (ChT*) but then I can't make sense why is there address of operator and why is there array?
When explaining please picture not very inteligent child and then try to make it clear to it.
Thanks for any help
I have been search about SharePoint Governance for past few days, the more I search, more confused I am getting about this Topic.
Could anyone just explain in brief? What you know about it or are you using/implementing it?
Please explain me in simple terms (if possible simple example) the covariance and contravariance in c# .net .
I know many are available(even in stackoverflow) but my problem is in which scenario I should use that is not explained in the articles that I am refering to.
e.g.
Covariance and Contravariance in Delegates (C# Programming Guide)
Thanks
char *a[]={"diamonds","clubs","spades","hearts"};
char **p[]={a+3,a+2,a+1,a};
char ***ptr=p;
cout<<*ptr[2][2];
why does it display h and please explain how is the 2d array of ptr implementing and its elements
I am new to powerbuilder and having a lot of trouble using datawindows. I can't get my head around the insert mechanism of it. Can someone explain it to me, or at least point me in the right direction(article, tips etc...) ?
I have a wordpress installation. When the ownership of the folder is root, the memory consumed is okay. However, when I change the ownership to www-data user, it starts consuming a lot of memory and starts throwing a lot of out of memory error. I have changed the ownership to root. However, Can anyone explain why this happens?
Ok, I read a while back that Quantum Computers can break most types of hashing and encryption in use today in a very short amount of time(I believe it was mere minutes). How is it possible? I've tried reading articles about it but I get lost at the a quantum bit can be 1, 0, or something else. Can someone explain how this relates to cracking such algorithms in plain English without all the fancy maths?