技術情報

Flutter ListViewの高さを定義する方法

ListViewのアイテムの高さを定義するには、itemExtentを引数として使用します。

ListView(
itemExtent: //,
children : []
);

使用法例

return Scaffold(
      body: ListView(
        itemExtent: 150,
        children: [
          Card(
            color: Colors.blue,
            child: ListTile(
              title: Text('Item1'),
            ),
          ),
          Card(
            color: Colors.blue,
            child: ListTile(
              title: Text('Item2'),
            ),
          ),
          Card(
            color: Colors.blue,
            child: ListTile(
              title: Text('Item3'),
            ),
          ),
        ],
      ),
    );

金曜担当 – Ami



Making a simple request to APIs in python

Today, I would like to share about making a API request using ‘requests’ library in Python. Let’s take a look.

First of all, install the ‘requests’ library by the following command.

pip install requests

or

pip3 install requests

Here is the code to make a GET request to a public API.

import requests

api = 'https://catfact.ninja/fact'

response_data = requests.get(api)

response_data_json = response_data.json()

print(response_data_json)

The result is as follows.

{'fact': 'Lions are the only cats that live in groups, called prides. Every female within the pride is usually related.', 'length': 109}

This is the example request to a public API. You can learn more HERE for advanced usage.

Hope you enjoy that.

By Asahi



Github will change their working style to fully remote and 10% lays off

Microsoft-owned GitHub announced today that it will lay off 10% of its workforce by the end of the company’s fiscal year. Prior to this announcement, GitHub had approximately 3,000 employees. The company will also close all offices at the end of leases and move to a remote-first culture, partly due to low utilization.

Making GitHub’s new homepage fast and performant
Image Credit : Github Blog

GitHub will also continue the hiring freeze it first announced in January and will also make a number of other internal changes to “protect the short-term health” of its business.

“We announced a number of difficult but necessary decisions and budgetary realignments to both protect the health of our business in the short term and grant us the capacity to invest in our long-term strategy moving forward. You can view our CEO’s full message to employees with additional details on these changes below,” a company spokesperson told to techcrunch.

In a slightly unusual move for a company that prides itself on being independent of its corporate owners, GitHub will also be moving to Teams for its video conferencing needs. And in another sign of cost savings, we’re changing our laptop upgrade cycle from 3 to 4 years.

Yuuma



Resizing the image to a specific width and height with opencv in Python

Today, I would like to share a program for resizing the images to a specific width and height with opencv library in Python. Let’s take a look.

Opencv has resize method cv2.resize() to resize the images.

We can resize the images simply as follows.

import cv2

# read the input
img = cv2.imread('input.jpeg')
height, width, channel = img.shape
print(f"Height and width of original image: {height}, {width}")

# resize the image
new_size = (450, 340) # (width, height)
print(f"New height and width: {new_size[1]}, {new_size[0]}")
resize_img = cv2.resize(img, new_size)

cv2.imshow('Original img', img)
cv2.imshow('Resized img', resize_img)

cv2.waitKey(0)

The program above will resize the input image and show original and resized images.

Actually, cv2.resize() has other functionalities. Please study more about this. It is interesting.

This is all for now. Hope you enjoy that.

By Asahi



Twitter is ending free access to their API

Starting February 9th, Twitter will no longer provide free access to the Twitter API and will begin a paid version.

In a series of tweets, a Twitter developer account said the company would stop supporting both the legacy v1.1 and the new v2 of his Twitter API. It wasn’t immediately clear how much they planned to charge for using the API.

https://twitter.com/TwitterDev/status/1621026986784337922

Following recent changes that caused Twitter to shut down third-party clients, many other app developers have become cautious about how to build on top of the Twitter API. This new move may force some developers to abandon their products or pass the costs on to their customers.

Thousands of developers use the Twitter API for dozens of purposes, including tracking changes between Twitter accounts and providing alerts. These are fun side projects for people who don’t want to pay fees for something they don’t monetize themselves.

Third-party companies were often the ones submitting new products and features for Twitter, and the social network did its part by not charging them for API usage. Under Musk, Twitter is striving to control how users around the world access the platform as it scales up its attempts to monetize the service.

Twitter has made its subscription service more expensive and changed the way tweets appear on a user’s timeline to make the platform more attractive, lucrative, and an attractive destination for a shrinking advertiser base.

Yuuma




アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム