Sample Filter
   11 tags on

0 answers

String sent over socket in Python will not compare to equivalent string once .recv'd

Ignoring the larger scope of my code, there is one particular part that is not working properly. I send to a server a GET request for a file from a client over TCP. I am opening the file (.html in ...

1 answer

Python Singelton design pattern tracking application stats

I have an python application that executes work flow of tasks. At the end of the list of task the application shutdowns. At this point I want to collect relevant statistic from each task. Each of this ...

1 answers | 49 secs ago by Danny on Stack Overflow
0 answers

Converting an integer to a list

Write a recursive function called si that accepts one argument, a positive, four digit integer, and returns the digits of the integer as a list. For example, si(2538) [2,5,3,8] (Hint: Use integer ...

5 answers

Two values in one byte

In a single nibble (0-F) I can store one number from 0 to 15. In one byte, I can store a single number from 0 to 255 (00 - FF). Can I use a byte (00-FF) to store two different numbers each in the ...

0 answers

Get coordinates of an object in OpenCV

I'm taking live video from a webcam of a wall. I want to get the coordinates of a ball which I place through OpenCV Python. Any leads? I tried documentation and searched over internet and even some ...

2 answers

How to delete an AMI using boto?

(cross posted to boto-users) Given an image ID, how can I delete it using boto?

2 answers | 2 mins ago by ripper234 on Stack Overflow
1 answer

Creating dictionary by reading a file with default values

I have to create a dictionary by reading a file The information is split into lines The keys are between brackets but not all of them are keys. Just the ones after [date] between two keys are the ...

1 answer

How to stop a block of code from happening once an incorrect key is pressed

So I have this block of code if the user types what's on screen correctly. words = ...

4 answers

How to remove line break in array in Python

While running code I got an output, vivek Hello World! There is a line break between "vivek" and "hello World", but I want an output without a line break vivek Hello World like above # Hello ...

4 answers | 3 mins ago by Vivek Singh on Stack Overflow
1 answer

Transform world space vectors to local space

I'm writing a ray tracing program that intersect sphere with area light source. I have that vectors wo (w - outgoing) wi (w - incoming) n (surface normal) How do i transfer that vectors from ...

0 answers

python different results in function and interpreter with paramiko channel

I am getting different results from a command sequence depending on whether the command sequence is execute within a function or in the python interpreter. I am trying to make a paramiko.Channel ...

0 answers

example for user authentication in scala lift framework

Hi I am new to Lift framework. I want to know how i can do user authentication like we used to do in java servlet, where we used to check whether user has logged in or redirect to login page. How ...

1 answer

How to iterate records with avro rdd files in spark scala?

I have a variable "myrdd" that is an avro file with 10 records loaded through hadoopfile. When I do myrdd.first_1.datum.getName() I can get the name. Problem is, I have 10 records in "myrdd". ...

1 answers | 7 mins ago by Rolando on Stack Overflow
8 answers

Where are the man pages for C++?

Does documentation for C++ exist in Linux? I want something like the man pages of C. For example, docs for string, stl, iostream, ifstream, etc.?

0 answers

Terminal display of input goes out of sync while/after using python? (temporary fix = `reset`)

Every time that I run python or python3 with an interactive console, the display of the prompt gets out of sync almost immediately after the first or second interaction: >>> [1,2,3] ...

0 answers

how to make a simple web application using flask framework and python

(venv) C:\Users\admin\Desktop\flaskr>python EEE ERROR: test_empty_db (main.FlaskrTestCase) Traceback (most recent call last): File "", line 31, in test_empty_db ...

0 answers

Fixing an error with indentation, Python

**Please forgive me if this is a very stupid mistake.** File "", line 50 if keys[K_a]: ^ IndentationError: unexpected indent It seems that this error goes away if I ...

0 answers

How to use python functions inside module

I have two functions inside module as shown below. def apple(x, y): orange (x, y) def orange(a, b): --- But when I run this code, it gives me error saying the orange has not ...

2 answers

Annoying grey flicker during updates in ttk GUI

I am trying to populate my screen with some data that refreshes every given time interval. I am using Python3, themed tkinter. Every time my screen updates I see grey flickerings on screen for every ...

2 answers | 12 mins ago by Dee on Stack Overflow
1 answer

Scala Mohiva play-silhouette-seed get social data

I'm using I want to take from VK some data like City, country etc. but I don't know which way I should do it. It would be perfect if I can do something ...

3 answers

Delete the list in the list by specific value

lists = [["a", 1], ["b", 2], ["c", 3]] Are there any ways to delete list in the list by specific value? For example, I would like to delete the list ["b", 2] by indicating delete the list which ...

3 answers | 13 mins ago by Rei Kudo on Stack Overflow
1 answer

python readline module folder name completion

I am trying to implement a folder name completion for one of my programs and i am using the readline module for it. I have written a Completer class (file import os.path import ...

2 answers

List Index Out of Range Error : Python

I am working on a programming exercise from Computer Networking: A Top-Down Approach (6th Edition) by Kurose and Ross) When I run the server code and type localhost:1234/ in my ...

0 answers

how can I get the total bytes sent and received using python 2.7?

Is there a way to calculate the total sent and total received bytes in python 2.7 application using urllib2 library? I cannot see any method or variable holding this value when I look at the ...

1 answer

Unicode search not working

Consider this. # -*- coding: utf-8 -*- data = "cdbsb \xe2\x80\xa6 abc" print data #prints cdbsb … abc ^ print re.findall(ur"[\u2026]", data ) Why can't re find this unicode ...

1 answer

Why is the time to resize operation of array proportional to N if done by repeated doubling?

If array is full and its size is increased by 1 to insert the new element, time to insert N elements can be calculated as 1+2+ .. N = N^2/2. (declare new array with length size+1 and copy the elements ...

3 answers

Make a numpy upper triangular matrix padded with Nan instead of zero

I generate a matplotlib 3d surface plot. I only need to see the upper-triangular half of the matrix on the plot, as the other half is redundant. np.triu() makes the redundant half of the matrix ...

3 answers | 19 mins ago by user3556757 on Stack Overflow
1 answer

Internal Server Error ir.attachment

I am using the ir.attachment module. SO i am creating my own document and then i automatically add it to the attachment by this way: filename="/opt/file.txt" files = open(filename,'rb').read() ...

1 answer

How does send() return -1 if its return type is size_t?

Looking at MSDN page of send() the function returns an int, though looking at the Linux Man Pages send returns a size type which is defined as an unsigned int or unsigned long long. if its an unsigned ...

1 answers | 19 mins ago by XEL on Stack Overflow
0 answers

How to Change image captured date in python?

I have over 500 images (png /jpg) having wrong captured date (Date taken) because of wrong camera date settings. I moved photos to mobile and mobile gallery sorts photos on the basis of 'Date Taken'. ...

15 30 50 per page
1 2 3