IT |
ITmedia 総合記事一覧 |
[ITmedia エグゼクティブ] 東レ社長 日覚昭広さん(74) 新中計でも「サステナブル」がカギに |
https://mag.executive.itmedia.co.jp/executive/articles/2301/09/news029.html
|
itmedia |
2023-01-09 08:28:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia ビジネスオンライン] 慢心? 金融教育を受けたのにトラブル遭遇 日銀関係団体の「金融リテラシー調査」が話題 |
https://www.itmedia.co.jp/business/articles/2301/06/news129.html
|
itmedia |
2023-01-09 08:06:00 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
いっぱい読まれる記事を書くために!備忘録 |
https://qiita.com/hiiragiya/items/7d04309d256687c87250
|
qiita |
2023-01-09 08:26:57 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
いっぱい読まれる記事を書くために!備忘録 |
https://qiita.com/hiiragiya/items/7d04309d256687c87250
|
qiita |
2023-01-09 08:26:57 |
Linux |
Ubuntuタグが付けられた新着投稿 - Qiita |
【Homeを非表示】Ubuntu 23.04でホームを削除【個人フォルダーを表示する】 |
https://qiita.com/foluyucic/items/6acb5dc2390cc2f75625
|
httpsaskubuntu |
2023-01-09 08:58:15 |
海外TECH |
DEV Community |
Quick Start with the ReductStore Python SDK |
https://dev.to/reductstore/quick-start-with-the-reductstore-python-sdk-n30
|
Quick Start with the ReductStore Python SDKThis quick start guide will walk you through the process of installing and using the ReductStore Python client SDK tointeract with a ReductStore instance Installing the SDKTo install the ReductStore SDK you will need to have Python or higher installed on your machine Once Python isinstalled you can use the pip package manager to install the reduct py package pip install reduct py Running ReductStore as a Docker ContainerIf you don t already have a ReductStore instance running you can easily spin one up as a Docker container To do so run the following command docker run p reductstore reductstoreThis will start a ReductStore instance listening on port of your local machine Using the SDKNow that you have the reduct py SDK installed and a ReductStore instance running you can start using the SDK tointeract with the ReductStore service Here is an example of using the SDK to perform a few different operations on a bucket from pathlib import Pathfrom time import time nsfrom reduct import Client BucketSettings QuotaTypeCURRENT FILE Path file async def main Create a ReductStore client client Client http localhost Get or create a bucket with Gb quota bucket await client create bucket my bucket BucketSettings quota type QuotaType FIFO quota size exist ok True The simplest case Write some data with the current timestamp await bucket write entry b Hello World More complex case Upload a file in chunks with a custom timestamp unix timestamp in microseconds async def file reader Read the current example in chunks of bytes with open CURRENT FILE rb as file while True data file read Read in chunks of bytes if not data break yield data ts int time ns await bucket write entry file reader timestamp ts content length CURRENT FILE stat st size The simplest case Read the data by a certain ts async with bucket read entry timestamp ts as record print f Record timestamp record timestamp print f Record size record size print await record read all More complex case Iterate over all records in the entry and read them in chunks async for record in bucket query entry print f Record timestamp record timestamp print f Record size record size async for chunk in record read print chunk if name main import asyncio asyncio run main Let s break down what this example is doing Creating a ClientTo create a ReductStore client you can use the Client class from the reduct module Pass the URL of the ReductStoreinstance you want to connect to as an argument to the Client constructor Create a ReductStore clientclient Client http localhost Creating a BucketTo get or create a bucket you can use the create bucket method on a Client instance Pass the name of the bucketyouwant to get or create as an argument along with a BucketSettings object to specify the desired quota for the bucket Set the exist ok argument to True to create the bucket if it does not exist Get or create a bucket with Gb quotabucket await client create bucket my bucket BucketSettings quota type QuotaType FIFO quota size exist ok True Writing data to a BucketTo write data to an entry in a bucket with the current timestamp you can use the write method on a Bucket instance Pass the name of the entry you want to write to as an argument along with the data you want to write The writemethodwill automatically use the current timestamp when writing the data to the entry The simplest case Write some data with the current timestampawait bucket write entry b Hello World This is the simplest case for writing data to an entry in a bucket using the SDK The write method also allowsyou to specify a custom timestamp Let s look at an example of uploading data in chunks with a custom timestamp To upload a file in chunks to an entry in a bucket pass the name ofthe entry you want to write to as an argument along with a generator function that yields the file data in chunks Specify the total size of the file with the content length argument and specify a custom timestamp withthe timestampargument More complex case Upload a file in chunks with a custom timestamp UNIX timestamp in microsecondsThis code snippet shows how to use the write method to upload a file in chunks to an entry in a bucket The generatorfunction file reader reads the file in chunks of bytes and yields the data The write method reads the data fromthegenerator and writes it to the entry in the bucket Reading data from a BucketTo read data from an entry in a bucket you can use the read method on a Bucket instance Pass the name of the entryyouwant to read from and the timestamp of the specific record you want to read as arguments Use the async with statementto open the record and then use the read all method to read all of the data in the record The simplest case Read the data by a certain tsasync with bucket read entry timestamp ts as record print f Record timestamp record timestamp print f Record size record size print await record read all To iterate over all records in an entry you can use the query method on a Bucket instance Pass the name of the entryyou want to iterate over as an argument Use a for loop to iterate over the records and use the read method on eachrecord to read the data in chunks More complex case Iterate over all records in the entry and read them in chunksasync for record in bucket query entry print f Record timestamp record timestamp print f Record size record size async for chunk in record read print chunk The query method returns an async iterator to the records in the entry By default the method returns all recordsin the entry However you can use the start and stop arguments to specify a time interval for the records you want toretrieve The start argument specifies the beginning of the time interval and the stop argument specifies the end ofthe time interval Both arguments are timestamps in UNIX microseconds start ts January at stop ts January at async for record in bucket query entry start start ts stop stop ts Process the recordif you have any questions or feedback don t hesitate to reach out in Discordor by opening a discussion on GitHub |
2023-01-08 23:22:35 |
Apple |
AppleInsider - Frontpage News |
Best workout tech accessories for the fitness newbie in your life |
https://appleinsider.com/articles/23/01/08/get-these-workout-accessories-for-the-fitness-newbie-in-your-life?utm_medium=rss
|
Best workout tech accessories for the fitness newbie in your lifeThe road to fitness can be downright brutal for a beginner but you can kickstart your workout journey with these smart exercise gadgets that will work with your iPhone Kickstart your fitness journey with these smart exercise gadgetsThese app enabled workout gadgets make fitness routines less intimidating and more effective as they guide you through the reps track your progress and motivate you to improve Here are our top picks Read more |
2023-01-08 23:40:15 |
海外ニュース |
Japan Times latest articles |
Bolsonaro supporters invade Brazil presidential palace, Congress and Supreme Court |
https://www.japantimes.co.jp/news/2023/01/09/world/bolsonaro-supporters-invade-presidential-palace/
|
Bolsonaro supporters invade Brazil presidential palace Congress and Supreme CourtPresident Luiz Inacio Lula da Silva blamed Bolsonaro and complained about a lack of security in the capital saying authorities had allowed fascists and fanatics |
2023-01-09 08:46:11 |
ニュース |
BBC News - Home |
Brazil protests: Lula vows to punish Congress invaders |
https://www.bbc.co.uk/news/world-latin-america-64204860?at_medium=RSS&at_campaign=KARANGA
|
brazil |
2023-01-08 23:31:14 |
ニュース |
BBC News - Home |
Masters 2023: Hossein Vafaei beats Mark Selby, Shaun Murphy also wins |
https://www.bbc.co.uk/sport/snooker/64204492?at_medium=RSS&at_campaign=KARANGA
|
Masters Hossein Vafaei beats Mark Selby Shaun Murphy also winsHossein Vafaei produces a superb display to move into the quarter finals of the Masters with a win over three time champion Mark Selby |
2023-01-08 23:23:44 |
北海道 |
北海道新聞 |
600人殺害とのロシア主張否定 「民間インフラが被害」 |
https://www.hokkaido-np.co.jp/article/784925/
|
被害 |
2023-01-09 08:28:00 |
北海道 |
北海道新聞 |
ロヒンギャ185人漂着 インドネシア |
https://www.hokkaido-np.co.jp/article/784914/
|
漂着 |
2023-01-09 08:13:50 |
コメント
コメントを投稿