python |
Pythonタグが付けられた新着投稿 - Qiita |
動画ファイルからテキスト抽出がWhisperを使えば数十分で実装できた話 |
https://qiita.com/ShinyaNakayama/items/8ab7a0033a99b2644066
|
whisper |
2023-04-09 09:56:44 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Solafune 超解像度化コンペ(5倍)3位解法 |
https://qiita.com/roniheka/items/bae0030c477a58f2397c
|
privatelb |
2023-04-09 09:29:39 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
画像検索スライドショー (ChatGPT活用 Part1) |
https://qiita.com/histonoby/items/6863b1f4e0841b9ce901
|
chatgpt |
2023-04-09 09:04:06 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
NCMBの管理画面をGoogle Chrome機能拡張で便利にする(データストアのデータ削除) |
https://qiita.com/goofmint/items/780ba32165df5c1b6435
|
google |
2023-04-09 09:35:21 |
海外TECH |
DEV Community |
Building a Notes App with Next.js 13 |
https://dev.to/bujai/building-a-notes-app-with-nextjs-13-5gcd
|
Building a Notes App with Next js In this blog we ll build a notes application using Next js Most if not all of the stuff I ve learned that is needed to build this app came from Fireship s video about Next js I highly recommend watching the video as it provides great information about Next js With that being said lets go ahead and build the app Installing Next js Before we create a our Next js application we first have to make sure that you have these requirements Node js or laterBe on MacOS Windows including WSL or LinuxTo create your Next js project type the following command npx create next app latest experimental appIf you want to follow along with me these are the options I selected during the project initialization Setting up the DatabaseFor our database we will be using PocketBase To know more about PocketBase you can go to their official website or watch a video about it Fireship s PocketBase video To setup PocketBase download its zip archive that can be found on their docs Unzip the folder and place the exe file on your project structure Once done type this command on the CLI pocketbase serveOnce done the CLI should have two links that you can click on Click the link under “Admin UI It should open up a new tab on your browser If prompted create your admin account On the PocketBase Admin UI tab create a new collection called “notes During the creation of the notes collection add two fields “title and “notes make sure the fields is set to take “Plain text After creating the fields navigate to “API Rules and click all rules to unlock them FieldsAfter these steps your database should be set up Next js Notes AppUnder the app directory delete all the files and folders Create a new file page jsx this will serve as our home page Copy the following lines of code export default function HomePage return lt div gt lt h gt Home Page lt h gt lt p gt Click Notes to view the all of your notes lt p gt lt div gt After creating the file above we ll create layout jsx with which we ll add a global nav bar Copy the code below and paste it on layout jsx import Link from next link import globals css export const metadata title Next js description Generated by Next js export default function RootLayout children return lt html lang en gt lt body gt lt main gt lt nav gt lt Link href gt Home lt Link gt lt Link href notes gt Notes lt Link gt lt nav gt children lt main gt lt body gt lt html gt Create globals css and copy the code box sizing border box html body padding margin font family apple system BlinkMacSystemFont Segoe UI Roboto Oxygen Ubuntu Cantarell Fira Sans Droid Sans Helvetica Neue sans serif padding rem a color inherit text decoration none padding margin nav a font weight bold margin rem text decoration underline Notes directoryUnder app create a folder named notes This will serve as our notes route Under the notes folder create a file called page jsx and insert the following lines of code import Link from next link import styles from Notes module css async function getNotes const response await fetch api collections notes records page amp perPage cache no store const data await response json return data items export default async function NotesPage const notes await getNotes return lt div gt lt h gt Notes Page lt h gt lt div className styles grid gt notes map note gt return lt Note key note id note note gt lt div gt lt div gt function Note note const id title content created note return lt Link href notes id gt lt div className styles note gt lt h gt title lt h gt lt p gt content lt p gt lt p gt created lt p gt lt div gt lt Link gt We can fetch data from the component itself since every Next js component is a Server Component by default Create Notes module css and copy the following code grid margin top rem display flex align items flex start justify content flex start flex wrap wrap max width px note height auto width px padding rem rem margin rem background ffff box shadow px px px px border radius px title padding rem font size rem content font size rem font weight normal created font size rem font weight lighter Dynamic Notes RouteUnder our notes directory create a folder id that contains another page jsx On the page jsx copy the following code import Link from next link import styles from Notes module css async function getNote noteId const response await fetch api collections notes records noteId next revalidate const data await response json return data export default async function NotesPage params const note await getNote params id return lt div gt lt h gt Note ID note id lt h gt lt div className styles note gt lt h gt note title lt h gt lt p gt note content lt p gt lt p gt note created lt p gt lt div gt lt Link href notes gt Go Back lt Link gt lt div gt Launch AppOnce we ve written the code listed above we can now launch our Next js project Execute the following command in the command line npm run devOnce launched http localhost it directs into the home screen that says to click “Notes at the navbar to view our notes Currently there s no notes to fix this go to our PocketBase Admin UI and add notes by clicking “New record Once notes have been added refresh the Next project and you should see your notes Thanks for taking the time to read my blog Hopefully you have learned something new To know more about Next js I highly recommend reading their docs and or watching videos about the topic |
2023-04-09 00:35:18 |
海外TECH |
DEV Community |
Testing Applications In Laravel. |
https://dev.to/rebelnii/testing-applications-in-laravel-1899
|
Testing Applications In Laravel Exploring Uncommon Error Messages When Running Tests in LaravelHello developers Welcome to my first episode in the Testing Applications in Laravel series In this series I will discuss different topics related to testing Laravel applications Today I will be discussing some rare errors that you might encounter while running tests in Laravel When it comes to testing encountering errors is inevitable It can be frustrating and it s common to feel like screaming at your computer However with a little knowledge and understanding you can quickly fix these errors and make your tests pass Today we shall discuss Error Test code or tested code did not only close its own output buffers The error message Error Test code or tested code did not only close its own output buffers is a common issue in PHPUnit tests when output buffering is used Output buffering is a feature in PHP that allows you to capture the output of a script and manipulate it before it is sent to the browser When PHPUnit tests are run they capture any output from the test code and compare it with the expected output If there is any output left in the buffer after the test is complete it can cause this error A junior developer reached out to me seeking assistance with the Error Test code or tested code did not only close its own output buffers issue She had tried several methods but none seemed to work It brought back memories from when I first encountered this error and I remember how frustrating it was to solve Unfortunately most articles related to this error are outdated or not clearly explained which can make it challenging for junior developers to understand and resolve the issue The issue with this error is that it can be difficult to diagnose because it doesn t always output a clear error message In many cases the console will generate a more specific error message that can help us pinpoint the root cause of the issue This is why it s important to pay close attention to any error messages that are generated by your application and use them as a starting point for troubleshooting So to solve this error we need to retrieve the output buffer levels using ob get level This allows us to check whether there are any open output buffers that haven t been closed We then retrieve the contents of the output buffer using ob get contents and clear the buffer using ob end clean It s important to note that many solutions online advise using ob start at the beginning of the test and ob end clean at the end However this doesn t always work for complex test cases Now let s move on to the coding part and see how we can implement this solution lt phpnamespace Tests Unit V Admin Vehicle use App Http Livewire Admin Vehicle Add use App Models User use Illuminate Foundation Testing RefreshDatabase use Illuminate Foundation Testing WithoutMiddleware use Illuminate Http UploadedFile use Illuminate Support Facades Auth use Illuminate Support Facades Storage use Livewire Livewire use Tests TestCase class VehicleTest extends TestCase use RefreshDatabase WithoutMiddleware public function test create new vehicle entry with file upload ob start Storage fake avatars user User factory gt create this gt actingAs user Auth login user file UploadedFile fake gt image avatar jpg Livewire test Add class gt set name gt Toyota reg num gt GD vin num gt kajsy status gt true home away gt true image gt file transmission gt automatic price gt fuel gt petrol mileage gt gt call create gt assertSet image file gt name gt assertHasNoErrors name reg num Storage disk avatars gt assertExists file gt hashName this gt assertAuthenticatedAs user this gt assertTrue Auth check this gt assertDatabaseHas vehicles name gt Toyota reg num gt GD vin num gt kajsy serviced gt null status gt true home away gt true transmission gt automatic price gt fuel gt petrol ob get contents ob end clean In the code block above we are writing a test to add a new vehicle record to the database Now I have intentionally added code blocks to specifically throw Error Test code or tested code did not only close its own output buffers which is assertSet image file Let s take a look a the console when we run this test despite including ob start and ob end clean There was risky test Tests Unit V Admin Vehicle VehicleTest test create new vehicle entry with file uploadTest code or tested code did not only close its own output buffersF projects Laravel live tests Unit V Admin Vehicle VehicleTest php FAILURES Tests Assertions Failures Risky The error message still isn t clearly stated now I m going to refactor the code and run the test public function test create new vehicle entry with file upload while ob get level gt ob end clean Storage fake avatars user User factory gt create this gt actingAs user Auth login user file UploadedFile fake gt image avatar jpg Livewire test Add class gt set name gt Toyota reg num gt GD vin num gt kajsy status gt true home away gt true image gt file transmission gt automatic price gt fuel gt petrol mileage gt gt call create gt assertSet image file gt name gt assertHasNoErrors name reg num Storage disk avatars gt assertExists file this gt assertAuthenticatedAs user this gt assertTrue Auth check this gt assertDatabaseHas vehicles name gt Toyota reg num gt GD vin num gt kajsy serviced gt null status gt true home away gt true transmission gt automatic price gt fuel gt petrol ob get contents ob end clean I have replaced ob start with ob get level in a conditional statement that ll trigger ob end clean when it surpasses Let s take a look at the error message PS F projects Laravel live gt vendor bin phpunit filter VehicleTestPHPUnit by Sebastian Bergmann and contributors Runtime PHP Configuration F projects Laravel live phpunit xmlF Time Memory MBThere was failure Tests Unit V Admin Vehicle VehicleTest test create new vehicle entry with file uploadFailed asserting that two strings are equal Expected Actual avatar jpg livewire file RxzKXRUzsbLTNIHbWBFtHgfTLRb metaYXZhdGFyLmpwZw size jpg F projects Laravel live vendor livewire livewire src Testing Concerns MakesAssertions php F projects Laravel live tests Unit V Admin Vehicle VehicleTest php F projects Laravel live vendor laravel framework src Illuminate Foundation Testing TestCase php FAILURES Tests Assertions Failures Now we get a clear error message that will allow us to properly Debug our code Now that we have a clear understanding of how to handle the Error Test code or tested code did not only close its own output buffers issue we ll be diving deeper into the topic of debugging in our next episode We ll cover some essential tools and techniques that every developer should have in their toolkit to troubleshoot issues quickly and effectively Stay tuned Be sure to follow me on twitter github showwcase at rebelnii and subscribe to my YouTube |
2023-04-09 00:29:23 |
ニュース |
BBC News - Home |
British-Israeli sisters killed in West Bank shooting named |
https://www.bbc.co.uk/news/world-middle-east-65222234?at_medium=RSS&at_campaign=KARANGA
|
efrat |
2023-04-09 00:39:00 |
ニュース |
BBC News - Home |
Ben Ferencz: Last surviving Nuremberg prosecutor dies, aged 103 |
https://www.bbc.co.uk/news/world-65223756?at_medium=RSS&at_campaign=KARANGA
|
crimes |
2023-04-09 00:02:03 |
ニュース |
BBC News - Home |
The papers: Strike 'desperate measures' and 'Olivia mum speaks' |
https://www.bbc.co.uk/news/blogs-the-papers-65223825?at_medium=RSS&at_campaign=KARANGA
|
The papers Strike x desperate measures x and x Olivia mum speaks x No one story dominates the Sunday papers however a couple of the headlines look ahead to King Charles coronation next month |
2023-04-09 00:23:44 |
海外TECH |
reddit |
FlyQuest vs. Golden Guardians / LCS 2023 Spring Playoffs - Losers' Bracket Final / Post-Match Discussion |
https://www.reddit.com/r/leagueoflegends/comments/12g3mie/flyquest_vs_golden_guardians_lcs_2023_spring/
|
FlyQuest vs Golden Guardians LCS Spring Playoffs Losers x Bracket Final Post Match DiscussionLCS SPRING PLAYOFFS Official page Leaguepedia Liquipedia Live Discussion Eventvods com New to LoL FlyQuest Golden Guardians Golden Guardians advance to finals to face Cloud and more importantly qualifies for MSI and is taking a trip to London FLY Leaguepedia Liquipedia Website Twitter Facebook YouTube Subreddit GG Leaguepedia Liquipedia Website Twitter Facebook YouTube Subreddit MATCH FLY vs GG Winner FlyQuest in m Match History Game Breakdown Bans Bans G K T D B FLY caitlyn sejuani vi gwen olaf k M HT H O O B E GG annie lucian lulu rakan nautilus k H FLY vs GG Impact sion TOP fiora Licorice Spica maokai JNG elise River VicLa jayce MID ksante Gori Prince xayah BOT zeri Stixxay Eyla braum SUP leona huhi MATCH GG vs FLY Winner Golden Guardians in m Match History Game Breakdown Bans Bans G K T D B GG lulu lucian maokai rakan sylas k H CT H O O O B FLY annie caitlyn elise renataglasc soraka k M B B GG vs FLY Licorice kennen TOP sion Impact River wukong JNG vi Spica Gori lissandra MID taliyah VicLa Stixxay zeri BOT xayah Prince huhi jarvaniv SUP heimerdinger Eyla MATCH FLY vs GG Winner FlyQuest in m Match History Game Breakdown Bans Bans G K T D B FLY sejuani vi lissandra gwen malphite k CT I H B C GG annie lucian varus blitzcrank ksante k H C B C FLY vs GG Impact ornn TOP olaf Licorice Spica maokai JNG wukong River VicLa jayce MID taliyah Gori Prince jinx BOT caitlyn Stixxay Eyla rakan SUP heimerdinger huhi MATCH GG vs FLY Winner Golden Guardians in m Match History Bans Bans G K T D B GG sion wukong sejuani leblanc veigar k H B CT FLY annie caitlyn maokai jayce yone k M H I CT GG vs FLY Licorice malphite TOP ksante Impact River elise JNG gragas Spica Gori tristana MID sylas VicLa Stixxay xayah BOT lucian Prince huhi rakan SUP nami Eyla MATCH FLY vs GG Winner Golden Guardians in m Match History Game Breakdown Bans Bans G K T D B FLY sejuani malphite vi gwen taliyah k M H HT GG annie maokai wukong zeri varus k H I I B I FLY vs GG Impact sion TOP fiora Licorice Spica elise JNG jarvaniv River VicLa jayce MID lissandra Gori Prince xayah BOT lucian Stixxay Eyla rakan SUP nami huhi This thread was created by the Post Match Team submitted by u gandalf to r leagueoflegends link comments |
2023-04-09 00:36:58 |
コメント
コメントを投稿