アプリ関連ニュース
- 2021年4月08日
- Unity
[Unity] 3D Textの使用方法
今回はUnityの3D Objectの「3D Text」の使用方法をシェアします。
「3D Text」を使用すると、オブジェクトにテキストを配置したり、
テキスト内容や表示色等を動的に更新することができます。
nishida at 2021年04月08日 10:00:02
- 2021年4月07日
- Windows
Windows用アプリケーションのメニューバーの項目の増やし方
tanaka at 2021年04月07日 10:00:40
- 2021年4月05日
- 技術情報
Compressing images for your website
Sometimes, we have to deal with large size images in our website that cause the loading time longer. We need to manage that issue by compressing the images to a smaller without affecting largely the image resolution on the other hand.
Furthermore, we can use lazy loading to load our images on the website apart from compressing images. Firstly I will guide to some websites which provide multiple images’ compression and talk about lazy loading.
Jpeg Compression
As for the jpg and jpeg images compression, you can go to this website which allows only jpg formats images for compression that is available up to 20 images per time. After compression work, there will be a zip file of your compressed images.
Jpg & Png Compression
You have png files instead of jpg, you can use this website which allows not only jpg but also png for compression. The limitation is 20 like above one and there is one more limitation of image size 5MB. After compression work, there will also be a zip file of your compressed images.
Lazy Loading
Image lazy loading means loading images to websites asynchronously, that is, after the content in the top half of the page is fully loaded, or even conditionally, only when they appear in the browser’s viewport. This means that if users don’t scroll all the way down, the images at the bottom of the page won’t even load.
There are many types of lazy loading but I will talk about native browser lazy loading but you can also use other third parties JavaScript libraries.
<img loading = lazy> is compatible with the most popular Chromium-powered browsers (Chrome, Edge, Opera) and Firefox. WebKit (Safari) implementation is in progress. caniuse.com has detailed information on cross-browser compatibility. Browsers that don’t support the loading attribute just ignore it with no side effects.
As I said above, you are welcome to use other libraries like Lozad.js or Intersection_Observer_API also.
Yuuma
yuuma at 2021年04月05日 11:00:53
- 2021年4月02日
- 技術情報
Laravel Session
Sessions provide a way to store information about the user across multiple requests. Session configuration file is stored at config/session.php. Laravel provide various drivers like file, cookie, database, mechace / redis, dynamodb, array. By default, Laravel is configured to use file session driver.
Interaction with the Session
Retrieving Data
There are two primary ways to access the session data in laravel: the global session helper and via a Request instance.
To access the session data via HTTP Request, we can use the get() method, which will take one argument, key to get the session data.
$request->session()->get('key');
When we retrieve an item from the session, we may also pass a default value as the second argument to the get method.
$request->session()->get('key', 'default');
To retrieve all the data in the session, we may use the all method:
$data = $request->session()->all();
To determine if an item is present in the session, we may use the has method:
if ($request->session()->has('users')) {
//
}
Pushing To Array Session Value
The push method may use to push a new value onto a session value that is an array.
$request->session()->push('user.teams', 'developers');
Retrieving & Deleting An Item
The pull method may used to retrieve and delete an item form the session in a single statement:
$value = $request->session()->pull('key', 'default');
If session data contains an integer we may wish to increment or decrement, we may use the increment and decrement methods.
$request->session()->increment('count');
$request->session()->decrement('count');
We may wish to store in the session for the next request. We may use the flash method.
$request->session()->flash('status', 'Task was successful!');
To remove a piece of data from the session. We may use forget method.
$request->session()->forget('name');
We may wish to remove multiple keys:
$request->session()->forget(['name', 'status']);
The Global Session Helper
You may also use the global session PHP function to retrieve and store data in the session.
Route::get('/home', function () {
// Retrieve a piece of data from the session...
$value = session('key');
// Specifying a default value...
$value = session('key', 'default');
// Store a piece of data in the session...
session(['key' => 'value']);
});
By Ami
asahi at 2021年04月02日 10:00:56
- 2021年3月31日
- Android
アプリからギャラリーを起動して画像を取得しましょう
tanaka at 2021年03月31日 10:00:41