IT |
気になる、記になる… |
XのDM(ダイレクトメッセージ)、特定のメッセージを引用して返信する機能が左スワイプの簡単操作に対応 |
https://taisy0.com/2023/08/31/176098.html
|
xnewsdaily |
2023-08-31 08:30:14 |
IT |
気になる、記になる… |
X、音声・ビデオ通話機能の導入はまもなくか ー 認証済みのフォロワー数も表示へ |
https://taisy0.com/2023/08/31/176095.html
|
android |
2023-08-31 08:09:30 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] 「鳩 vs. インターネットが話題ですわ!」「そういう発想のデータ移送手段ってもうあるんですよ」 ITお嬢様小話 |
https://www.itmedia.co.jp/news/articles/2308/31/news179.html
|
itmedia |
2023-08-31 17:50:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] ZOZOスーツで思春期に多い脊柱側湾症を検知 セルフ診断ツール開発へ |
https://www.itmedia.co.jp/news/articles/2308/31/news182.html
|
itmedianewszozo |
2023-08-31 17:44:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] パーソル、AWSエンジニア派遣の新会社 クラウド特化SIerと共同で立ち上げ |
https://www.itmedia.co.jp/news/articles/2308/31/news181.html
|
itmedia |
2023-08-31 17:30:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] 日よけに“値崩れソーラーパネル”はいかが? 自宅で「プチ家庭発電」してみた |
https://www.itmedia.co.jp/news/articles/2308/31/news175.html
|
itmedia |
2023-08-31 17:30:00 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
【Python】線形回帰を使ったシンプルな需要予測 |
https://qiita.com/DeepRecommend/items/74ad9ffc538b8a7195b2
|
xbetaxdotsbetapxpepsilon |
2023-08-31 17:29:19 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
Amazon SNS の Email サブスクリプションを自動で確認できるようにしてみました |
https://qiita.com/hirosys-biz/items/9f37f1b8bb3373d2cab4
|
amazonsns |
2023-08-31 17:53:44 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS CloudShell が起動できない!そんなときの対処法 |
https://qiita.com/hirosys-biz/items/a99b1db1e4f39908ab78
|
awscloudshell |
2023-08-31 17:53:31 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
パッチマネージャーでパッチ適用に失敗した件 |
https://qiita.com/firebird_splash/items/8580901b35c9bf9203a9
|
適用 |
2023-08-31 17:05:32 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
Spring Boot + Maven のチーム開発プロジェクトをEclipseでスタートする |
https://qiita.com/Enokisan/items/ca613b006ae5e0f5a23d
|
pleiadesallinone |
2023-08-31 17:31:51 |
技術ブログ |
Developers.IO |
AWS ParallelCluster 3.7.0 で Ubuntu 22.04 や専用のログインノードの追加など新たにサポートされました |
https://dev.classmethod.jp/articles/aws-parallelcluster-v370-released/
|
awsparallelcluster |
2023-08-31 08:47:13 |
技術ブログ |
Developers.IO |
What exactly is a key in S3? |
https://dev.classmethod.jp/articles/what-exactly-is-a-key-in-s3/
|
What exactly is a key in S Hi this is Charu from Games Solution Department Classmethod I was trying to put object in S bucket that s |
2023-08-31 08:14:01 |
技術ブログ |
Developers.IO |
運用保守のお仕事について |
https://dev.classmethod.jp/articles/how-about-mentainance-work/
|
高崎 |
2023-08-31 08:13:59 |
技術ブログ |
Developers.IO |
[เกร็ดความรู้] เปรียบเทียบคำสั่ง yum และ dnf ใน Amazon Linux 2023 |
https://dev.classmethod.jp/articles/yum-and-dnf-commands-in-amazon-linux-2023/
|
เกร็ดความรู้ เปรียบเทียบคำสั่งyum และdnf ในAmazon Linux yum ถูกใช้เป็นระบบการจัดการแพ็คเกจสำหรับระบบปฏิบัติการที่ใช้OS ตระกูลRHEL เช่นCentOS มาเป็นเวลานานตั้งแต่ |
2023-08-31 08:02:35 |
海外TECH |
DEV Community |
Python Cheat Sheet for Data Engineers and Data Scientists! |
https://dev.to/pavanbelagatti/python-cheat-sheet-for-data-engineers-and-data-scientists-3emj
|
Python Cheat Sheet for Data Engineers and Data Scientists Python has become an indispensable tool for both Data Engineers and Data Scientists due to its simplicity readability and extensive library ecosystem For Data Engineers Python offers robust libraries like Pandas for data manipulation PySpark for big data processing and SQLAlchemy for database interactions making it easier to build scalable data pipelines It also integrates well with cloud services and various data storage systems streamlining the ETL Extract Transform Load processes On the other hand Data Scientists benefit from Python s rich array of machine learning libraries like scikit learn TensorFlow and PyTorch as well as data visualization libraries like Matplotlib and Seaborn Its versatility allows for end to end data analysis from data collection to model deployment all within a single programming environment This commonality of language fosters better collaboration between Data Engineers and Data Scientists making Python a unifying thread in the data ecosystem The PYPL PopularitY of Programming Language Index is created by analyzing how often language tutorials are searched on Google Python Cheat Sheet for Data EnthusiastsThe cheat sheet provided is a concise overview of essential Python topics and libraries commonly used in data engineering and data science Python Basics Variables How to declare and initialize different types of variables x Integery Floatname Alice Stringis valid True Boolean Lists Basic operations for creating and manipulating Python lists my list my list append Adds to the end Dictionaries How to create and use key value pairs in Python dictionaries my dict key value name Alice Loops Using for loops to iterate over a sequence of numbers for i in range print i NumPy Importing NumPy How to import the NumPy library for numerical operations import numpy as np Creating Arrays Creating a basic NumPy array a np array Basic Operations Performing element wise addition and subtraction a b Element wise additiona b Element wise subtraction Pandas Importing Pandas How to import the Pandas library for data manipulation import pandas as pd Creating DataFrame Creating a simple Pandas DataFrame df pd DataFrame col col Reading CSV Reading data from a CSV file into a DataFrame df pd read csv file csv Basic Operations Viewing the first rows and summary statistics of a DataFrame df head First rowsdf describe Summary statistics Matplotlib Importing Matplotlib How to import the Matplotlib library for plotting import matplotlib pyplot as plt Basic Plotting Creating a simple line plot plt plot plt show Scikit Learn Importing Scikit Learn How to import the Scikit Learn library for machine learning from sklearn linear model import LinearRegression Fitting a Model Training a linear regression model model LinearRegression model fit X train y train Making Predictions Using the trained model to make predictions predictions model predict X test SQL Operations with Python Using SQLite How to connect to an SQLite database and execute a SQL query import sqliteconn sqlite connect database db cursor conn cursor cursor execute SELECT FROM table name Data Cleaning with Python Handling Missing Values Dropping or filling missing values in a DataFrame df dropna Drop missing valuesdf fillna Fill missing values with Type Conversion Converting the data type of a DataFrame column df column astype int Convert to integerNote This might not serve as a complete cheat sheet The Data science is a vast field and mentioning everything might not be a possible option If I missed something important please let me know in the comments Checkout my other two articles on Vector Database and LangChain WTF Is a Vector Database A Beginner s Guide Pavan Belagatti・Aug database ai devops developers A Beginner s Guide to Building LLM Powered Applications with LangChain Pavan Belagatti・Aug datascience dataengineering llm database |
2023-08-31 08:48:18 |
海外TECH |
DEV Community |
Laravel101: A Practical Guide for Seeders and Factories |
https://dev.to/kazemmdev/laravel101-a-practical-guide-for-seeders-and-factories-535b
|
Laravel A Practical Guide for Seeders and FactoriesDuring the development process there are times when we need to evaluate the functionality of a system by using data In Laravel we have two useful tools called seeders and factories that help us generate random data In this article we ll explore these tools and learn how to use them effectively The factory class in Laravel acts like a factory that generates random data for our database tables If you navigate to the database factories directory in your project you ll find a class called UserFactory class UserFactory extends Factory public function definition array return name gt fake gt name email gt fake gt unique gt safeEmail email verified at gt now password gt y IXUNpkjOrOQbyMi YeoKoEaRollC og at uheWG igi password remember token gt Str random In each factory class there is an important function called definition that specifies how each attribute should be filled out To accomplish this Laravel utilizes a powerful package called fakerPHP which can generate random data such as names sentences paragraphs and even images You can find more information about the helper functions and features of this package at the following link FakerPHP Faker Documentation for FakerPHP Faker fakerphp github io Another point in UserFactory class is that the string that is considered a fixed password is the hashed word “password Laravel includes a variety of global helper PHP functions and one of them is called Str This helper function is useful for working with strings such as generating random strings You can refer to the documentation for this helper function at here Now let s get back to our project and generate a factory for our tags To create a factory we can use the following artisan command php artisan make factory TagFactoryIt s generally recommended to use a singular name for factory classes However if you want to specify the model while generating the factory you can use the “ m option in the command like this php artisan make factory TagFactory m TagIn our Tag model we only have a simple “name attribute which can be defined as follows use Illuminate Database Eloquent Factories HasFactory class Tag extends Model use HasFactory Once we have set up the factory we can use it to create instances of our model To do this simply call the factory method whenever you want to create a model instance You can also control the number of random data entries you want to generate You can achieve this by using either the factory function or the count function For example if you want to create random tags you can use the following code Tag factory gt create Furthermore it s possible to define a specific attribute with a desired value while generating the data For instance if you want to create users with the name “test but you don t care about the other attributes you can use the following code User factory gt create name gt test In our project we currently have two factories for our user and tag models Now we need to create another factory for our task model When defining the factory model it is important to consider the relational model In our task model each task is associated with a user So what we want to achieve is creating a random task with the id of a given user However during testing your application there might be situations where no user has been created in the environment In such cases generating a random user could be a viable solution To accomplish this you can use factory model again just like bellow public function definition array return title gt fake gt sentence description gt fake gt paragraph expired at gt fake gt dateTimeThisMonth user id gt User factory If you run the code in Tinker you will notice that a new user has been created for the task model Also we have the option to specify a user id when generating a task However I suggest refactoring the code to utilize the users that are likely to already exist in database public function definition array return title gt fake gt sentence description gt fake gt paragraph expired at gt fake gt dateTimeThisMonth user id gt User query gt inRandomOrder gt first gt id User factory To generate random data more efficiently in Laravel we have a better solution than using Tinker It s called a seeder In the database seeders directory you will find a class named DatabaseSeeder which allows us to manage the generation of random data Let s update the DatabaseSeeder class as shown below and then execute an artisan command to run this function class DatabaseSeeder extends Seeder public function run void Task factory gt create And here is the artisan command for seeding php artisan db seedThat s it With Seeder we can easily create a random task record in our database using artisan Additionally we have the flexibility to create multiple seeders for different scenarios To create a seeder you simply need to run php artisan make seed lt seeder name gt command Now let s create a TaskSeeder that generates random task records with each task associated with two random tags namespace Database Seeders use App Models Tag use App Models Task use Illuminate Database Seeder class TaskSeeder extends Seeder public function run void Task factory gt hasTags gt create To run this seeder you can use the artisan command by specifying your desired seed class php artisan db seed TaskSeederOr you can use call method inside DatabaseSeeder to execute your seed classes class DatabaseSeeder extends Seeder public function run void this gt call TaskSeeder class Initial data modelWell sometimes there are certain values that are need to be initialized such as the status of an article e g published or draft or the status of a transaction e g paid or non payment I want to apply a similar approach to tags in this project We have a couple of options to achieve this One option is to store the initial values in a configuration file To do this we can create a PHP file called “defaults at the specified config path and define the desired values there lt phpreturn tags gt php laravel develop backend We can then initialize these values using a migration file Alternatively we can initialize these values using a seeder This means we would define a seeder like TagSeeder that populates the default value in the database Both approaches work but I prefer to use seeder because it s more clear Let s define TagSeeder and initialize it s values class TagSeeder extends Seeder public function run void foreach config defaults tags as value Tag firstOrCreate name gt value As you can see the helper function config in Laravel is utilized to retrieve static information from config files Here I use firstOrCreate method which adds a new tag record only if it hasn t been previously added Great Now let s all come together and work on implementing a scenario like the one described below inside our TaskSeeder namespace Database Seeders use App Models Tag use App Models Task use App Models User use Illuminate Database Seeder class TaskSeeder extends Seeder public function run void create a user with specified credentials user User factory gt create email gt test test dev init tag with defined value this gt call TagSeeder class create random tasks for the user tasks Task factory gt create user id gt user gt id assosiate each generated tasks with predefined tags foreach tasks as task tags Tag query gt inRandomOrder gt take gt pluck id task gt tags gt attach tags Now let s rebuild our database and fill it with this defined seeder To rebuild the database you can run migrate fresh artisan command which will drop all tables and re run all of your migrations And if you login with the user you ll see the tasks generated successfully I hope this explanation clarifies the process of using seeders and factories in Laravel If you have any further questions feel free to ask |
2023-08-31 08:09:57 |
ニュース |
BBC News - Home |
Blue supermoon: World gazes at rare lunar phenomenon |
https://www.bbc.co.uk/news/in-pictures-66662857?at_medium=RSS&at_campaign=KARANGA
|
phenomenon |
2023-08-31 08:39:57 |
ニュース |
BBC News - Home |
Families welcome plan to force offenders into dock after Lucy Letby case |
https://www.bbc.co.uk/news/uk-66667942?at_medium=RSS&at_campaign=KARANGA
|
islam |
2023-08-31 08:07:42 |
ニュース |
BBC News - Home |
Scotland should pilot drug consumption rooms, say MPs |
https://www.bbc.co.uk/news/uk-scotland-66662829?at_medium=RSS&at_campaign=KARANGA
|
office |
2023-08-31 08:37:32 |
ニュース |
BBC News - Home |
Norfolk girl youngest in England with bionic Hero Arm |
https://www.bbc.co.uk/news/uk-england-norfolk-66658943?at_medium=RSS&at_campaign=KARANGA
|
september |
2023-08-31 08:37:26 |
ニュース |
BBC News - Home |
Anonymous Sudan hacks X to put pressure on Elon Musk over Starlink |
https://www.bbc.co.uk/digihub/technology-66657897?at_medium=RSS&at_campaign=KARANGA
|
anonymous |
2023-08-31 08:20:31 |
ニュース |
BBC News - Home |
Nebraska college volleyball match sets women's sport attendance record |
https://www.bbc.co.uk/sport/volleyball/66667888?at_medium=RSS&at_campaign=KARANGA
|
Nebraska college volleyball match sets women x s sport attendance recordA crowd of fans watch Nebraska beat Omaha at their Memorial Stadium to set a new record attendance for a women s sporting event |
2023-08-31 08:16:25 |
ビジネス |
不景気.com |
印刷業の「サンプリンティングシステム」が破産、負債10億円 - 不景気com |
https://www.fukeiki.com/2023/08/sun-printing-system.html
|
株式会社 |
2023-08-31 08:17:49 |
マーケティング |
MarkeZine |
生成AIの台頭など、激変するデジタル環境でも投資対効果を得る ルシダスの戦略構築法【参加無料】 |
http://markezine.jp/article/detail/43326
|
参加無料 |
2023-08-31 17:30:00 |
マーケティング |
MarkeZine |
【参加無料】ホットリンクが語る認知&売上upにつながるSNS活用術 鉄則となる「七つのデータ」とは? |
http://markezine.jp/article/detail/43325
|
参加無料 |
2023-08-31 17:15:00 |
IT |
週刊アスキー |
ホームランピンバッジを配布! 「王貞治ベースボールミュージアム」で9月3日のホームラン記念日特別企画を開催。9月2日から |
https://weekly.ascii.jp/elem/000/004/153/4153321/
|
特別企画 |
2023-08-31 17:45:00 |
IT |
週刊アスキー |
ログインでガシャチケット最大40枚もらえる!『プルプロ』で「週末ブーストイベント」を開催 |
https://weekly.ascii.jp/elem/000/004/153/4153404/
|
blueprotocol |
2023-08-31 17:45:00 |
IT |
週刊アスキー |
アニメ「NARUTO-ナルト-」の歴史を振り返ろう! 「NARUTO THE GALLERY FUKUOKA」開催 |
https://weekly.ascii.jp/elem/000/004/153/4153323/
|
bosse |
2023-08-31 17:30:00 |
IT |
週刊アスキー |
『ウマ娘』1900万DL突破!ジュエル1500個をプレゼント |
https://weekly.ascii.jp/elem/000/004/153/4153399/
|
twitter |
2023-08-31 17:20:00 |
IT |
週刊アスキー |
“音楽都市・福岡”を発信 9月に「Fukuoka Music Month 2023」として4つの音楽フェス開催 |
https://weekly.ascii.jp/elem/000/004/153/4153320/
|
fukuokamusicmonth |
2023-08-31 17:15:00 |
IT |
週刊アスキー |
ヤフオク! トレカ真贋鑑定サービス開始 「マジック:ザ・ギャザリング」「遊戯王」「ポケモンカード」が対象 |
https://weekly.ascii.jp/elem/000/004/153/4153365/
|
鑑定 |
2023-08-31 17:15:00 |
IT |
週刊アスキー |
D3PがPS Storeの「PS Plus Double Discounts Sale」への提供タイトルを発表! |
https://weekly.ascii.jp/elem/000/004/153/4153358/
|
playstationstore |
2023-08-31 17:10:00 |
IT |
週刊アスキー |
9月3日まで33%オフ!スマホ版『ドラゴンクエストV 天空の花嫁』が特別セールを開催 |
https://weekly.ascii.jp/elem/000/004/153/4153360/
|
期間限定 |
2023-08-31 17:10:00 |
IT |
週刊アスキー |
“国内最大級”のeスポーツ施設「ASH WINDER Esports ARENA高田馬場店」、9月4日オープン |
https://weekly.ascii.jp/elem/000/004/153/4153325/
|
ashwinderesportsarena |
2023-08-31 17:30:00 |
コメント
コメントを投稿