TECH |
Engadget Japanese |
「 Qualcomm aptX Lossless」発表。BluetoothでCDロスレスオーディオを伝送 |
https://japanese.engadget.com/apt-x-lossless-185039795.html
|
aptxlossless |
2021-09-01 18:50:39 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
[Swift]レスポンスのBodyの値によって処理を分けたい |
https://teratail.com/questions/357307?rss=all
|
SwiftレスポンスのBodyの値によって処理を分けたい前提・実現したいことのAPIから返ってきたレスポンスから値を取得して処理をしたいです。 |
2021-09-02 03:44:47 |
海外TECH |
Ars Technica |
New Surface hardware is likely to surface at Microsoft’s September 22 event |
https://arstechnica.com/?p=1791198
|
september |
2021-09-01 18:14:32 |
海外TECH |
Ars Technica |
Google reportedly optimistic about Pixel 6 sales, increases production by 50% |
https://arstechnica.com/?p=1791128
|
chain |
2021-09-01 18:05:46 |
海外TECH |
DEV Community |
Python script to delete files older than 1 day, delete empty sub-directories recursively and create a log file for records! |
https://dev.to/shuvohoque/python-script-to-delete-files-older-than-1-day-delete-empty-sub-directories-recursively-and-create-a-log-file-for-records-3p38
|
Python script to delete files older than day delete empty sub directories recursively and create a log file for records Who doesn t like to automate repetitive manual tasks right But there a question comes in our mind why do we need to automate this particular file and folder deletion process And what is the benefit we ll get Don t worry I ve got an answer for you It is often necessary to delete files within a directory that are older than a particular number of days This is especially the case with archive directories Without performing routine maintenance these archives can begin consuming large amounts of disk space in the server or your local machine Cleaning file system regularly and manually seems time consuming and painful Creating a script to remove older archives makes the maintenance process fast and painless Here comes Python to make our lives easier Python is an excellent programming language for scripting You can use the same code for different operating systems i e windows linux ubuntu or ios So Lets jump into our scripting In this automate process we ll list down all files and folders recursively inside a directory And among those older files and empty subdirectories need to be deleted as well Last but not the least a log file will be created to keep the records of this execution Here are the requirements we need to consider first Create a script which will delete files and sub folders in a directory recursively which are older than a day A list of each file inside the directory before delete and put them in a log file A list of all subfolders inside the directory before delete and put them in a log fileIf a subfolder has a recent file do not delete the folder Delete the older files only But if a subfolder is empty then delete the subfolder Keep the records of deletion in the log file and scripts execution and stop date time Log has to be a rolling log like everyday it creates a new log with date Not appended to single log file let s breakdown our todo to solve this problem We need to input a directory where we will run our scriptWe need to input a directory where we will save our log fileCreate a log file in the given directory in step and name it uniquely with timestamp Inside the given directory we will search all files and folders recursively Get the latest modification date of each file and compare with preferable date Check how older the files are and if the files are older than one day we need to delete those Check whether subfolders or subdirectories are empty or not If any of the subfolders are empty then we also need to delete it Finally we need to keep the records of every files folders some metadata and delete status in the log file Now we are good to go to write the script Please go through all the comments in the script to understand every steps there Python import timeimport osfrom glob import glob iglobfrom pathlib import Pathimport globimport datetime from datetime import datetimeimport sys Directory validation functiondef valid dir dir Checking if the path exists or not if not os path exists dir Get current directory where the script has been executed cwd os getcwd Create txt file for log f open cwd log createdAt str datetime now timestamp txt w Write in the txt file f write Script execution started at str currentDate n n f write This is not a valid path n n f write Script execution stopped at str currentDate n n print Please provide valid path exit sys exit Checking if it is directory or not if not os path isdir dir Get current directory where the script has been executed cwd os getcwd Create txt file for log f open cwd log createdAt str datetime now timestamp txt w Write in the txt file f write Script execution started at str currentDate n n f write This is not a valid directory path n n f write Script execution stopped at str currentDate n n print Please provide directory path exit sys exit Function to convert list into string def listToString s initialize an empty string str return string return str join s Function to list all files and folders recursively inside a directory def search filesNFolders root dir log dir Date to compare with file modification date compareDate datetime today Iteration integer i Create txt file for log f open log dir log createdAt str datetime now timestamp txt w f write Script execution started at str currentDate n n f write Script execution Directory root dir n f write Log file Directory log dir n n f write Date to check with how older the file is str compareDate n n Loop to search all files and folders in the given directory recursively for currentpath folders files in os walk root dir currentpath replace f write Current path currentpath f write n currentpath replace Iteration integer i i i Check whether there are any folders in each path or not i e length of folders list Here there are no folders inside the current directory if len folders Writing the number of files and folders in the log file f write Number of Folders n f write Number of Files str len files n Check whether there are any files in each folders in the same directory or not i e length of files list if len files Delete the subfolder as it is empty No files and No folders inside os rmdir currentpath f write Note This empty directory has been deleted n else f write Filenames n print Folders Here there are subfolders inside the current directory else f write Number of Folders str len folders n f write Foldernames listToString folders n f write Number of Files str len files n If there are files inside the current directory if len files f write Filenames n print folders Loop to get the metadata and check each file inside current directory for file in files Get the modification time of each file t os stat os path join currentpath file Check how older the file is from compareDate filetime datetime fromtimestamp t compareDate print filetime days Log the record of file modification date time f write str i file n Modifiction date str datetime fromtimestamp t n File path currentpath file n i i Check if file is older than day if filetime days lt Remove the file os remove currentpath file Write the delete status in log file f write Note This file has been deleted n n print Deleted else print Not older than day print file f write n n Execution stopped time recorded in log file f write Script execution stopped at str datetime today strftime Y m d H M S n n if name main Define the directory where you want to run this script root dir C Users Zeaul Shuvo Music Test root dir input Enter the directory path here for script execution Define the directory where you want to log the records log dir C Users Zeaul Shuvo Music log dir input Enter the directory path here for log file Current date currentDate datetime today strftime Y m d H M S Calling the function to validate the root directory valid dir root dir Calling the function to validate the log file directory valid dir log dir Calling the function to search files and folders delete the older files and empty folders and keep record in log file search filesNFolders root dir log dir exit sys exit Now I m Kidding Here is a screen shot of the log file txt file where we are keeping all the records of script execution Remember We need to keep the script execution start time and stop time in the log file In every case we need to keep this time records in log file This helps us to track the activity of script execution We are done Happy Scripting Any questions or suggestions are welcomed Waiting for your valuable words Thank you |
2021-09-01 18:11:08 |
海外TECH |
DEV Community |
Nextless V1 launched: Full-Stack React SaaS Boilerplate with Auth and Payment |
https://dev.to/ixartz/nextless-v1-launched-full-stack-react-saas-boilerplate-with-auth-and-payment-4ca1
|
Nextless V launched Full Stack React SaaS Boilerplate with Auth and PaymentNextless js V is now available after one month of refactoring to make the code easier to start any SaaS products Built with the latest technologies Next JSReactTypeScriptTailwind CSSReact Hook FormESLint Prettier and HuskyServerless frameworkAWS CDK AuthenticationStripe IntegrationFind more information at Nextless SaaS Boilerplate TemplateSetup a landing page for your SaaS business and get a user dashboard without losing any development and design time Here is an example Find more information at Nextless SaaS Boilerplate Template |
2021-09-01 18:09:58 |
海外TECH |
DEV Community |
How to use MySql with Django - For Beginners |
https://dev.to/sm0ke/how-to-use-mysql-with-django-for-beginners-2ni0
|
How to use MySql with Django For BeginnersHello Coders This article explains How to use MySql with Django and switch from the default SQLite database to a production ready DBMS MySql This topic might sound like a trivial subject but during my support sessions I got this question over and over especially from beginners For newcomers Django is a leading Python web framework built by experts using a bateries included concept Being such a mature framework Django provides an easy way to switch from the default SQLite database to other database engines like MySql PostgreSQL or Oracle MySql is a powerful open source relational database where the information is correlated and saved in one or more tables Thanks for reading Content provided by App Generator Django Database SystemDjango provides a generic way to access multiple database backends using a generic interface In theory Django empowers us to switch between DB Engines without updating the SQL code The default SQLite database usually covers all requirements for small or demo projects but for production use a more powerful database engine like MySql or PostgreSQL is recommended The database settings are saved in the file referred by manage py file In my Django projects this file is saved inside the core directory lt PROJECT ROOT gt manage py Specify the settings file core Implements app logic settings py Django app bootstrapper wsgi py Start the app in production urls py Define URLs served by all apps nodesLet s visualize the contents of the settings py file that configures the database interface File core settings py DATABASES default ENGINE django db backends sqlite NAME db sqlite The above snippet is provided by when Django scaffolds the project We can see that the SQLite driver is specified by the ENGINE variable Update Django for MySqlTo use MySql as the backend engine for a Django project we need to follow a simple setup Install the MySql Server we can also use a remote one Install the Mysql Python driver used by Django to connect and communicateCreate the Mysql database and the user Update settings DjangoExecute the Django migration and create the project tables Install MySql ServerThe installation process is different on different systems but this phase should not be a blocking point because Unix systems provide by default a MySql server and for Windows we can use a visual installer For more information please access the download page and select the installer that matches your operating system MySql official websiteMySql Downloads page Install the Python DriverTo successfully access the Mysql Engine Django needs a driver aka a connector to translate the Python queries to pure SQL instructions pip install mysqlclientThe above instruction will install the Python MySql driver globally in the system Another way is to use a virtual environment that sandboxes the installation Create and activate the virtual environment virtualenv env source env bin activate install the mysql driver pip install mysqlclient Create the MySql DatabaseDuring the initial setup Django creates the project tables but cannot create the database To have a usable project we need the database credentials used later by the Django project The database can be created visually using a database tool like MySQL Workbench or using the terminal CREATE DATABASE mytestdb Create a new MySql userCREATE USER test localhost IDENTIFIED BY Secret Grant all privileges to the newly created userGRANT ALL PRIVILEGES ON mytestdb TO test localhost FLUSH PRIVILEGES Update Django SettingsOnce the MySql database is created we can move on and update the project settings to use a MySql server File core settings py DATABASES default ENGINE django db backends mysql lt UPDATED line NAME mytestdb lt UPDATED line USER test lt UPDATED line PASSWORD Secret lt UPDATED line HOST localhost lt UPDATED line PORT Start the projectThe next step in our simple tutorial is to run the Django migration that will create all necessary tables Create tables python manage py makemigrations python manage py migrateStart the Django project Start the application development mode python manage py runserverAt this point Django should be successfully connected to the Mysql Server and we can check the database and list the newly created tables during the database migration Thanks for reading For more resources feel free to access Django Dashboards a curated index with simple startersFree Dashboards open source projects crafted in different technologies Flask Django React |
2021-09-01 18:09:31 |
Apple |
AppleInsider - Frontpage News |
Twitter launches 'Super Follows,' allowing creators to monetize tweets |
https://appleinsider.com/articles/21/09/01/twitter-launches-super-follows-allowing-creators-to-monetize-tweets?utm_medium=rss
|
Twitter launches x Super Follows x allowing creators to monetize tweetsTwitter on Wednesday officially launched its Super Follows feature which allows creators on the platform to provide exclusive premium content to subscribers Credit TwitterThe social media company characterizes the feature as a way for creators to monetize their Twitter presence and creative an extra level of conservation on Twitter Twitter first announced the feature earlier in and leaks in June indicated that a launch was close Read more |
2021-09-01 18:34:42 |
Apple |
AppleInsider - Frontpage News |
Backblaze & Vultr cloud partner to fight Amazon AWS |
https://appleinsider.com/articles/21/09/01/backblaze-partners-with-vultr-cloud-launches-amazon-aws-rival?utm_medium=rss
|
Backblaze amp Vultr cloud partner to fight Amazon AWSBackup company Backblaze has launched a cloud computing service with Vultr intending to provide developers with a lower cost alternative to Amazon s S and EC web services Backblaze has partnered with Vultr to offer cloud computingThrough the new service Backblaze and Vultr users can run applications with virtualized cloud compute and bare metal resources The companies say that their new service is simpler to use and addresses the typically disproportionately huge bandwidth costs that smaller companies face Read more |
2021-09-01 18:27:12 |
Apple |
AppleInsider - Frontpage News |
Apple reveals first states to use Apple Wallet for ID, driver's licence |
https://appleinsider.com/articles/21/09/01/apple-reveals-first-states-to-use-apple-wallet-for-id-drivers-licence?utm_medium=rss
|
Apple reveals first states to use Apple Wallet for ID driver x s licenceApple has announced that Arizona and Georgia are to support Apple Wallet for state ID and drivers licences in iOS with six more states to follow Apple Wallet will be able to store your drivers licence in certain statesApple has long been preparing to have passports and other ID stored on iPhones and iOS will add support for it Now the company has announced seven states that have signed on to accept ID through Apple Wallet Read more |
2021-09-01 18:25:50 |
海外TECH |
Engadget |
Apple reportedly asks US employees to share their vaccination status |
https://www.engadget.com/apple-vaccination-status-report-185408210.html?src=rss
|
Apple reportedly asks US employees to share their vaccination statusApple has asked all of its US employees to share their vaccination status voluntarily According to Bloomberg the company recently sent out a memo requesting workers whether they currently work out of an office or not to share that information by September th Apple reportedly plans to use the data it collects to inform its ongoing COVID response nbsp Bloomberg reports the company told employees it would keep their vaccine status “confidential and secure by aggregating the information but said that could change in the future “It is possible your vaccination status may be used in an identifiable manner along with other information about your general work environment such as your building location if we determine or if it is required that this information is necessary in order to ensure a healthy and safe work environment Apple said in the memo according to the outlet It s not clear what repercussions if any an employee will face if they do not provide their vaccination status by the deadline We ve reached out to the company for comment Unlike Google Apple currently does not require employees to be vaccinated before they can come to the office Still the company has started to nudge its workers in that direction more forcefully For example it recently began a campaign encouraging workers to get their shot The company s request and the admission that the information employees share with it may be used in an identifiable manner come as Apple faces increasing scrutiny over how it handles the privacy of its workers A recent report from The Verge detailed some of the company s policies on that front For instance one such policy prohibits employees from wiping their work devices before returning them to the company nbsp |
2021-09-01 18:54:08 |
海外TECH |
Engadget |
'PUBG' creator Brendan Greene leaves Krafton to form independent studio |
https://www.engadget.com/pubg-creator-brendan-greene-new-studio-krafton-183054276.html?src=rss
|
x PUBG x creator Brendan Greene leaves Krafton to form independent studioBrendan quot PlayerUnknown quot Greene best known as creator of PUBG Battlegrounds previously known as PlayerUnknown s Battlegrounds is going independent His PlayerUnknown Productions studio has spun out from PUBG owner Krafton which will hold a minority stake in the company “I m so very grateful to everyone at PUBG and Krafton for taking a chance on me and for the opportunities they afforded me over the past four years Greene said in a statement “Today I m excited to take the next step on my journey to create the kind of experience I ve envisaged for years Again I m thankful for everyone at Krafton for supporting my plans and I ll have more to reveal more about our project at a later date Greene left the core PUBG team in and moved from Seoul where Krafton is based to Amsterdam to lead the PUBG Special Projects division PlayerUnknown Productions is quot exploring the systems needed to enable massive scale within open world games quot according to a press release The only game listed on the studio s website is Prologue for which Greene released an atmospheric teaser in late so it seems he s taken that game with him Greene s departure from Krafton is notable given that he s effectively the father of the battle royale genre that s dominated the gaming landscape over the last few years Before PUBG Greene came to prominence as a developer of battle royale mods for ARMA and HZ |
2021-09-01 18:30:54 |
海外TECH |
Engadget |
DJI's next gimbal might be able to extend like a selfie stick |
https://www.engadget.com/dji-osmo-mobile-5-telescoping-selfie-stick-leak-182021973.html?src=rss
|
DJI x s next gimbal might be able to extend like a selfie stickIt looks like DJI is preparing to release a new smartphone gimbal A leak shared by WinFuture and subsequently spotted by The Verge shows the Osmo Mobile New to this model is a telescoping mechanism that will allow you to extend the gimbal That s something that should give those who buy the OM more ways to compose their photos and videos According to the outlet the device will cost € about and stand approximately inches tall when you collapse down the telescoping mechanism WinFutureJudging by the images WinFuture shared it doesn t look like the Osmo Mobile extends quite as long as a more affordable selfie stick but that s probably for the best since the weight of your smartphone and the included magnetic mounting system would make the gimbal unwieldy at best and prone to breaking at worst Unfortunately it appears that added flexibility will come at the cost of battery life The new model can reportedly go six hours and minutes on a single charge By contrast you can get up to hours of use from the Osmo Mobile s mAh battery btw DJI OM SE is also incoming and basically the same as the original OM but w o the magnetic smartpone holder ーRoland Quandt rquandt September If a high tech selfie stick isn t your thing it looks like DJI also plans to release a more affordable version of its existing Osmo Mobile gimbal WinFuture s Roland Quandt said the company is also working on a model called the Osmo Mobile SE It will reportedly forgo its predecessor s handy magnetic mount but only cost as a result We ll note here Quandt has a solid track record when it comes to DJI leaks Either way the company plans to host a “Hi Five event on September th so we won t have to wait long to find out what it has in store |
2021-09-01 18:20:21 |
海外TECH |
Engadget |
Twitter opens Super Follow subscriptions for some creators |
https://www.engadget.com/twitter-launches-super-follow-subscriptions-180050731.html?src=rss
|
Twitter opens Super Follow subscriptions for some creatorsTwitter is finally flipping the switch on “Super Follows its new subscription feature that allows creators to charge their followers for exclusive content Starting today the company is making the feature available to a “small group of creators with plans to expand the lineup in the coming weeks Twitter has been taking applications for Super Follows since June For now creators can set monthly rates of or in order to access “subscriber only tweets Twitter says it will eventually incorporate other features such as Spaces and newsletters But until then the feature essentially amounts to paying for tweets which might explain why the company is trying it out with just a few people to start The initial lineup includes MakeupforWOC who will offer “client level treatment for subscribers with skincare questions myeshachou who will provide exclusive “behind the scenes stories KingJosiah who will offer “in depth sports analysis tarotbybronx who will provide Super Followers with “astrology tarot and intuitive healing advice and “extra spiritual guidance Of course if you re especially interested in one of these topics or just a dedicated fan there is an upside to buying a subscription You ll be able to interact with creators in a smaller and slightly more private forum That could be useful if for example you re hoping to get some personalized skincare advice On the other hand asking fans to pay for the kind of content they re used to getting for free might be a tough sell Super Follows is one piece of Twitter s strategy to reshape its platform as a destination for creators Outside of subscriptions the company is also experimenting with letting creators sell tickets to audio chats in Spaces Twitter is also working on a newsletter platform ーit acquired Revue earlier this year ーand has opened up tipping features in its app |
2021-09-01 18:00:50 |
海外科学 |
NYT > Science |
The Black Mortality Gap, and a Document Written in 1910 |
https://www.nytimes.com/2021/08/30/upshot/black-health-mortality-gap.html
|
flexner |
2021-09-01 18:41:12 |
金融 |
金融庁ホームページ |
金融審議会「ディスクロージャーワーキング・グループ」(第1回)議事次第について公表しました。 |
https://www.fsa.go.jp/singi/singi_kinyu/disclose_wg/siryou/20210902.html
|
金融審議会 |
2021-09-01 19:00:00 |
金融 |
金融庁ホームページ |
金融庁職員の新型コロナウイルス感染について公表しました。 |
https://www.fsa.go.jp/news/r3/sonota/20210901_2.html
|
新型コロナウイルス |
2021-09-01 18:30:00 |
ニュース |
BBC News - Home |
Portugal changes vaccine rules for UK visitors |
https://www.bbc.co.uk/news/business-58415127?at_medium=RSS&at_campaign=KARANGA
|
visitors |
2021-09-01 18:46:29 |
ニュース |
BBC News - Home |
Raikkonen to retire from F1 at end of season |
https://www.bbc.co.uk/sport/formula1/58415541?at_medium=RSS&at_campaign=KARANGA
|
raikkonen |
2021-09-01 18:02:37 |
ニュース |
BBC News - Home |
Afghanistan: Joe Biden speech on withdrawal fact-checked |
https://www.bbc.co.uk/news/58412530?at_medium=RSS&at_campaign=KARANGA
|
final |
2021-09-01 18:07:59 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ダラダラ残業社員をどう管理する?テレワーク時代に求められる意識改革 - News&Analysis |
https://diamond.jp/articles/-/280260
|
ダラダラ残業社員をどう管理するテレワーク時代に求められる意識改革NewsampampAnalysis「とにかく残業時間を減らさないと話にならないです」ー。 |
2021-09-02 03:55:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「女子高生死体遺棄」容疑者が事件から2日で逮捕された理由 - ニュース3面鏡 |
https://diamond.jp/articles/-/281060
|
任意聴取 |
2021-09-02 03:52:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
AIは将棋をどう変えたのか?谷川浩司九段が語る棋士の未来 - News&Analysis |
https://diamond.jp/articles/-/280524
|
newsampampanalysis |
2021-09-02 03:50:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【寄稿】中ロが狙う米アフガン撤退=ボルトン氏 - WSJ PickUp |
https://diamond.jp/articles/-/281048
|
判断ミス |
2021-09-02 03:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ポストコロナ対応の投資需要で、成長期待が高まる「2つの業種」 - マーケットフォーカス |
https://diamond.jp/articles/-/281051
|
構造変化 |
2021-09-02 03:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
怠惰な投資家が行動を起こすには - WSJ PickUp |
https://diamond.jp/articles/-/281049
|
wsjpickup |
2021-09-02 03:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
アフガンでの対テロ作戦、米軍駐留なければ至難 - WSJ PickUp |
https://diamond.jp/articles/-/281050
|
wsjpickup |
2021-09-02 03:30:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
座りっぱなしの「とてつもない危険」を見過ごしてはいけないワケ - 消費インサイド |
https://diamond.jp/articles/-/281047
|
体調不良 |
2021-09-02 03:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
西郷輝彦さんが希望を見いだした、国内未承認の前立腺がん治療法(上) - ニュース3面鏡 |
https://diamond.jp/articles/-/281046
|
一般社団法人 |
2021-09-02 03:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ひろゆきが語る「知らないほうが幸せになれる『努力と才能』の話」 - 1%の努力 |
https://diamond.jp/articles/-/280678
|
youtube |
2021-09-02 03:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
人類が歴史の中で「記録」を残し続けてきたこれだけの理由 - 独学大全 |
https://diamond.jp/articles/-/273889
|
読書 |
2021-09-02 03:10:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
タリバンが手にした米の軍装備、戦闘能力拡大も - WSJ発 |
https://diamond.jp/articles/-/281126
|
装備 |
2021-09-02 03:07:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
30歳「やりたいことがない人」が向いている仕事を選ぶ方法 - マンガ転職の思考法 |
https://diamond.jp/articles/-/277231
|
|
2021-09-02 03:05:00 |
コメント
コメントを投稿