Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Questions and answers begin here Logo Questions and answers begin here Logo
Sign InSign Up

Questions and answers begin here

Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Blog
  • Contact Us
  • Recent Questions
  • Most Answered
  • Bump Question
  • Answers
  • Most Visited
  • Most Voted
  • No Answers

Questions and answers begin here Latest Questions

Asked: 4 years agoIn: Programming

Cannot import name ‘BlockBlobService’

louise8403 Teacher

I’m new to Python programming and I’m trying to create a script that interacts with my Azure Blob storage account. I followed the instruction on the Azure Portal to get the required credentials, and then used the Azure SDK for ...Read more

I’m new to Python programming and I’m trying to create a script that interacts with my Azure Blob storage account. I followed the instruction on the Azure Portal to get the required credentials, and then used the Azure SDK for Python to write some code to perform actions such as listing blobs, uploading and downloading blobs, etc. However, when I try to import the `BlockBlobService` class from the `azure.storage.blob` module, I encounter the error “Cannot import name ‘BlockBlobService'”. I am not sure what’s going on, and I’ve searched through several websites and documentation to try to fix it to no avail.
Here’s my code:
“`python
from azure.storage.blob import BlockBlobService
account_name = ‘myaccountname’
account_key = ‘myaccountkey’
container_name = ‘mycontainername’
block_blob_service = BlockBlobService(account_name=account_name, account_key=account_key)
blobs = block_blob_service.list_blobs(container_name)
for blob in blobs:
print(blob.name)
“`
When I run this script, I get the error message “Cannot import name ‘BlockBlobService'”. I am not sure what the issue is, and I’ve checked that I have installed the `azure-storage-blob` module using pip. I’m also certain that my credentials are correct because I can see the blobs in my container when I use the Azure Portal dashboard. Can anyone please tell me what I’m doing wrong and how I can retrieve the blobs using this script? Your help would be greatly appreciated.

Read less
AzureBlob StorageBlockBlobServiceimportImportErrormodulemodule not foundpython
  1. Dive into Turkish History
    Added an answer about 7 days ago
    Your answer is awaiting moderation.

    Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.

    Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.

    See less
    • 0
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  • 533
  • 3 Answers
  • 1k Views
Asked: 5 years agoIn: Programming

standard init linux go178 exec user process caused “exec format error”

stasy_prokopchuk Begginer

I am new to programming and I am struggling with a problem. I have created a Go program in a Linux environment and I keep receiving the “exec format error” message when trying to execute it. I have checked that ...Read more

I am new to programming and I am struggling with a problem.
I have created a Go program in a Linux environment and I keep receiving the “exec format error” message when trying to execute it. I have checked that the file has the proper permissions, but the issue persists.
Here is an example of my code:

package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}

I have saved this code to a file named hello.go and I have compiled it using the command “go build hello.go”. After that, I have tried executing the compiled file using “./hello” and I receive the “exec format error” message.
Could someone help me understand why this is happening and how to resolve it?

Read less
exec format errorgoinitlinuxuser process
  1. Dive into Turkish History
    Added an answer about 7 days ago
    Your answer is awaiting moderation.

    Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.

    Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.

    See less
    • 0
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  • 511
  • 2 Answers
  • 1k Views
Asked: 6 years agoIn: Programming

1.7 Lab: Adjust values in a list by normalizing [Python]

leguizamon_ailen Begginer

I am having some trouble with normalizing the values of a list in Python. I am working on a project where I need to compare two different sets of data, but the values are on different scales. I have a ...Read more

I am having some trouble with normalizing the values of a list in Python. I am working on a project where I need to compare two different sets of data, but the values are on different scales. I have a list of values that range from 0 to 200, and another list with values ranging from 0 to 10. To normalize them, I have been trying to create a function that will take in the original list and return the normalized list.
Here is the code that I have been working with:

def normalize_data(data):
max_val = max(data)
min_val = min(data)
normalized = []

for val in data:
normalized.append((val - min_val) / (max_val - min_val))

return normalized
data1 = [24, 35, 100, 160, 199]
data2 = [2, 4, 6, 8, 10]
norm_data1 = normalize_data(data1)
norm_data2 = normalize_data(data2)

When I run this code, I get the normalized values, but they are not what I was expecting. The values in the first list are normalized to be between 0 and 1, which is correct, but the values in the second list are divided by 20 instead of 10. I’m not sure why this is happening, and I’ve tried changing the values in the function, but I still can’t seem to get it right. Can anyone please help me figure out what I’m doing wrong?

