Posts

mongodb - create mongo connection handler with python -

How to write mongo connection handlers with pongo? I want to ask for a connection to all the modules in my program. I mean use pymongo MongoClient for example and write handler for it. For example in your application anywhere, such as a __ init __.py and then import that object wherever you want it to be used. Customer enforces connection pooling, so you should be correct without writing any additional handlers. Example: ap / __init__.py db = Mongo client () and then App / ModuleApplication DB

Powershell Variable data from Functions being lost -

I am trying to create a script and the way I am collecting data in a $ message variable. The first line in my script is: $ message = "Verifying the server is running on the server" $ ComputerName " And this is all that is output. I have in my functions: startervice = start-service $ license $ message + = "$ savannah The " function works to start when the message is not running, while it does not attach the message to the $ message variable, when used in a loop, for example Eg ($ Servicename in $ services) {FuncCheckService $ ServiceName} What can I do to collect data in my variable? This is because the function works in a different workspace than the rest of the script. What you might want to do is change the last line to the following: write-output "$ message $ service name" attempt to start Only when you can call the function: $ message = startaservicefunction and then captures any output from the $ message func...

php - There is any way to show pdf in a received email like embedded pdf? -

In an embedded way, I'm trying to show some PDFs like email, because the user has to click to open PDF is not required! I want the PDF to be open already, when users open email. I am trying to do this for a newsletter in PDF format. Do you know how this can be done? Which plug-in technology? Thanks, My code is below to send emails, but $ date = date ('d / m / yh: i' ); $ msg = "Our newsletter is: (Here I want to show the PDF) Best Relationship Send: $ date"; = $ 'For test@hotmail.com'; $ Theme = 'newsletter'; $ Headers = "to: $ for \ n"; $ Headers = "Content-type: text / html; charset = \" utf-8 \ "\ n \ n"; Mail ($ email, $ theme, $ message, $ header); If you send an email with a PDF attachment that receives the email client How does the display (such as Apple Mail) show, it will display it. You can use the example code to do this. Apart from this, I can say that do not do it - either format your...

gpgpu - OpenCL clEnqueueCopyImageToBuffer with stride -

Image
I have an OpenCL buffer that has 2D diagonal width of this image is larger than its width. I need to create an OpenCL image from this buffer The problem is that the function clEnqueueCopyImageToBuffer is not wavy in the form of an input parameter, only a copy from the OpenCL buffer OpenCL image (with a larger width than the width) or Make it faster? One way to solve this problem is to write your own kernel, but maybe there is a very clear solution? Unfortunately, there is no way in the OpenCL specification that allows you to create images directly from buffer When the image of the buffer data does not equal the width, the most efficient solution will probably be to write your own kernel to do this. The easiest way to do this is to write your own kernel, clEnqueueCopyBufferToImage at a time. If your image is too large, it may be that the display of this technique will be equal to the hand written kernel, but you have to try to see it. I did not include the clEnqueueCo...

Elasticsearch - Sorting by a nested multi-field -

Two multi-field tasks that went into a problem when I tried to solve nested multi-field properties in the Elasticsearch One from one, zero for other returns for each value My sortable analyzer: "analyzer": {"sortable": {"type": "custom", "tokenizer": "keyword", " Filters ": [" lowercase "]}} Mapping: {" Doc ": {" property ": {" id ": {" type ":" name ": {" type ":" string "," index ":" analyzed "," analyzer ":" snowball "" "" "{" type ": {" sortable ": {"type": "string", "analyzer": "sortable"}} "," website ": {" type ":" nested "," property ": {" domain name ":" "" string "," Analyst: "Snowball", "Field": {...

makefile: variable evaluation in function call? -

I have a makefile like this: DIRS = foo bar I want to enumerate the files in the sub-directories of these directories, so I can pass them all to the program at once. It is not working: UNIT_FILES = () find_units: c for $ (DIRS); Do UNIT_FILES + = ($ (wildcard $ (c) / systemd / *)); However, it works: UNIT_FILES = () find_units: UNIT_FILES + = ($ (wildcard foo / systemd / *)) So I know this issue is wildcard in the call with my variable evaluation. I've tried to differentiate it, which is like $ (c) , $$ c and I like it, but I'm just stabs here in the dark. Can anyone tell me in the right direction? here: $ c (dirs); Do UNIT_FILES + = ($ (wildcard $ (c) / systemd / *)); You are using a shell, which will be called in such a way: $ (SHELL) -c "$ c for $ (DIRS); UNIT_FILES + = ($ (Wildcard $ (C) / SystemDi / *)) "" Nothing is actually expanded in UNIT_FILES because this command is not executed Makefile Level. UNIT_FILE...

java - No suitable driver found when invoking DriverManager from class constructor -

पुस्तकालय में mysql-connector-java-5.1.22-bin.jar जोड़ा गया। एक वर्ग बनाया, सभी java.sql संकुल आयात किया। सार्वजनिक स्थिर शून्य मुख्य और एक कन्स्ट्रक्टर है। मुख्य में, लाइन को जोड़ा गया ... DriverManager.getConnection ("jdbc: mysql: // स्थानीय होस्ट / लुकअप", "रूट", "डमीपीडब्ल्यूड" ) यह एक अपवाद नहीं डालता है और मैं डेटाबेस के साथ सामान कर सकता हूँ कंस्ट्रक्टर पर एक ही पंक्ति जोड़ें और मुझे एक त्रुटि मिलती है: कोई उपयुक्त ड्राइवर नहीं मिला ... यह मुख्य में क्यों काम करेगा विधि लेकिन कक्षा निर्माता के अंदर नहीं? इस तरह एक DriverShim क्लास का उपयोग करने की कोशिश करें : इसलिए आपको अपने कक्षापथ में जेडीबीसी ड्राइवर डालने की आवश्यकता नहीं है। एक जादू की तरह काम करता है।