Profile

Cover photo
nitin niraj
Worked at Student
Attended DAV PUBLIC SCHOOL GANDHINAGAR
Lives in pune
211 followers|168,060 views
AboutPostsVideos

Stream

nitin niraj

Need Help (QnA)  - 
 
Hi I am trying to create a database connection using mysqli with following code:
<?php
$hostname = 'XXX.XXX.XXX.XX';
$user = 'XXXXXXXXX';
$password = 'XXXXX';

$connection = mysqli_connect($hostname, $user, $password);
?>

I am getting error as  Warning: mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it. in C:\wamp\www\check_server.php on line 6

I have disabled the firewall and I have changed the port. I am not getting any mysql error in mysqlerror.log (It is blank)

May I know what I am missing ? Any help would be appreciated.
1
Carlos Andres Chavez Lopez's profile photonitin niraj's profile photoStudent Duniya's profile photomuhammad mubasher's profile photo
13 comments
 
allow access on your remote machine for your IP to access database. 
Add a comment...

nitin niraj

Database  - 
 
Hi everyone I am working on python 2.7 and I am trying to fetch data from database. So when I execute a query it returns -1L. Following is my code

def getResults(conn, sql):
    #pdb.set_trace()
    cur = conn.cursor()
    lines = cur.execute("{%s}" % (sql))
    result = []
    #result = cur.fetchone()
    while  lines > -1:
        row = cur.fetchone()
        if row == None: break
        print row
        result.append(row)
    cur.close()
    cur=None
    nresult = [].append
    pdb.set_trace()
    for r in result:
        nrow = [].append
        for e in r:
            if isinstance(e, unicode):
                e = e.encode('utf8')
            nrow(e)
        nresult(tuple(nrow.__self__))
    return nresult.__self__

here lines return -1L . If I run the query which  is here on database it returns a row. Can you please help me on this. Any help would be appreciated.
1
nitin niraj's profile photoMarc Poulin's profile photoAnselm Scholz's profile photo
7 comments
 
Why not go for a for loop like for element in cur: ...
Add a comment...

nitin niraj

Discuss  - 
 
Hi I am working on DBCS (double byte character set). My Python version is 2.7 . The issue which I am currently facing is of encoding of characters. My python program all of a sudden started failing. So what I am thinking now is to convert my python 2.7 to utf-8 because by default the encoding for python 2 is ascii. So my question is what will be the result(pros and cons) of this? Is there anything which I should keep in mind while doing this. Any help would be appreciated. Thanks in Advance.
2
1
Will Beddow's profile photoPaula Merns's profile photoBruce Slaton's profile photo
2 comments
 
Characters take a little more space in memory but if you aren't doing a lot of intense data operations it shouldn't matter for performance.
Add a comment...

nitin niraj

Discuss  - 
 
I am working on reportlab API with Python. I want to have a circle instead of ticks on category and value axis on charts. I am unable to do so any help would be appreciated. Thanks in advance.
1
Add a comment...

nitin niraj

Learning Resource (non-newb)  - 
 
Hi All, 
I am getting an error as follows:
PHP Warning:  pspell_save_wordlist(): pspell_save_wordlist() gave error: The file "/etc/dictionaries/evergreenlegal/custom-dict-en.pws" can not be opened for writing. in /var/www/html/spellchecker/classes/PSpell.php on line 58

I am logged in as root user. The file permission is as follows if i do ls -l filename
-rwxrwxrwx 1 root root 0 Feb 24 05:42 custom-dict-en.pws
Please do let me know what i am missing. Any help would be appreciated. Thanks in advance.
1
Kendall Holm's profile photoJeremy Streich's profile photoNils Biesalski's profile photo
5 comments
 
I guess the directory can not be listed (execute flag) by www-data
Add a comment...

nitin niraj

Need Help (QnA)  - 
 
Hi I am having this issue with PHP in CentOS.
reload the page to get source. Basically what I am trying to do is I am accessing a url in my PHP file. For example.
spellchecker_rpc_url:'127.0.0.1/spellchecker'. I getting a 500 error and then it states "reload the page to get source.".

Thanks in advance . Any help would be appreciated.
1
Rohit Singh Rana's profile photo
 
make sure ur directory permission 777 if not then use chmod for that and all is well ! :)
Add a comment...
Have him in circles
211 people
Vinny Bhargav's profile photo
prabhash kumar's profile photo
Shwet Solanki's profile photo
Ovidiu Bodea's profile photo
rohan srivastava's profile photo
amit kr.'s profile photo
Sumedh Sidhaye's profile photo
Simmy Kumari's profile photo
Saurabh Patil's profile photo

