Quantcast
Channel: User Mahmoud Hanafy - Stack Overflow
Browsing all 37 articles
Browse latest View live

Comment by Mahmoud Hanafy on What does the underscore mean in python

@abarnert it's not an exact duplicate, the future module is a special case of __ module __, as explained in my answer.

View Article



Comment by Mahmoud Hanafy on Changing a JButton on click event

@Thanh Le already wrote an answer with some code, check it out.

View Article

Comment by Mahmoud Hanafy on django autoincrement based on foreignkey

If there's no way of doing this without resorting to this workaround, I'll use it. Thanks.

View Article

Comment by Mahmoud Hanafy on Can't login with django's test client

@Marat as a matter of fact, I do. django-guardian and django-allauth both provide custom backends that I use in my app.

View Article

Comment by Mahmoud Hanafy on Comparing date part only without comparing time...

Can you add more information on how this library makes this easier?

View Article


Comment by Mahmoud Hanafy on No such table with qsqlite

@drescherjm updated question.

View Article

Comment by Mahmoud Hanafy on Use virtualenv with Python with Visual Studio Code

To find your virtualenv, python.venvPath needs to be set.

View Article

Comment by Mahmoud Hanafy on Blackbox: GPG decrypt fails (don't know ctb=00)

@gurpreet- I used your solution and it worked for me, thank you.

View Article


Comment by Mahmoud Hanafy on Converting roman numerals to integers

@cdarke while the question might not be exactly new, I would like to know what's wrong with my approach.

View Article


Comment by Mahmoud Hanafy on Converting roman numerals to integers

Thank you, I didn't know that.

View Article

Answer by Mahmoud Hanafy for OverflowError: mktime argument out of range when...

Installing pytz solves the problem.South was expecting a timezone aware DateTime, and it only got a naive one because pytz was not installed.

View Article

Answer by Mahmoud Hanafy for What does the underscore mean in python

According to PEP 236 where this module was proposed, the double underscores make it a reserved name.[5] This ensures that a future_statement run under a release prior to the first one in which a given...

View Article

Can't authorize my app using twitter4j

I'm writing an Android twitter app using twitter4j 2.2.4, and I'm having trouble getting past OAuth.here's my code :package info.mahmoudhossam.twitter;import twitter4j.Twitter;import...

View Article


Answer by Mahmoud Hanafy for Can't authorize my app using twitter4j

In case someone gets stuck with this, I found a solution to my problem.It was the emulator's clock being out of sync, starting emulators from snapshots used to mess up the clock.So if you have this...

View Article

Removing files from commit in pre-commit hook

I have the following git pre-commit hook#!/bin/shcd "$(git rev-parse --show-toplevel)"make cleangit rm $(git ls-files --deleted)However when I commit, the deleted files are unstaged.And when I abort...

View Article


4clojure exercise 2

I'm trying to solve this problem but it always fails the tests.here's my solution:(= (- 10 (* 2 3)) 4)I tried this on Chrome and Firefox, same result.

View Article

Primality test in python [duplicate]

I'm trying to do a simple primality test in Python.Accoding to Wikipedia, a primality test is the following:Given an input number n, check whether any integer m from 2 to n − 1 divides n. If n is...

View Article


Syntax error in update statement with Arabic column names

I have an Access 2007 database with Arabic column names.What I'm trying to do is an update with images using an integer as a primary key, but I get an error saying there's an error in the UPDATE...

View Article

Answer by Mahmoud Hanafy for Why do we use finally blocks?

finally ALWAYS executes, unless the JVM was shut down, finally just provides a method to put the cleanup code in one place.It would be too tedious if you had to put the clean up code in each of the...

View Article

Using gtkmm with Eclipse CDT

I'm trying to compile the gtkmm Simple Example using Eclipse CDT, but it's not working for some reasonI'm compiling this on Mandriva Linux and GCC 4.4.3I get this error, which I think is a linking...

View Article
Browsing all 37 articles
Browse latest View live




Latest Images