This file contains 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
# Create a Cloud Pub/Sub topic | |
# In the Cloud Platform Console, click Navigation menu > Pub/Sub > Topics. | |
# Create a topic., eg "feedback" | |
gcloud pubsub subscriptions create worker-subscription --topic feedback | |
#Publish a message to a Cloud Pub/Sub topic | |
gcloud pubsub topics publish feedback --message "Hello World" | |
#Retrieve a message from a Cloud Pub/Sub subscription |
This file contains 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
String scream(int length) => "A${'a' * length}h!"; | |
main() { | |
final values = [1, 2, 3, 5, 10, 50]; | |
for (var length in values) { | |
print(scream(length)); | |
} | |
// OR | |
values.map(scream).forEach(print); |
This file contains 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
git clone https://github.com/GoogleCloudPlatform/training-data-analyst | |
cd ~/training-data-analyst/courses/developingapps/python/firebase/start | |
. prepare_environment.sh | |
python run_server.py | |
# Web preview > Preview on port 8080 to preview the Quiz application. | |
# Note Cloud Shell Web preview domain (in form: 8080-dot-2958229-dot-devshell.appspot.com) | |
# Create a Firebase project | |
# Develop > Authentication > Set up sign-in method > Email/Password > Enable | |
# Under Authorized Domains > Add Domain (in form: 8080-dot-2958229-dot-devshell.appspot.com) |
This file contains 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
# Get the Bucket name from the GCLOUD_BUCKET environment variable | |
bucket_name = os.getenv('GCLOUD_BUCKET') | |
# Import the storage module | |
from google.cloud import storage | |
# Create a client for Cloud Storage | |
storage_client = storage.Client() | |
# Use the client to get the Cloud Storage bucket |
This file contains 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
# Import the os module | |
import os | |
# Use the os module to get the GCLOUD_PROJECT environment variable | |
project_id = os.getenv('GCLOUD_PROJECT') | |
from flask import current_app | |
# Import the datastore module from the google.cloud package. | |
from google.cloud import datastore |
This file contains 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
# Navigation menu => Compute Engine => VM Instances => Create | |
# Identity and API access => Allow full access to all Cloud APIs. | |
# Firewall => Allow HTTP traffic | |
# SSH | |
sudo apt-get update | |
sudo apt-get install git | |
sudo apt-get install python-setuptools python-dev build-essential | |
sudo easy_install pip |
This file contains 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
public class MainActivity extends AppCompatActivity { | |
private TextView tv; | |
private Button btn; | |
private CheckBox cb; | |
private MenuItem miBtnMenuitem1; | |
private MenuItem miBtnMenuitem2; | |
private MenuItem miTvMenuitem1; |
This file contains 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
////////////////////////////////////////////////////////////////////////////////////////////// | |
// in der Main Activity | |
////////////////////////////////////////////////////////////////////////////////////////////// | |
public class MainActivity extends AppCompatActivity | |
{ | |
private Button btnPrefs, btnPrefsAnzeigen; | |
private TextView tv; | |
/** | |
* Die SharedPreferences speichern Benutzereinstellungen und lassen |
This file contains 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
////////////////////////////////////////////////////////////////////////////////////////////// | |
// in der Activity | |
////////////////////////////////////////////////////////////////////////////////////////////// | |
public class MainActivity extends AppCompatActivity { | |
private Button btn; | |
private ImageView bild; | |
private Animation animEinklappen, animAusklappen; |
This file contains 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
////////////////////////////////////////////////////////////////////////////////////////////// | |
// in AndroidManifest.xml | |
////////////////////////////////////////////////////////////////////////////////////////////// | |
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package=".......w3t1_impliziteintents_mariab"> | |
<uses-permission android:name="android.permission.CALL_PHONE" /> | |
<uses-permission android:name="android.permission.SEND_SMS" /> |
NewerOlder