Read less
algorithmlistnormalizationpythonvalues
  1. Dive into Turkish History
    Added an answer about 7 days ago
    Your answer is awaiting moderation.

    Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.

    Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.

    See less
    • 0
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  • 254
  • 1 Answer
  • 910 Views
Asked: 5 years agoIn: Programming

Python PIL cannot identify image file – image.open() OSError.

tanowlic Teacher

I have been trying to open an image using the Image module in Python, but I keep getting an error saying “cannot identify image file”. I’m not sure what I’m doing wrong, as the file definitely exists in the correct ...Read more

I have been trying to open an image using the Image module in Python, but I keep getting an error saying “cannot identify image file”. I’m not sure what I’m doing wrong, as the file definitely exists in the correct location. Here is the code that I’m using:

from PIL import Image
img = Image.open('/path/to/my/image.jpg')
img.show()

I have also tried using the Image.open().verify() method to see if it provides any more information about the error, but it just gives me the same “cannot identify image file” message. I have double checked the path to make sure that it is correct, and I have even tried changing the file extension from .jpg to .png, but nothing seems to be working.
Another thing that I noticed when looking at the image file is that it is pretty large (over 10 MB), but I wouldn’t think that this would be a problem for the Image module. Is there something wrong with the code that I’m using? Or could it be an issue with the image file itself? Any help would be greatly appreciated.

Read less
debuggingfile handlingimage processingpython
  1. Dive into Turkish History
    Added an answer about 7 days ago
    Your answer is awaiting moderation.

    Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.

    Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.

    See less
    • 0
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  • 324
  • 2 Answers
  • 1k Views
Asked: 5 years agoIn: Programming

Field browser doesn’t contain a valid alias configuration.

sargent_pepper99 Begginer