nitin niraj

Discuss  - 
 
Hello everyone, 
I am currently working on a python application which runs fine on 32 bit machine. Now I have to move to 64 bit . The problem which I am currently facing is the data from the database is not fetched properly here but If I run the same query on 32 bit machine it works. I am using pyodbc. When I fetch data I get -1 as my row count. I have installed IBM I series access odbc driver. I have installed that in 
C:\windows\SysWow64\odbcad32.exe but there is no luck. Can anyone explain me why I am getting as -1 in rowcount or what could be a possible reason for this. Thanks in advance.
1
Gustav Hartvigsson's profile photo
 
Serialise the data into text strings and then deserialise it on the other end.
Add a comment...

nitin niraj

Discuss  - 
 
I am using odbc.pyd (C:\\Python27\\lib\\site-packages\\win32\\odbc.pyd'). Now what I want that in my python code where I am doing my connection as 
 con = odbc.odbc("%s/%s/%s" % (settings.DSN, settings.UID, settings.PW)) I want to add one more parameter for UTF-8. But if i do that my program  fails and gives the error. I  want to implement UTF-8 with this connection. Any help would be appreciated.
1
Judah Devasahayam's profile photo
Add a comment...

nitin niraj

Discuss  - 
 
I am having a small question. Suppose I am having a list. X  = [1, 3, 4]
Now what i did is y = X. Then I did X.append(5).  The value of both x and y will change.  Is there any way i should stop the value of y from changing.
3
Bryan James's profile photoAlexandru Dragoescu's profile photoJoshua Underwood's profile photoSriram S's profile photo
11 comments
 
one another way I can think of is: 
y = X[:]

A quirky way I guess.. but it works.. 
Add a comment...

nitin niraj

Need Help (QnA)  - 
 
I am using slim framework for creating api. I am using PDO for database related thing. My code are working fine when I am working on my local machine. But when I upload my code on cpanel I am getting following error.
ERROR: SQLSTATE[42000] [1044] Access denied for user 'frien312_abhi'@'localhost' to database 'frien312_chdb_dev'
Fatal error: Call to a member function prepare() on a non-object in /home/abc/public_html/api1/user.php on line 71. 

Now I am not sure what is the exact error? I don't know how to check if the connection is getting established or there are some other error which is causing this. Any help would be appreciated.
2
Anubhav Singh's profile photonitin niraj's profile photoKarsten Wegmeyer's profile photo
4 comments
 
nevertheless is the following error an indicator for missing code!
Add a comment...

nitin niraj

CentOS-6  - 
 
Hi All, 
I am getting an error as follows:
PHP Warning:  pspell_save_wordlist(): pspell_save_wordlist() gave error: The file "/etc/dictionaries/evergreenlegal/custom-dict-en.pws" can not be opened for writing. in /var/www/html/spellchecker/classes/PSpell.php on line 58

I am logged in as root user. The file permission is as follows if i do ls -l filename
-rwxrwxrwx 1 root root 0 Feb 24 05:42 custom-dict-en.pws
Please do let me know what i am missing. Any help would be appreciated. Thanks in advance.
1
Mike Chen's profile photoWilliam Leemans's profile photo
2 comments
 
Smells like selinux.
Add a comment...

nitin niraj

CentOS-6  - 
 
I am using CentOS 6.6 as my virtual machine. Now I want to access the Lamp server of CentOS in my windows 7. I can ping the ip of CentOS in my windows machine but if i open the same ip in browser it doesn't open. I have tried making changes in httpd.conf but there was no help. 

Any help on this will be appreciated. Thanks in advance.
1
1
Rodd Clarkson's profile photonitin niraj's profile photo慕冬亮's profile photogiuseppe cotugno's profile photo
9 comments
 
First ,check your VM , and is your vm network good! Then ,check your firewall , and close it for test! 
Add a comment...
People
Have him in circles
211 people
Vinny Bhargav's profile photo
prabhash kumar's profile photo
Shwet Solanki's profile photo
Ovidiu Bodea's profile photo
rohan srivastava's profile photo
amit kr.'s profile photo
Sumedh Sidhaye's profile photo
Simmy Kumari's profile photo
Saurabh Patil's profile photo
Education
  • DAV PUBLIC SCHOOL GANDHINAGAR
Basic Information
Gender
Male
Apps with Google+ Sign-in
  • GodRun
Work
Employment
  • Student
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
pune
Previously
ranchi
Links