アプリ関連ニュース

DataTablesを使用したテーブル生成とサーバーサイド連携(4)

今回はDataTablesを使用したテーブル生成方法とサーバーサイド連携方法の連載Part4です。
前回の記事「DataTablesを使用したテーブル生成とサーバーサイド連携(3)」で発生した問題の原因と解決の方法について紹介いたします。

続きを読む

Awesome features of PHP 8

PHP 8 has been officially released for general users. PHP 8 brings a host of new features improvements, functions, and deprecations to the language compared to PHP 7. Among all of these new features, the JIT compiler is the one sharing the limelight. However, other features like syntax changes are also to be taken into account as it is these features that will have a greater impact on the practitioners.

New features include:

  • Named arguments
  • Union types
  • Constructor property promotion
  • Custom object serialization
  • Match expression
  • Nullsafe operator
  • Improvements in the type system and error handling

New PHP Functions

  • New str_contains() function
  • New str_starts_with() and str_ends_with() functions
  • New fdiv() function
  • get_debug_type() function

str_contains()

Helps us in determining whether the given sub-string is present inside the string.

Example :

str_contains ( string $austin , string $tin ) : bool

Executes a case-sensitive operations and checks whether the string austin contains the substring tin.

 — string_starts_with and str_ends_with()

Using this function we can easily find whether the given sub-string is at the beginning or ending of the string.

Example:

str_starts_with(string $austin, string $au): bool;

str_ends_with(string $austin, string $tin): bool;

These new functions can be impersonated with strpossubstrstrncmp, and substr_compare. However, the new functions were favourably received due to its engine-level optimizations and their regular use cases.

fdiv()

The new fdiv() function has similar ability as the fmod() and intdiv() functions, that allows for division by 0. Instead of getting errors, you’ll get INF, -INF, or NAN, depending on the scenario.

get_debug_type()

The new get_debug_type function always returns the true native type of variables. It returns a return native type names, e.g., int rather than integer, double instead of float.