I’m building a browser extension that uses the WebExtensions API. I have a content script with the following code: “`javascript browser.runtime.onMessage.addListener((message) => { if (message.type === ‘get-browser’) { const browserName = navigator.userAgent.includes(‘Firefox’) ? ‘Firefox’ ...Read more

I’m building a browser extension that uses the WebExtensions API. I have a content script with the following code:
“`javascript
browser.runtime.onMessage.addListener((message) => {
if (message.type === ‘get-browser’) {
const browserName = navigator.userAgent.includes(‘Firefox’) ? ‘Firefox’ : ‘Chrome’;
return Promise.resolve({ browser: browserName });
}
});
“`
When I try to load the extension in Firefox, I get an error in the console:
“`
Error: Error: browser.runtime.lastError: Could not establish connection. Receiving end does not exist.
“`
I’m not sure why this error is happening. I’ve looked at the documentation for `browser.runtime.sendMessage` and `browser.runtime.onMessage.addListener`, and it seems like my code should be correct. I’ve also searched on Google and Stack Overflow, but I can’t seem to find a solution.
One thing I noticed is that the error only occurs if I have the `permissions` key in my `manifest.json` file. If I remove it, the error goes away. But I need the `permissions` key to access the `tabs` API in my background script. I’m not sure if there’s a conflict between the two APIs, or if I’m doing something else wrong. Any help would be appreciated.

Read less
aliasbrowserconfigurationCSSdebuggingdevelopmentfieldHTMLjavascript
  1. Dive into Turkish History
    Added an answer about 7 days ago
    Your answer is awaiting moderation.

    Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.

    Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.

    See less
    • 0
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  • 84
  • 3 Answers
  • 1k Views
Asked: 4 years agoIn: Programming

invalidArgumentError required broadcastable shapes at locUnknown.

jcortez1706 Begginer

I am a coding newbie and I am trying to run a machine learning program on my Python environment. However, I am encountering some issues with the shapes of arrays and broadcasting them. I am quite unsure of how to ...Read more

I am a coding newbie and I am trying to run a machine learning program on my Python environment. However, I am encountering some issues with the shapes of arrays and broadcasting them. I am quite unsure of how to handle this situation.
I have a series of arrays with differing shapes that I want to broadcast together to find their dot product. However, when I run my code, I get an `InvalidArgumentError` saying that the shapes of the arrays are not broadcastable. I am not sure how to go about rectifying this error. Here’s an example of my code:

import tensorflow as tf
a = tf.constant([[1, 2], [3, 4]])
b = tf.constant([10, 20])
c = tf.constant([[100], [200]])
result = tf.tensordot(a*b, c, axes=1)
with tf.session() as sess:
output = sess.run(result)

Can someone please help me understand why I am not able to broadcast the arrays and what I can do to fix this code? Thank you in advance for your help.

Read less
arraysbroadcastingdebugginginvalidargumenterrornumpynumpy-broadcastingpython
  1. Dive into Turkish History
    Added an answer about 7 days ago
    Your answer is awaiting moderation.

    Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.

    Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.

    See less
    • 0
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  • 677
  • 3 Answers
  • 171 Views
Asked: 5 years agoIn: Programming

MongoError: connect ECONNREFUSED 127.0.0.1:27017 (Solved)

teddybear5150 Teacher

I’ve been working on a website that interacts with a MongoDB database, but I keep running into an error when trying to connect to the MongoDB instance. The error message reads: “MongoError: connect ECONNREFUSED 127.0.0.1:27017”. This happens whenever I try ...Read more

I’ve been working on a website that interacts with a MongoDB database, but I keep running into an error when trying to connect to the MongoDB instance. The error message reads: “MongoError: connect ECONNREFUSED 127.0.0.1:27017”. This happens whenever I try to run my Node.js application.
Here’s my code:

const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/myDatabase', {useNewUrlParser: true});
const db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function() {
console.log("Connected successfully.");
});

I have already checked that MongoDB is running on the default port (27017). I have also tried using the IP address 0.0.0.0 instead of localhost, but that didn’t work either. What could be causing this error and how can I fix it? Any help would be greatly appreciated.

Read less
connectionerrorlocalhostmongodbNode.js
  1. scytheria.nel Teacher
    Added an answer about 5 years ago

    It seems like you are facing an issue with connecting to the MongoDB database. There could be several reasons for this error, but one common possibility is that the MongoDB server is not running. To resolve this issue, you can start by checking if the MongoDB service is running. You can do this by rRead more

    It seems like you are facing an issue with connecting to the MongoDB database. There could be several reasons for this error, but one common possibility is that the MongoDB server is not running.

    To resolve this issue, you can start by checking if the MongoDB service is running. You can do this by running the following command in your terminal or command prompt:

    “`sudo service mongod status“`

    If the service is not running, you can start it by running the following command:

    “`sudo service mongod start“`

    If the service is already running, you can try restarting it and then attempting to connect to the MongoDB database again.

    Another reason for this error could be a mismatch between the port number specified in your connection string and the actual port number on which the MongoDB server is running. Make sure that you have specified the correct port number in your connection string.

    I hope this helps you resolve the issue. Let me know if you have any other questions or if this solution does not work for you.

    See less
    • 14
    • Share
      Share
      • Share onFacebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  • 350
  • 3 Answers
  • 803 Views
Load More Questions

Sidebar

Ask A Question

Stats

  • Questions 117
  • Answers 403
  • Best Answers 0
  • Users 5k
  • Popular
  • Answers
  • crisroxz

    Pine Script error: script could not be translated from `null`

    • 1 Answer
  • leguizamon_ailen

    1.7 Lab: Adjust values in a list by normalizing [Python]

    • 1 Answer
  • fabian_mgram

    Python String Class like StringBuilder in C#

    • 3 Answers
  • utxpiv_ added an answer The error "libpng warning iccp known incorrect sRGB profile" usually… March 31, 2023 at 12:34 pm
  • imamreshmahi added an answer One possible way to avoid the warning 'libpng warning iccp… March 18, 2023 at 7:34 pm
  • crazytibet added an answer When dealing with the Libpng warning ‘iCCP: known incorrect sRGB… March 15, 2023 at 3:40 pm

Top Members

bluzbear

bluzbear

  • 0 Questions
  • 101 Points
Pundit
krystianpanczak

krystianpanczak

  • 0 Questions
  • 101 Points
Pundit
idavidt5

idavidt5

  • 0 Questions
  • 101 Points
Pundit

Trending Tags

attributeerror c# command-line configuration debugging error error handling ImportError java javascript json module Node.js pandas programming python swift testing troubleshooting windows
  • Meet The Team
  • Blog
  • About Us
  • Contact Us

© 2017 - All Rights Reserved. Made with ❤️ in RO