投稿時間:2021-09-30 21:36:13 RSSフィード2021-09-30 21:00 分まとめ(39件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Engadget Japanese Facebook、米国にてニュースフィードにリール動画投稿を可能に https://japanese.engadget.com/facebook-reels-news-feeds-113051881.html android 2021-09-30 11:30:51
IT ITmedia 総合記事一覧 [ITmedia News] ファスト映画だけでは終わらないファスト問題 https://www.itmedia.co.jp/news/articles/2109/30/news159.html itmedia 2021-09-30 20:26:00
python Pythonタグが付けられた新着投稿 - Qiita 【自分用】Pythonチートシート https://qiita.com/Otsuru666/items/9a22ca4448f91851a343 ephonenumbersifiniprintf 2021-09-30 20:55:31
python Pythonタグが付けられた新着投稿 - Qiita title https://qiita.com/zzoirgii/items/fe9a42e5f059c04052cc Detail Nothing 2021-09-30 20:38:51
python Pythonタグが付けられた新着投稿 - Qiita PythonのModuleNotFoundErrorにがっつりハマった話しと解決した方法 https://qiita.com/taaaaho/items/05560bd878546d5f3a18 とあるライブラリを試してみることが目的だったため、適当にフォルダ名と実行対象のファイル名を対象のライブラリの名称に命名した。 2021-09-30 20:33:04
js JavaScriptタグが付けられた新着投稿 - Qiita 【Deno1.13】高速化されたHTTPサーバーに移行する https://qiita.com/access3151fq/items/6539e3ef19b25b8f3f89 【Deno】高速化されたHTTPサーバーに移行するDenoのHTTPサーバーWebSocketサーバーはvから高速化されました。 2021-09-30 20:31:13
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ZIP4Jが動かない https://teratail.com/questions/362121?rss=all ZIPJが動かないJavaJDKでWebサーバにアップロードした画像を圧縮してメールに添付するプログラムを作成しています。 2021-09-30 20:58:31
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 外付けEEPROMに温度データを書き込みたい https://teratail.com/questions/362120?rss=all 2021-09-30 20:55:37
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 【javascript】横スクロールのスクロールバーをjsで制御する計算方法 https://teratail.com/questions/362119?rss=all 【javascript】横スクロールのスクロールバーをjsで制御する計算方法スマホにした時に横にはみ出る画像を横スクロールにした上で、スクロールバーも画像に合わせてスクロールする様にjsで制御したいです。 2021-09-30 20:47:16
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 複数スポーン(Instantiate)がしたい https://teratail.com/questions/362118?rss=all instantiate 2021-09-30 20:30:20
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) mysqli 拡張がありませんの解決方法が知りたい。 https://teratail.com/questions/362117?rss=all faqmysql 2021-09-30 20:17:13
Ruby Rubyタグが付けられた新着投稿 - Qiita 簡単なプルダウンを実装について! https://qiita.com/TAKAHIRO__k/items/69bab84aa9bb4f0e0884 2021-09-30 20:59:51
Ruby Rubyタグが付けられた新着投稿 - Qiita Ruby Gem Install で Installing required msys2 packagesに失敗するときは https://qiita.com/dake_ns/items/e4f52ddc421ab05d2b08 Rubyxとかの名前になってるさらに、フォルダmsysに入るmsysとかの場合もあるかもmsysexeを起動以下のコマンドを打ってパッケージマネージャの情報を更新pacmanSyu実行中、Yn選択形式で色々聞かれるので、全部YEnterキーを入力すべてのパッケージを更新できずに途中でエラーになるかもしれないが、それでもgeminstallには支障なかったりするので、めげずに次に進む同じフォルダにmingwexeやmingwexeというものも見当たるので、それらについても起動し、pacmanSyuを実行する終了したら、通常のコマンドプロンプトに戻ってgeminstallし直してみる私の場合はこれでインストールがはかどるようになりました。 2021-09-30 20:10:56
技術ブログ Mercari Engineering Blog 新たな不正トレンドに自動対応するMLを活用した不正検知システムづくり https://engineering.mercari.com/blog/entry/20210929-ml-future-plan-in-merpay-ml-team/ hellip 2021-09-30 13:00:29
技術ブログ Developers.IO OneLogin と AWS SSO を統合させる(手動プロビジョニング編) https://dev.classmethod.jp/articles/onelogin-aws-sso-integration-2/ awssso 2021-09-30 11:31:29
海外TECH DEV Community Create a backend in Javascript: NodeJS Module System https://dev.to/ericchapman/create-a-backend-in-javascript-nodejs-module-system-4165 Create a backend in Javascript NodeJS Module SystemHere is a series of articles to help you create backend applications in Javascript Node js is now a must so it is essential for a developer to master it I will publish a new article every two days and little by little you will learn everything there is to know about Node jsTo not miss anything follow me on twitter NodeJS Module SystemWriting code in a file is fine but if your application need a lot of code your file will quickly become too large This is why it is better to separate your code into several modules file in order to make the code reusable and much better structured here is an exampleapp jsconst name Mike Taylor const gretting function name console log Hello name welcome to NodeJS gretting name It could be interesting to make the greeting module reusable To do this we will place it in its own file called gretting jsconst greeting function name console log Hello name welcome to NodeJS By default NodeJS does not allow to use this function from another module To do this you must indicate to the module which elements can be exportable const greeting function name console log Hello name welcome to NodeJS module exports greetingNote here the last line module exports greeting this function allows the use of the greeting function from another module From app js you can now load this module with the require functionconst greeting require gretting js const name Mike Taylor greeting name The require function will create a reference with the greeting module and place this reference in the const greeting variable this variable could have been called another name than greeting Note that the function require greeting js uses the path this allows to indicate to NodeJS that the module is in the same folder as our app js file Multiple exportsIt is possible to export several elements with the function module exports Here is an example person jsconst name Mike Taylor const car Ford Mustang module exports name car Multiple exports is therefore done with an object that contains several elements const person require person js console log person name person car Note that the person variable does not point to the name or car directly it points to the object that is exported So to return its content we have to use person name Multiple export alternative syntax It is possible to export several elements with the function module exports Here is an example person jsconst name Mike Taylor const car Ford Mustang module exports name namemodule exports car carThe usage remains the same const person require person js console log person name person car It is also possible to use deconstructionconst name car require person js console log name car The require function executes the moduleWhen executing the require function the module is executed immediately here is an example hello jsconst hello function console log Hello World modules exports hello app jsconst hello require hello js As soon as NodeJS executes this line the hello module is also executed In this example the module only does an export but if the module contained code it would be executed here is an example hello jsconst hello function console log Hello World console log Hello Node modules exports hello app jsconst hello require hello js Hello If you launched app js you will see that it will display Hello Node before the Hello World because as mentioned the require executes the module Take this fact into account when you create your modules in order to avoid unwanted behavior ConclusionThat s all for today follow me on twitter to be notified of the publication of the next article within two days 2021-09-30 11:32:43
海外TECH DEV Community Building Microservices using Spring Boot + HarperDB and Deploying it on AWS https://dev.to/apoorvtyagi/building-microservices-using-spring-boot-harperdb-and-deploying-it-on-aws-524a Building Microservices using Spring Boot HarperDB and Deploying it on AWS IntroductionIn this article you will learn how to use Spring Boot and HarperDB to create a microservice Later on you will also look at how to deploy the complete application on AWS Elastic Beanstalk You will be building an Employee Leave Management System This application will be responsible for tracking the detailed record of employees leaves You will also be implementing the functionality to add edit and cancel leaves But first let s get a basic understanding of microservices What are Microservices Microservices are another design architecture for developing software In this the software is composed of small independent services that communicate over REST APIs Microservices architectures make applications easier to develop and scale It also enables an organization to evolve its technology stack easily later on if required Monolithic vs MicroservicesIn monolithic architectures all processes run as a single service therefore they are tightly coupled This means that if one process goes down the entire application will get affected leading to a single point of failure Also enhancing or adding new features becomes more complicated as the code base grows This complexity makes it difficult to experiment and implement new ideas In microservices architectures an application is built by combining different components that run independently as a service These services communicate over a well defined interface of lightweight REST APIs Each service is responsible for performing a single task and because they run independently each service can be updated deployed and scaled to meet the demand for specific functions of an application Introducing HarperDBYou are going to use HarperDB as your Database HarperDB is a complete data management solution and distributed database with native SQL operations like join order by etc and NoSQL schema less or even API based execution The most notable features of HarperDB are It has one endpoint for all CRUD operations Execute SQL queries on JSON data Supports multiple plugins like ODBC JDBC Node RED etc It has both SQL and NoSQL support Eliminates the need for an ORM Object Relational Mapping by returning the results as arrays of JSON Executes complex and ACID compliant SQL queries on JSON without any data duplicationLooks interesting doesn t it Configure HarperDB Database InstanceLet s now start with configuring the HarperDB instance Go to Fill out the form with your detailsClick Sign Up For FreeYou will then receive an email that looks like this Click on Log into HarperDB studio Creating an Instance Click on Create HarperDB Cloud Instance Enter Your CredentialsNote These credentials should NOT be confused with your Studio account This is for the superuser you are creating on this database instance The username should NOT be in the form of an email Pick your instance specs You can start with a free version and upgrade later as per your need Next review your details and click Confirm Instance DetailsFinally Click on Add InstanceIn another to minutes your instance will be ready You ll also receive an email as soon as it s done The instance URL that you receive is how you can access HarperDB with REST calls Initially your instance does not have any schemas or tables So you need to create them first I chose Employee Leaves as the name for my schema However you can use any other name for your schema and then click on the green checkmark to save it Next you need to create tables For the moment you ll set up two tables Employee and Leaves the first one is for storing all the employee details like names and employee Ids and the second one is to store the leaves of employees in the company Note that you do not need to add all the columns just yet they will be added automatically when needed For now while creating a table you just have to provide a hash attribute name The hash attribute is used to uniquely identify each record For both these tables you can use ID as hash attribute Creating a Spring Boot AppTo start with spring boot you have to create a basic application from Spring io Select Maven project and Java language For the Spring Boot version select You will also have to add the Spring boot starter web and Lombok dependency Optionally fill in the project metadata For instance you can set group as com employee artifact amp name as attendance package as com employee attendance and finally enter a short description amp click on Generate Extract the downloaded project and open it in your favorite IDE Next for accessing the HarperDB instance from your Spring Boot app you first have to download the CData JDBC Driver for HarperDB The CData JDBC driver allows the most straightforward way to connect to HarperDB from any Java based application It wraps and hides the complexity of accessing data and provides additional powerful security features smart caching batching socket management and more Let s see the steps for integrate this driver inside your application Navigate to and then click on download Go back to your project root directory and create a new folder called lib amp extract the zip file contents inside this folder Next to import the external jar into your spring boot app open the pom xml file and add the following dependency in it lt dependency gt lt groupId gt cdata jdbc harperdb lt groupId gt lt artifactId gt cdata jdbc harperdb lt artifactId gt lt scope gt system lt scope gt lt version gt lt version gt lt systemPath gt project basedir lib cdata jdbc harperdb jar lt systemPath gt lt dependency gt Here the project basedir refers to the path where your pom xml is saved i e your root directory If you have the driver installed at any other path you have to add its absolute path inside the lt systemPath gt Tag An important thing to note here is that you have to set the lt scope gt as system and also inside the plugins set the lt includeSystemScope gt as true lt plugin gt lt groupId gt org springframework boot lt groupId gt lt artifactId gt spring boot maven plugin lt artifactId gt lt configuration gt lt includeSystemScope gt true lt includeSystemScope gt lt configuration gt lt plugin gt This has to be done since you are ultimately going to deploy this application on a server AWS and for a server to know about any external JAR files these configurations are necessary Now to establish a connection between your app and the HarperDB instance create a new package and name it service Inside this make a new Java file called ConnectionService java and add the following content to it package com employee attendance service import org springframework stereotype Service import java sql Connection import java sql DriverManager import java sql SQLException Servicepublic class ConnectionService public Connection createConnection throws SQLException return DriverManager getConnection jdbc harperdb Server https xyz harperdbcloud com User admin Password UseSSL true Service annotation is used with classes that provide some business functionalitiesHere you are making the connection with the Database using the Connection String inside the getConnection method available under the DriverManager class Alternatively you can also prepare the connection options using a Properties object Pass the Properties object to the DriverManager Properties prop new Properties prop setProperty Server https xyz harperdbcloud com prop setProperty User admin prop setProperty Password Connection conn DriverManager getConnection jdbc harperdb prop Replace the server user and password with your own credentials and you are good to go Designing REST APIsNow that a connection has been successfully established between your app and HarperDB let s begin with creating the Restful APIs First create a new package called controller Inside this create a new class and name it AttendanceController java A controller class is where you will expose all the endpoints of your microservices These endpoints are what different microservices use to communicate with each other For this application you will create endpoints GET api get all leaves employeeId To get all the leaves that a particular employee has applied so far POST api add leave To add a new leave for an employee PUT api edit leave To edit the date of an existing leave DELETE api cancel leave To delete an existing leave Here s how the complete controller class will look after adding these endpoints package com employee attendance controller import com employee attendance dto EmployeeDataDTO import com employee attendance dto EmployeeEditDataDTO import com employee attendance service AttendanceService import org springframework beans factory annotation Autowired import org springframework web bind annotation import java util HashMap import java util List RestControllerpublic class AttendanceController Autowired private AttendanceService service GetMapping value api get all leaves employeeId public List lt HashMap lt String String gt gt getAllLeavesForEmployee PathVariable String employeeId return service getAllLeavesForEmployee employeeId PostMapping value api add leave public HashMap lt String String gt addNewLeave RequestBody EmployeeDataDTO employeeData return service addNewLeaveForEmployee employeeData PutMapping value api edit leave public HashMap lt String String gt editLeave RequestBody EmployeeEditDataDTO employeeEditData return service editLeaveForEmployee employeeEditData DeleteMapping value api cancel leave public HashMap lt String String gt cancelLeave RequestBody EmployeeDataDTO employeeData return service cancelLeaveForEmployee employeeData Let us now create another class called AttendanceService java in the service package that you created earlier Inside this class you will write all your business logic So let s implement all methods which are mentioned in your controller package com employee attendance service import com employee attendance dto EmployeeDataDTO import com employee attendance dto EmployeeEditDataDTO import lombok extern slfj Slfj import org springframework beans factory annotation Autowired import org springframework stereotype Service import java sql import java util ArrayList import java util HashMap import java util List Service Slfjpublic class AttendanceService Autowired private ConnectionService connectionService public List lt HashMap lt String String gt gt getAllLeavesForEmployee String empId log info Getting all leaves for employee empId List lt HashMap lt String String gt gt resultList new ArrayList lt gt try Connection conn connectionService createConnection PreparedStatement statement conn prepareStatement Select From Employee Leaves Leaves where empId statement setString empId ResultSet resultSet statement executeQuery while resultSet next HashMap lt String String gt result new HashMap lt gt result put date of apply new Date Long parseLong resultSet getString createdtime toString result put last update date new Date Long parseLong resultSet getString updatedtime toString result put leave applied for resultSet getString date result put employee id resultSet getString empId resultList add result conn close catch Exception e log error Error occurred e HashMap lt String String gt result new HashMap lt gt result put Error e getMessage resultList add result return resultList public HashMap lt String String gt addNewLeaveForEmployee EmployeeDataDTO employeeData log info Inserting new leave for employee employeeData getEmployeeId HashMap lt String String gt result new HashMap lt gt try Connection conn connectionService createConnection PreparedStatement statement conn prepareStatement INSERT INTO Employee Leaves Leaves date empId VALUES statement setString employeeData getDate statement setString employeeData getEmployeeId int count statement executeUpdate if count gt result put Message Success result put Affected rows String valueOf count conn close catch Exception e log error Error occurred e result put Error e getMessage return result public HashMap lt String String gt editLeaveForEmployee EmployeeEditDataDTO employeeEditData log info Updating leave for employee employeeEditData getEmployeeId HashMap lt String String gt result new HashMap lt gt try Connection conn connectionService createConnection PreparedStatement statement conn prepareStatement UPDATE Employee Leaves Leaves SET date WHERE empId and date statement setString employeeEditData getNewDate statement setString employeeEditData getEmployeeId statement setString employeeEditData getPreviousDate int count statement executeUpdate if count gt result put Message Success result put Affected rows String valueOf count conn close catch Exception e log error Error occurred e result put Error e getMessage return result public HashMap lt String String gt cancelLeaveForEmployee EmployeeDataDTO employeeData log info Cancelling leave for employee employeeData getEmployeeId HashMap lt String String gt result new HashMap lt gt try Connection conn connectionService createConnection PreparedStatement statement conn prepareStatement DELETE FROM Employee Leaves Leaves WHERE empId and date statement setString employeeData getEmployeeId statement setString employeeData getDate int count statement executeUpdate if count gt result put Message Success result put Affected rows String valueOf count conn close catch Exception e log error Error occurred e result put Error e getMessage return result With that done let s understand what each of these four functions is used for getAllLeavesForEmployee It will be responsible for fetching all the leaves for a particular employee from the Leaves table You are simply establishing a connection and then querying the Leaves table based on employee Id addNewLeaveForEmployee Whenever an employee needs to apply for a leave this function will be invoked which will take an Object of EmployeeDataDTO class and will be adding a new leave inside the Leave table of your database editLeaveForEmployee If in case an employee wants to change the date for which leave has been applied before the editLeaveForEmployee function will be responsible for modifying that in your Database cancelLeaveForEmployee It will simply cancel a particular leave for an employee i e Delete the row from the table This function also takes the object of the EmployeeDataDTO class as its parameters Next thing is to understand the use of EmployeeDataDTO and EmployeeEditDataDTO classes These two classes will act as your Data Transfer Objects or simply DTOs They will store the data which you will pass in the API request body amp carry that to the service for processing via the controller class To generate these Java files create a new package called dto and add two files in it one will be EmployeeDataDTO java and another one will be EmployeeEditDataDTO java Here s the content EmployeeDataDTO java will hold Employee Id Date for which leave is being appliedpackage com employee attendance dto import lombok Data Datapublic class EmployeeDataDTO private String employeeId private String date And EmployeeEditDataDTO java will have the following properties Employee Id Previous Date which user wants to edit New Date for Leavepackage com employee attendance dto import lombok Data Datapublic class EmployeeEditDataDTO private String employeeId private String previousDate private String newDate Data is a useful annotation that bundles the features of ToString EqualsAndHashCode Getter Setter It is available under Lombok dependency Testing the EndpointsI have manually inserted some initial data into the database tables by clicking the sign on the top right of the table for testing purposes Table Employee Table LeaveNow you have to hit those API endpoints to check if everything is working as expected For this you must download the Postman app in your local development environment from their official downloads After downloading and successfully installing it open the app and run your Spring Boot application In case you are using an IDE like IntelliJ IDEA you can run the Spring Boot application by following these instructions Click on Add Configuration from the top menu bar A new dialog box will open click on Add new run configurations and select Maven from the dropdown Give your run configuration a name The working directory will automatically get picked You just have to put the command spring boot run inside the command line and then click Apply and OK and finally run the app The next thing you have to do is to hit the endpoints via the Postman app api get all leaves employeeId api add leaveTo check if the leave got added successfully or not let s call the api get all leaves API again which you used in the first step As you can see in the response the employee whose ID is now has two leaves This same has been reflected in the Database api edit leaveAgain let s check if the previous date has been modified or not you will get This means that the edit functionality is also working fine api cancel leaveAnd now hitting the GET leaves API you should only get one entry in response So all your endpoints are working as expected in the local development environment Let s move forward to see how you can deploy these APIs to the server Creating a JAR fileA JAR Java Archive is a package file format used to cluster together all the Java class files and associated metadata and resources text images etc into one file to distribute application software or libraries on the Java platform In simple terms a JAR file contains a compressed version of class files audio files image files or other directories To create a JAR file make sure Maven is installed in your local development environment If not follow the below steps to configure maven In Windows OS Navigate to the official Maven website and download the Maven zip file For example apache maven src zip Unzip the contents and copy the path of the bin folder inside Open your System Environment Variables from the control panel find the PATH variable then click on the Edit button In the Edit environment variable dialog click on New and add the complete path of the bin folder that you just copied Finally click on OK To test the configuration open a new command prompt and type mvn version If a version is visible to you that means the configurations are correct If you re using any other OS you can find the installation steps for that on the official Maven website For more detailed steps you can check out this article as well Next to create a JAR file for your application run the command mvn clean install in your project s root directory A new folder with the name Target will be created Inside this folder you ll find your newly created JAR file Another way to create a JAR file is from your IDE For instance in Intellij you can navigate to the maven tab from the sidebar menu and double click Install And here s how your complete project structure should look like by now ├ーlib├ーsrc├ーtarget└ーpom xmlInside src gt main gt java gt com gt employee gt attendance you should have the following files and structure ├ーcontroller│└ーAttendanceController java├ーdto│└ーEmployeeDataDTO java│└ーEmployeeEditDataDTO java├ーservice│└ーAttendanceService java│└ーConnectionService java└ーAttendanceApplication java Deploying the application to AWSThe final step would be to deploy your code to a server In this section you ll learn how you can deploy the application to AWS Elastic Beanstalk Using Elastic Beanstalk you can easily deploy and manage applications in the AWS Cloud without worrying about the infrastructure that runs those applications It reduces management complexity without restricting choice or control You simply upload your application and Elastic Beanstalk automatically handles the details of capacity provisioning load balancing scaling and application health monitoring Creating Elastic Beanstalk environmentOnce you are signed in to your AWS account go to the search panel at the top and type Elastic Beanstalk and click create a new application on the top right It will ask for your Application name Application tags Not mandatory Platform Application codeEnter your application name and optionally you can add up to tags for the resources of your Elastic Beanstalk applications For the platform select Java from the dropdown and it will automatically fill the platform branch and version on its own For the application code select Upload your code and then choose the JAR file built in a previous step Review the configuration and launch the environment As the application is being launched you ll see something similar to this on the environment dashboard Once the application resources get deployed and the environment has been created you ll notice the health of the application remains Severe This is because the Spring Boot application still needs some configuration Let s look at how to solve it in the next section Configuring Spring Boot Through Environment VariablesBy default Spring Boot applications listen on port whereas Elastic Beanstalk expects the application to listen on port There are two ways to fix this error either you have to change the port Elastic Beanstalk is configured to use or change the port the Spring Boot application listens on For this tutorial you will change the port the Spring Boot application listens on as it is easier For this you have to define the SERVER PORT environment variable in the Elastic Beanstalk s environment and set its value to Click on the Configuration from the sidebar menu on your environment page On the Configuration page you ll have software configuration click on Edit Next you ll see that there are already some environment variables set They are set automatically by Elastic Beanstalk when it is configured to use the Java platform To modify the port that Spring Boot listens on as mentioned above you need to add a new environment variable by the name SERVER PORT with its value Click on Apply and the configuration change will make the application restart After it restarts it will pick up the new configuration through the environment variables In about a minute you ll get a healthy application instance up and running Testing the Application in the CloudOnce deployed successfully you will get your application base URL You can also access the same from the sidebar Now replace the localhost with this new URL and try to access one of your API endpoints And you can get the correct response This means that the application has been deployed successfully ConclusionWith this you come to the end of this tutorial The purpose of this tutorial was to use Spring Boot and HarperDB to create microservices You also looked at the step by step process of how you can deploy the same application to AWS Both Spring Boot and AWS are used extensively in the industry but HarperDB might be new for you The reason for choosing HarperDB is because of its easy integration with the Spring Boot app along with the notable features that I have mentioned at the beginning of this article I hope you learned something new In case you get stuck somewhere please feel free to shoot your doubts in the comments Also the complete source code of the application used in this tutorial can be found in this GitHub Repository 2021-09-30 11:31:23
海外TECH DEV Community Créer un backend en Javascript : Le système de module NodeJS https://dev.to/ericlecodeur/creer-un-backend-en-javascript-le-systeme-de-module-nodejs-1jd6 Créer un backend en Javascript Le système de module NodeJSVoici une série d articles qui vous permettra créer des applications backend en Javascript Node js est aujourd hui un incontournable il est donc essentiel pour un développeur de le maitriser Je vais donc publier un nouvel article environ au deux jours et petit àpetit vous apprendrez tout ce qu il y a àsavoir sur Node jsPour ne rien manquer suivez moi sur twitter Les Modules NodeJSÉcrire du code dans un fichier c est bien beau mais si votre application est moindrement importante votre fichier va vite devenir trop volumineux C est pourquoi il est préférable de séparer votre code en plusieurs modules fichier afin de rendre le code réutilisable et beaucoup mieux structuréVoici un exempleapp jsconst name Mike Taylor const gretting function name console log Bonjour name bienvenue en NodeJS gretting name Il pourrait être intéressant de rendre le module greeting réutilisable Pour ce faire nous allons le placer dans son propre fichier appeler gretting jsconst greeting function name console log Bonjour name bienvenue en NodeJS Par défaut NodeJS ne permet pas d utiliser cette fonction àpartir d un autre module Pour ce faire il faut indiquer au module quels éléments devront être exportable const greeting function name console log Bonjour name bienvenue en NodeJS module exports greetingÀnoter ici la dernière ligne module exports greeting cette fonction permet l utilisation de la fonction greeting àpartir d un autre module Àpartir de app js vous pouvez maintenant charger ce module avec la fonction require const greeting require gretting js const name Mike Taylor greeting name La fonction require va créer une référence avec le module greeting et placer cette référence dans la variable const greeting cette variable aurait pu s appeler un autre nom que greeting Ànoter que la fonction require greeting js utilise le path cela permet d indiquer a NodeJS que notre module se trouve dans le même dossier que notre fichier app js Exportation multipleIl est possible d exportéplusieurs éléments avec la fonction module exports Voici un exemple person jsconst name Mike Taylor const car Ford Mustang module exports name car L export multiple se fait donc avec un objet qui contient plusieurs éléments const person require person js console log person name person car Ànoter que la variable person ne pointe par sur le name ou car directement elle pointe sur l objet qui est exporté Donc pour retournéson contenu nous devons utiliser person name Exportation multiple syntaxe alternative Il est possible d exportéplusieurs éléments avec la fonction module exports Voici un exemple person jsconst name Mike Taylor const car Ford Mustang module exports name namemodule exports car carL utilisation reste la même const person require person js console log person name person car Il est également possible d utiliser la deconstructionconst name car require person js console log name car La fonction require exécute le moduleLorsque l on utilise la fonction require le module chargéest exécuté Voici un exemple hello jsconst hello function console log Hello World modules exports hello app jsconst hello require hello js Dès que NodeJS exécute cette ligne le module hello est également exécuté Dans cette exemple le module ne fait qu un export mais si le module contenait du code il serait exécuté voici une exemple hello jsconst hello function console log Hello World console log Bonjour Node modules exports hello app jsconst hello require hello js hello Si vous lancéapp js vous verrez qu il affichera Bonjour Node avant le Hello World car comme mentionné le require exéctue le module Bref tenez compte de ce fait lorsque vous créer vos modules afin d éviter des comportement indésirable ConclusionC est tout pour aujourd hui suivez moi sur twitter afin d être aviséde la parution du prochain article d ici deux jours 2021-09-30 11:28:52
海外TECH DEV Community CXXGraph Library : Header-Only C++ Library for Graph Representation and Algorithms https://dev.to/zigrazor/cxxgraph-library-header-only-c-library-for-graph-representation-and-algorithms-1afk CXXGraph Library Header Only C Library for Graph Representation and Algorithms CXXGraph ZigRazor CXXGraph Header Only C Library for Graph Representation and Algorithms CXXGraph Share on Table of ContentsCXXGraphTable of ContentsIntroductionAlgorithm ExplanationDijkstraDialBFSDFSCycle DetectionPartition Algorithm ExplanationVertex CutGreedy Vertex CutClasses ExplanationRequirementsHow to useUnit Test ExecutionGoogle Test InstallationHow to Compile TestHow to Run TestBenchmark ExecutionGoogle Benchmark InstallationHow to Compile BenchmarkHow to Run BenchmarkPackagingTarballsRPMDEBInstall and UninstallInstall Linux TarballsInstall RPMInstall DEBInstall From SourceExampleHow to contributeSiteContactSupportReferencesCreditsWe are Looking for IntroductionCXXGraph is a small library header only that manages the Graph and it s algorithms in C In other words a Comprehensive C Graph Library Algorithm ExplanationDijkstraGraph Dijkstras Shortest Path Algorithm Dijkstra s Shortest Path Dijkstra s Algorithm is used to find the shortest path from a source node to all other reachable nodes in the graph The algorithm initially assumes all the… View on GitHubCXXGraph is an Header Only library that manages the Graph and it s algorithms in C In other words a Comprehensive C Graph Library Why publish my project Some months ago I start this project with the idea to develop somenthing new or to better say something that can help the developer in some cases or simple that does not have a good implementation in this language C In fact the goal of the library is the portability simplicity of the interface and the certainty of the correct execution of the algorithms Before this project start i search for somenthing like this but I didn t find anything similar so I had decided to start this project Now i need help to improve the library and to test it so I partecipate to Hacktoberfest to get some developer or use in touch with this project If you have minutes to get in touch click on the project or write to me at zigrazor gmail comThank you so much 2021-09-30 11:16:56
海外TECH DEV Community The largest library of UI components for popular frameworks https://dev.to/kemyd/the-largest-library-of-ui-components-for-popular-frameworks-51b5 The largest library of UI components for popular frameworksBuilding websites from scratch is a tough task if you don t have a designer on board Most of the developers are not designers at the same time so in this situation they decide to use a template However choosing the best one is a difficult task many of them lack elements that you have to design yourself Even if a template meets your every need you still don t want to use it in every project so they don t look almost the same hand crafted UI componentsThat s why we created for you the biggest gallery of ready made components that you can use to quickly build a website outline If you are missing a component you will find it here and in dozens of variations You can browse unique UI libraries and categories of components in them Thanks to so many options you will always find interesting and new variants of components Everyone of us has hit a blocking moment in a project You re creating a website design and you just don t have an idea for that section You usually then look for similar sites for inspiration and look at their solutions But finding inspiration and then designing it and coding it in CSS is a lot of work With our solution you ll do it quickly and enjoyably In addition you can simply preview the component code in the editor for inspiration or go to our editor and export the sources Clean code in four frameworksEach library is created as a template in one or more frameworks Tailwind CSS Bootstrap Bulma or Material UI The code under them was created by our internal team of developers We make sure that it is clean and compatible with the spirit of the framework We regularly update it for new versions of the framework We also work on introducing documentation so that it would be easier to use our templates in large projects Drag and drop editorAll our components are available as part of a subscription or lifetime package of our drag and drop editor Compared to our competitors UI library packages it s ridiculously cheap In a flurry of no code tools we go low code for developers Speeding up and automating repetitive tasks is the future but the development profession is alive and well for a reason Modern frameworks simply give more options and pages built in them are more efficient That s why in our editor we add a visual interface where it makes your job easier but everything is always editable in code or exportable to your IDE With a few clicks you can add a section change colors text images In this way you will build and send a preview of the original layout to the client so that the detailed corrections can be done already on the prepared material This way you will be able to spend more of your precious time on what is more difficult and determines the success of the project understanding the client s needs integration with the backend fine tuning the details Let us know in the comments what you think and be sure to check out our components 2021-09-30 11:12:48
Apple AppleInsider - Frontpage News Facebook's full research on teen use of Instagram leaked ahead of Senate hearing https://appleinsider.com/articles/21/09/30/facebooks-full-research-on-teen-use-of-instagram-leaked-ahead-of-senate-hearing?utm_medium=rss Facebook x s full research on teen use of Instagram leaked ahead of Senate hearingFacebook due to testify before the Senate has published two of its research documents into how teenagers are affected by using Instagram ーbut four more reports have been leaked Instagram on iPhoneThe Senate Commerce Committee s consumer protection subcommittee is to hear testimony from Facebook on Thursday concerning the company s services and their effect on the mental health of teenagers The hearing was prompted by a Wall Street Journal article that claimed Facebook knows Instagram is toxic for teen girls Read more 2021-09-30 11:48:45
海外TECH Engadget The Morning After: Boba Fett's very own show debuts this December https://www.engadget.com/the-morning-after-boba-fetts-very-own-show-debuts-this-december-111220233.html?src=rss The Morning After Boba Fett x s very own show debuts this DecemberThe drama litigation and tweets continue between Elon Musk Jeff Bezos and all those space faring companies As reported by CNET Musk told Code conference attendees Bezos should put more effort into quot getting into orbit than lawsuits quot and that you couldn t quot sue your way to the Moon quot as Blue Origin allegedly tried when it lost its lunar lander bid SpaceXNASA legal documents have revealed the space agency felt Blue Origin quot gambled quot with its originally proposed billion lunar lander price Bezos company allegedly set the price far higher than necessary expecting hoping NASA to award the contract and negotiate a lower cost Further it assumed NASA would get the full funding from Congress needed for that initial price That didn t happen Blue Origin s VP Megan Mitchell told The Verge the company rejected NASA s views She felt it made a quot great offer quot and that it disagreed with how NASA had framed its bid An Amazon representative also got in touch with Engadget to remind us that SpaceX has a quot long track record quot of suing the US government over contracts and other decisions Yes we re aware In the end SpaceX s lower bid of billion was picked by NASA despite Blue Origin s subsequent challenges and a last minute billion bid ーalmost a third of its original proposal ーMat SmithFitbit Charge reviewNew look same tricks EngadgetValentina Palladino puts the latest Fitbit through its paces Don t expect any major shakeups but we do get a more modern fitness tracker Not only is it thinner lighter and less bulky than the Charge but it now has some features previously reserved for Fitbit s full fledged smartwatches the Versa and Sense At you will pay a premium for those updates Continue reading Mandalorian spin off premieres December thDisney will have one more big show before is over DisneyDisney vowed The Book of Boba Fett would premiere this December and it s making good on its promise ーbarely It s revealed the Mandalorian spin off will debut December th on Disney replete with a little bit of teaser art you can see above We d explain more but spoilers abound For everyone already caught up with The Mandalorian click on Continue reading Amazon s biggest innovation is being cheapYou look familiar Alexa If you were following along with all the Amazon product announcements yesterday you might have experienced a dose of tech deja vu Cherlynn Low felt exactly that With products that borrowed heavily from the likes of Fitbit Nest both Google properties now as she put it Amazon s biggest innovation increasingly seems to be being cheap Aside from that robot Continue reading Sony s latest true wireless earbuds are only The company also revealed ANC headphones promising hour battery life Sony s flagship noise canceling headphones and tech filled true wireless earbuds have both been updated for Now the company s more affordable options are getting the same treatment With the WF C you can pick up a solid set of true wireless earbuds capable of handling immersive Reality Audio for And if over ear noise canceling headphones are more your vibe the WF XBN pairs ANC active noise cancellation with hour battery life for Continue reading The biggest news stories you might have missedFacebook publishes slides on how Instagram affects teen mental healthValve is reportedly working on a standalone VR headsetApple finally lets you rate its apps on the App StoreThat show with a golden arm returns thanks to RokuNintendo denies it supplied developers with tools for a K SwitchJeep s Grand Cherokee plug in hybrid will arrive in early GM s new software hub will update your next EV like a smartphoneGoogle wants to streamline the tricky process of assigning addresses in rural areasEngadget Deals SanDisk memory cards are discounted for today only on Amazon 2021-09-30 11:12:20
海外TECH WIRED How Healthy Is Farm Soil? Check How Active Its Microbes Are https://www.wired.com/story/how-healthy-is-a-farms-soil-check-how-active-its-microbes-are How Healthy Is Farm Soil Check How Active Its Microbes AreResearchers developed a probe that could help farmers better understand their land by measuring the electric current from the tiny creatures in the dirt 2021-09-30 12:00:00
海外TECH WIRED These Smart Light Bars Will Brighten Up Your Living Room https://www.wired.com/review/govee-flow-pro activity 2021-09-30 12:00:00
海外ニュース Japan Times latest articles Kishida taps ex-economy minister Akira Amari as LDP’s No. 2 https://www.japantimes.co.jp/news/2021/09/30/national/politics-diplomacy/ldp-executives-kishida/ Kishida taps ex economy minister Akira Amari as LDP s No Former internal affairs minister Sanae Takaichi who lost to Kishida in the LDP presidential race was chosen as the party s new policy chief 2021-09-30 20:11:19
ニュース BBC News - Home Sarah Everard murder: Wayne Couzens handed whole-life sentence https://www.bbc.co.uk/news/uk-england-london-58747614?at_medium=RSS&at_campaign=KARANGA confidence 2021-09-30 11:50:59
ニュース BBC News - Home Sabina Nessa: Man accused of 'predatory' murder of teacher https://www.bbc.co.uk/news/uk-england-london-58748885?at_medium=RSS&at_campaign=KARANGA nessa 2021-09-30 11:02:08
ニュース BBC News - Home Judge refuses to delay Scots vaccine passport scheme https://www.bbc.co.uk/news/uk-scotland-58747315?at_medium=RSS&at_campaign=KARANGA scheme 2021-09-30 11:10:57
ニュース BBC News - Home Waze tracks fuel shortage through crowdsourced info https://www.bbc.co.uk/news/technology-58749524?at_medium=RSS&at_campaign=KARANGA notify 2021-09-30 11:17:36
ニュース BBC News - Home Sarah Everard: How Wayne Couzens covered up her murder https://www.bbc.co.uk/news/uk-58746108?at_medium=RSS&at_campaign=KARANGA couzens 2021-09-30 11:20:28
ニュース BBC News - Home Rob Burrow hears a moving message from his daughter https://www.bbc.co.uk/news/uk-58741344?at_medium=RSS&at_campaign=KARANGA disease 2021-09-30 11:38:07
LifeHuck ライフハッカー[日本版] 効果的にトレーニングをするために気をつけたい4つのポイント https://www.lifehacker.jp/2021/09/243243excercise-matome.html 気をつけ 2021-09-30 21:00:00
GCP Google Cloud Platform Japan 公式ブログ GraphQL API のライフサイクルを管理する Apigee のネイティブ サポートを発表 https://cloud.google.com/blog/ja/products/api-management/how-to-manage-graphql-apis-in-apigee/ 検出RESTAPIの検出とインタラクションにおいては、デベロッパーは通常、管理ベンダーが提供するポータルを利用しますが、GraphQLAPIでは、ユーザーがその場で新しいクエリを探せるような組み込みのポータルが提供されることがよくあります。 2021-09-30 12:00:00
北海道 北海道新聞 日本馬2頭などの枠順決まる フランス競馬の凱旋門賞 https://www.hokkaido-np.co.jp/article/594981/ 凱旋門賞 2021-09-30 20:14:00
北海道 北海道新聞 バレーボール協会、診断書偽造 ビーチバレー出場キャンセルで https://www.hokkaido-np.co.jp/article/594977/ 日本バレーボール協会 2021-09-30 20:04:00
北海道 北海道新聞 読売新聞、元記者を懲戒解雇処分 取材情報漏えい11回 https://www.hokkaido-np.co.jp/article/594975/ 懲戒解雇 2021-09-30 20:01:00
IT 週刊アスキー 撮って出しプレイ動画を掲載!TGS2021『地球防衛軍6』プレイレポート https://weekly.ascii.jp/elem/000/004/070/4070696/ tokyogameshow 2021-09-30 20:55:00
IT 週刊アスキー Xboxクラウドゲーミングが日本で10月1日にサービス開始!「東京ゲームショウ 2021 Xbox Live Stream」でXboxの新作タイトルが続々公開 https://weekly.ascii.jp/elem/000/004/070/4070695/ gameshowxboxlivestream 2021-09-30 20:35:00
GCP Cloud Blog JA GraphQL API のライフサイクルを管理する Apigee のネイティブ サポートを発表 https://cloud.google.com/blog/ja/products/api-management/how-to-manage-graphql-apis-in-apigee/ 検出RESTAPIの検出とインタラクションにおいては、デベロッパーは通常、管理ベンダーが提供するポータルを利用しますが、GraphQLAPIでは、ユーザーがその場で新しいクエリを探せるような組み込みのポータルが提供されることがよくあります。 2021-09-30 12:00:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)