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
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:google_sign_in/google_sign_in.dart'; | |
| import 'package:google_sign_in_web/google_sign_in_web.dart'; | |
| import 'package:google_sign_in_web/web_only.dart' as web; | |
| void main() { | |
| runApp(const MyApp()); | |
| } |
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
| import os | |
| import vertexai | |
| from vertexai.generative_models import GenerativeModel | |
| # This will set an environment variable just for this script | |
| os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = "<your private key path>" | |
| vertexai.init(project='<your_proj_id>', location='us-central1') | |
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
| import 'package:camera/camera.dart'; | |
| import 'package:flutter/material.dart'; | |
| /// CameraApp is the Main Application. | |
| class CameraView extends StatefulWidget { | |
| /// Default Constructor | |
| const CameraView({super.key}); | |
| @override | |
| State<CameraView> createState() => _CameraViewState(); |
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
| from flask import Flask, send_file, render_template_string | |
| from google.cloud import storage | |
| import os | |
| import io | |
| app = Flask(__name__) | |
| # Configure the environment variable for GCS credentials | |
| os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/your/service-account-file.json" |
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
| import json | |
| import logging | |
| from typing import List, Dict, Any | |
| from langchain_google_vertexai import VertexAI | |
| from langchain.prompts import PromptTemplate | |
| from langchain_core.output_parsers import JsonOutputParser | |
| from langchain.output_parsers import OutputFixingParser | |
| from langchain_core.pydantic_v1 import BaseModel, Field | |
| from langchain_core.runnables.base import RunnableSerializable |
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
| import asyncio | |
| from quart import Quart, request | |
| app = Quart(__name__) | |
| @app.route('/', methods=['GET']) | |
| async def sleep(): | |
| await asyncio.sleep(4) | |
| print("received request") | |
| return 'Slept for 400ms' |
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
| from urllib.request import urlopen | |
| from urllib import request | |
| resp = urlopen("https://api.ipify.org") | |
| ip = resp.read().decode('utf-8').strip() | |
| f = open('last_ip.txt', 'r+') | |
| last_ip = f.read().strip() | |
| if (ip != last_ip): |
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
| import { LightningElement, track } from 'lwc'; | |
| import { subscribe, unsubscribe, onError, setDebugFlag, isEmpEnabled } from 'lightning/empApi'; | |
| export default class Geofenceevent extends LightningElement { | |
| @track channelName = '/event/GeoFenceTrip__e'; | |
| @track isSubscribeDisabled = false; | |
| @track isUnsubscribeDisabled = !this.isSubscribeDisabled; | |
| subscription = {}; |
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 main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func doSomework(imDone chan bool, stopMe chan bool, breakTime int, name string) { | |
| outer: | |
| for { |
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 main | |
| import ( | |
| "testing" | |
| "fmt" | |
| ) | |
| func getDrone() *Drone { | |
| d := &Drone{} | |
| d.CurrentPosition = GPSCoord{3, 3} |
NewerOlder