Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
import openai | |
import asyncio | |
from typing import Any | |
async def dispatch_openai_requests( | |
messages_list: list[list[dict[str,Any]]], | |
model: str, | |
temperature: float, | |
max_tokens: int, | |
top_p: float, |
import { getAuth, withClerkMiddleware } from "@clerk/nextjs/server"; | |
import { NextResponse, NextFetchEvent } from "next/server"; | |
import type { NextRequest } from "next/server"; | |
import { Ratelimit } from "@upstash/ratelimit"; | |
import { Redis } from "@upstash/redis"; | |
// Add public paths for Clerk to handle. | |
const publicPaths = ["/", "/sign-in*", "/sign-up*", "/api/blocked"]; | |
// set your rate limit. |
var requestStartTime = Date.now() | |
const stream = new ReadableStream({ | |
async start(controller) { | |
const onParse = (event: ParsedEvent | ReconnectInterval) => { | |
if (event.type === "event") { | |
const data = event.data; | |
if (data === "[DONE]") { | |
controller.close(); |
<!-- | |
How to load Font Awesome asynchronously | |
Use: Just put this script on the bottom/footer of your web | |
--> | |
<script type="text/javascript"> | |
(function() { | |
var css = document.createElement('link'); | |
css.href = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css'; |
Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
ActivityTweet | |
generic_activity_highlights | |
generic_activity_momentsbreaking | |
RankedOrganicTweet | |
suggest_activity | |
suggest_activity_feed | |
suggest_activity_highlights | |
suggest_activity_tweet |
func playAudio() { | |
do { | |
if let fileURL = Bundle.main.path(forResource: "Game Show Win", ofType: "wav") { | |
audioPlayer = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: fileURL)) | |
audioPlayer?.volume = 0.4 | |
} else { | |
print("No file with specified name exists") | |
} | |
} catch let error { |
// RoommateMatchQuestionViewController.swift | |
let vc = RoommateMatchQuestionViewController.newInstance() | |
vc.viewModel = self.viewModel.viewModelForNextQuestion() | |
let transition = CATransition() | |
transition.duration = 0.5 | |
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) | |
transition.type = kCATransitionFade |
extension UIView { | |
func findFirstSuperview<T>(ofClass viewClass: T.Type, where predicate: (T) -> Bool) -> T? where T: UIView { | |
var view: UIView? = self | |
while view != nil { | |
if let typedView = view as? T, predicate(typedView) { | |
break | |
} | |
view = view?.superview | |
} |