nvidia-smito check for current memory usage.watch -n 1 nvidia-smito monitor memory usage every second.- Often, extra Python processes can stay running in the background, maintaining a hold on the GPU memory,
even if
nvidia-smidoesn't show it.- Probably due to running Keras in a notebook, and then running the cell that starts the processes again, since this will fork the current process, which has a hold on GPU memory. In the future, restart the kernel first, and stop all process before exiting (even though they are daemons and should stop automatically when the parent process ends).
Use Python to:
- send a plain text email
- send an email with attachment
- receive and filter emails according to some criteria
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If your project uses WebView with JS, uncomment the following | |
| # and specify the fully qualified class name to the JavaScript interface | |
| # class: | |
| -keepclassmembers class fqcn.of.javascript.interface.for.webview { | |
| public *; | |
| } | |
| ### RxJava, RxAndroid (https://gist.github.com/kosiara/487868792fbd3214f9c9) | |
| -keep class rx.schedulers.Schedulers { | |
| public static <methods>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.ibm.sentimentsensitiveapp; | |
| import android.os.AsyncTask; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import android.widget.TextView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SHELL = /bin/bash | |
| WORKDIR = /vagrant | |
| PSQL = sudo -u postgres psql | |
| DBNAME = changeme | |
| DBUSER = changeme_user | |
| DBPASS = secret | |
| db/console: | |
| $(PSQL) $(DBNAME) |
##Basically AsyncTask uses generic types in its parameters The three types used by an asynchronous task are the following:
- Params, the type of the parameters sent to the task upon execution.
- Progress, the type of the progress units published during the background computation.
- Result, the type of the result of the background computation.
Not all types are always used by an asynchronous task. To mark a type as unused, simply use the type Void:
private class MyTask extends AsyncTask<Void, Void, Void> { ... }
##Taking a very known and common example..
You can run your Express app very easily inside your Electron app.
All you need to do is to:
- place all the files of your Express app inside a new app folder in
your_electron_app\resources\app - reconfigure the
app.jsfile - refactor some relative pathes in your Express app
-
This section outlines the necessary steps to write a simple native "Hello World!" JNI-enabled Android application.
-
This section assumes you have read and followed the steps in Compiling C/C++ code directly from Android Studio
- Create a new Android Studio project. To do so, select
File -> New -> New Project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://www.idiotinside.com/2015/02/13/get-number-of-likes-of-a-facebook-page-using-graph-api-in-python/ | |
| import urllib2 | |
| import json | |
| def get_page_data(page_id,access_token): | |
| api_endpoint = "https://graph.facebook.com/v2.4/" | |
| fb_graph_url = api_endpoint+page_id+"?fields=id,name,likes,link&access_token="+access_token | |
| try: | |
| api_request = urllib2.Request(fb_graph_url) |