get_debug_type() function helps in

  • Error reporting
  • Debugging
  • Business logic
  • By Tsuki



    Comparisons between Ubuntu and Linux Mint

    Today, I would like to share about comparisons between Ubuntu and Linux Mint Operating systems. Let’s take a look.

    Ubuntu is the most famous Linux distribution. Its development started back in 2004. It is based on Debian distribution, which is why Ubuntu also uses the dpkg packaging system (And .deb package format) along with the apt packager manager.

    Linux Mint, on the other hand, is based on Ubuntu. Its development started in 2008. Hence, Mint by extension is also based on Debian, and uses the same package manager and packaging system.

    1. Distribution Goals

    Ubuntu does not aim to be a simple Linux desktop distribution. Instead, Ubuntu is a general-purpose Linux distribution that can be used on servers, cloud, IoT and embedded devices.

    Linux Mint, on the other hand, is nothing more than a desktop Linux distribution. There are no Linux Mint versions for servers or cloud or IoT… etc.

    2. Software Manager

    Ubuntu Software Center is slow while interacting with it. Of course, things have improved over the years but even with Ubuntu 20.04, on board, you will often notice it loading up slow or freezing when updating/installing an app. On the other hand, Linux Mint’s Software Manager is lighter and quicker.

    3. User Interfaces

    Ubuntu comes with the GNOME desktop environment. GNOME is an open-source desktop environment, which means that it’s a collection of programs associated with a GUI. The GNOME GUI has a dock on the left side where you can see all opened applications.

    Mint comes with Cinnamon as a default desktop environment. Cinnamon is a Windows-like interface with a launcher, panel, and a system notification area on the bottom.

    Ubuntu does support other desktop environments like Budgie, KDE, and Xfce. Mint only supports KDE and Xfce in addition to its default, Cinnamon.

    4. Memory Usage

    Desktop environments usually consume a lot of memory in order to run, which reduces the performance of the OS. Both Cinnamon and GNOME have their own perks but Cinnamon consumes significantly lesser memory than Ubuntu Desktop, making Mint the best distro for old PCs. So, the advantage of Mint is Cinnamon’s lower memory consumption as compared to GNOME.

    5. Preinstalled Applications

    Every Linux distribution comes with preinstalled applications like internet browsers, video players, image editors, and text editors. While Ubuntu offers more applications, their applications are difficult to search for, as you have to remember the exact name of the application. You can’t just guess the name or depend on browsing to find it.

    Mint, on the other hand, only offers basic applications, but those applications are easy to find on their Windows-like menu.

    This is all for now. Hope you enjoy that.

    By Asahi



    Mermaid diagrams in Github markdown

    The only way to include images and figures in your Github Markdown file is to embed images or svgs. If you want to keep your diagrams updated, want to make changes everytime and create diagrams easily, you should take a look at Mermaid.

    Mermaid is a JavaScript-based graphing and charting tool that takes Markdown-inspired text definitions and dynamically creates charts in your browser.

    It supports a variety of common diagram types for software projects like flowcharts, UML, Git charts, user flow diagrams, Gantt charts.

    For example, its syntax is like below.

    ```mermaid
      graph TD;
          A-->B;
          A-->C;
          B-->D;
          C-->D;
    ```
    Credit: Github

    The above code snippet will output as below.

    rendered diagram example
    Credit : Github

    The result is a fast, easy-to-edit vector-based diagram where you need it in your document. Mermaid is becoming more and more popular among developers and have a rich community of contributors.

    When we write a block of code marked as mermaid, it generates an iframe that takes the raw syntax of Mermaid and passes it to Mermaid.js, converting that code into a diagram in the local browser.

    As a conculsion , it’s awesome and convient for developers who want to add diagrams on their github markdown. Thanks to the Knut Sveidqvist, creator of mermaid and you can also checkout the mermaid website here.

    Yuuma



    MacOSで初めてreactを設定する方法とは?

    最近新しいことを勉強したいので、REACT JSというフロントエンドJavaScriptライブラリを勉強始めました。

    今回は、自分のOSにReactJSをセットアップする方法を紹介します。

    MacOSにReactJSをインストールするためには、まずNodeJSとNPMがインストールされている必要がありますので、以下のようにチェックしてみます。

    node --version
    npm --version

    こうすると、NodeJSとNPMのバージョンが返されます。

    React JSとReact-domを1つのコマンドでインストールする

    ことで、NodeJSとNPMがインストールされたので、プロジェクトにReactJSと React-domをインストールすることができるはずです。

    npm install --save react react-dom

    React JSプロジェクトの作成

    ReactJSもインストール終わったところ、新しいプロジェクトを作成することができます。

    npx create-react-app my-react-project

    このコンマドが「my-react-project」という名で新しいプロジェクトを作成されます。ディレクトリが以下のような感じになります。

    JSXの紹介

    index.jsを少し変更し、JSXを適用してみました。

    このJSXの構文は、HTMLに似ているように見えますが、HTMLではありません。

    
    const navbar = (
        <nav>
          <h1>My frist React</h1>
          <ul>
            <li>Home</li>
            <li>About</li>
            <li>Contact</li>
          </ul>
        </nav>
    );

    Reactはユーザーインターフェースの仮想的な表現(Virtual DOMと呼ぶ)を作成し、ReactDOMはそのVirtual DOMに基づいてDOMを効率的に更新するライブラリです。

    というわけで、ReactとReact-domをインポートすることにします。

    import React from 'react';
    import ReactDOM from 'react-dom';

    最後に、このReactをdomにrenderするために、このReactDOM.render関数を呼び出します。rootIDはindex.htmlファイルに既に記述されています。react-projectを作成したら、index.htmlも確認してみて下さい。

    ReactDOM.render(element, root);
    ReactDOM.render(navbar, document.querySelector('#root'));

    最後に、reactプロジェクトの中に入ったら、以下のコマンドを実行して、「localhost:3000」で開発用サーバーを起動し、実行します。

    npm start

    そうすると結果は:

    はい。今回はこれで終わりです。

    By Ami



    アプリ関連ニュース

    お問い合わせはこちら

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

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

    お問い合わせフォーム