アプリ関連ニュース
- 2023年4月03日
- 技術情報
Twitter announces their new API with free, basic and enterprise levels
After shutting down the free API access, Twitter finally announced its new API pricing structure. These three tiers include a free tier aimed primarily at content posting bots, a $100/month basic tier, and an expensive enterprise tier. According to the company, access to the Ads API is free for any level of subscription.
The story of the Twitter API began in February when the company announced that free access to the API would end in a few days. After heavy criticism, Elon Musk said the company would offer a free tier to bots that provide “good content.” He later said the basic tier would start at $100 a month without elaborating on the level of access. After more than 45 days, the company finally provided information about its new API.
The new API offering looks like a money grab. The free tier gives you access to just 1,500 post requests per month and sign in with Twitter. The base level, considered “Enthusiast/Student”, provides 50,000 post requests and 10,000 read requests per month per app. Developers who want access to more data should apply for Enterprise Access.
Previously, with the introduction of v2 in 2020, Twitter offered multiple access tiers to developers such as Essential and Elevated, giving them access to between 500,000 and 2 million tweets per month. App makers that fall into that usage category are currently required to subscribe to an Enterprise plan.
Yuuma
yuuma at 2023年04月03日 10:00:00
- 2023年3月31日
- 技術情報
Dart Object ListのKey-valueで重複を削除する方法
DartでKey-ValueによるObjectのリストから重複を削除するには、toSet()が利用できます。最初にtoSetメソッドを呼び出し、その後、再びリストに変換するだけです。
以下に例を示します。
class _Product {
final name;
final type;
final price;
_Product({
required this.name,
required this.type,
required this.price,
});
String toJson() {
return "{ name: $name, type: $type, price: $price}";
}
}
toSetを呼び出してみます。
final products = [
_Product(name: "USB", type: "A", price: 10), // same
_Product(name: "USB", type: "A", price: 10), // same
_Product(name: "USB", type: "B", price: 12),
_Product(name: "USB", type: "C", price: 11),
_Product(name: "Mouse", type: "A", price: 10),
_Product(name: "Mouse", type: "B", price: 12), // same
_Product(name: "Mouse", type: "B", price: 12), // same
_Product(name: "Mouse", type: "C", price: 10),
_Product(name: "Laptop", type: "A", price: 100),
_Product(name: "Laptop", type: "B", price: 120), // same
_Product(name: "Laptop", type: "B", price: 120), // same
];
print(products.length); // 11
print(products.toSet().length); // 11
toSet()で呼び出しても、同じ長さになっています。その時、hashCodeを確認してみます。
products.forEach((element) {
print(element.hashCode);
// 257416280
// 1045932166
// 730517725
// 586146378
// 215518337
// 471982393
// 775971279
// 335683510
// 844714385
// 633234047
// 1021163746
});
それぞれのhashCodeは異なっているため、hashCodeと==演算子をオーバーライドする必要があります。
class _Product {
...
@override
bool operator ==(Object other) {
return other is _Product && other.hashCode == hashCode;
}
@override
int get hashCode => Object.hash(name, type, price);
}
このクラスはリストを持ちませんから、Object.hash関数を使用しますが、リスト変数を含む場合は、代わりにObject.hashAllを使用します。
もう一度、toSetを呼び出してみます。
print(products.length); // 11
print(products.toSet().length); // 8
products.toSet().forEach((element) => print(element.toJson()));
// { name: USB, type: A, price: 10}
// { name: USB, type: B, price: 12}
// { name: USB, type: C, price: 11}
// { name: Mouse, type: A, price: 10}
// { name: Mouse, type: B, price: 12}
// { name: Mouse, type: C, price: 10}
// { name: Laptop, type: A, price: 100}
// { name: Laptop, type: B, price: 120}
なお、重複するものはここでは表示しませんでした。
金曜担当 – Ami
asahi at 2023年03月31日 11:00:00
- 2023年3月30日
- 技術情報
正規表現基礎(4)
nishida at 2023年03月30日 10:00:00
- 2023年3月28日
- 技術情報
Checking if a file already exists in the given path with Node js
Today, I would like to share about checking if a file already exists in the given path using Node js. Let’s take a look.
To check if a file already exists or not, we can perform simply by using existsSync() method of ‘fs’ module in node js. The code is as follow.
const fs = require('fs')
let filePath = "C:\\Users\\waith\\Documents\\t1ee.pdf"
if (!fs.existsSync(filePath)) {
console.log('File does NOT exist!');
}else{
console.log('File exists.');
}
Yes, that is it. The steps to perfom that is very simple. It is just to declare fs module and use fs.existsSync() method to check the filepath.
This is all for now. Hope you enjoy that.
By Asahi
waithaw at 2023年03月28日 10:00:00
Apple is working on language-generating AI
These days, almost every conversation in tech seems to center around AI and chatbots. OpenAI, backed by Microsoft, released a new language model called GPT-4. Google said it is integrating AI into its Workspace tools like Gmail and Docs. Microsoft Bing has drawn attention to itself with a chatbot-enabled search.
People have long complained that Siri doesn’t understand queries (including mine). Siri (and other assistants like Alexa and Google Assistant) can’t understand the different accents and phonetics of people in different parts of the world, even if they speak the same language.
ChatGPT’s new fame and text-based search make it easy for people to interact with various AI models. But for now, the only way to chat with Siri, Apple’s artificial intelligence assistant, is to enable the feature in Accessibility Settings.

In an interview with the NYT, John Burke, a former Apple engineer who worked on Siri, said the Apple Assistant has been slow to evolve because of “clunky code” that makes updating even basic functionality difficult. He also mentioned that Siri has a huge database with many words. So when engineers needed to add features, the database had to be rebuilt. The process reportedly took up to six weeks.
The NYT report did not clarify whether Apple is building its own language model or whether it wants to adopt an existing model. But like Google and Microsoft, Apple doesn’t want to limit itself to offering chatbots powered by Siri.
Apple has generally kept quiet about its AI efforts. But in January, the company launched a program that offers authors an AI-powered narration service that converts books into audiobooks. This shows that iPhone makers are already thinking about generative AI use cases.
Yuuma
yuuma at 2023年03月27日 10:00:00