AWS |
AWSタグが付けられた新着投稿 - Qiita |
Amazon Neptune を構築してみた |
https://qiita.com/sugimount-a/items/eff6788d646a3cbf8962
|
新たなNotebookが作成されました。 |
2022-03-05 21:33:54 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
Docker コンテナ内でbash: npm: command not foundが出た場合の対応方法 |
https://qiita.com/naoki_haba/items/070765f61bc1c5c84114
|
Dockerコンテナ内でbashnpmcommandnotfoundが出た場合の対応方法概要DockerでLaravel環境を構築したのでスカフォールドをセットアップした。 |
2022-03-05 21:07:09 |
golang |
Goタグが付けられた新着投稿 - Qiita |
GolangのValidationチェック(go-playground編) |
https://qiita.com/kouji0705/items/c9b4248a50c01738d20a
|
GolangのValidationチェックgoplayground編初めにGolangでのValidationチェックを実施する記事です。 |
2022-03-05 21:26:56 |
golang |
Goタグが付けられた新着投稿 - Qiita |
[Golang] ユニットテストにおける正しい後処理の書き方:t.Cleanup() |
https://qiita.com/wifecooky/items/cf8ae640eb526e7413eb
|
Golangユニットテストにおける正しい後処理の書き方tCleanupユニットテストの後処理を行う場合、deferは並列で動いているサブテストの終了を待たずに実行されてしまう問題がある。 |
2022-03-05 21:10:57 |
技術ブログ |
Developers.IO |
EC2 Windows Firewall 설정으로 node 서버 접속해 보기 |
https://dev.classmethod.jp/articles/try-accessing-the-node-server-with-ec2-windows-firewall-settings/
|
EC Windows Firewall 설정으로node 서버접속해보기안녕하세요클래스메소드김재욱 Kim Jaewook 입니다 이번에는EC Windows Firewall 설정으로node 서버에접속해보는과정을정리해봤습니다 EC Windows 구축 |
2022-03-05 12:10:47 |
海外TECH |
Ars Technica |
Liveblog: All the news from Apple’s “Peek performance” event |
https://arstechnica.com/?p=1838354
|
apple |
2022-03-05 12:00:56 |
海外TECH |
MakeUseOf |
How to Resell Ebooks for Free Online |
https://www.makeuseof.com/tag/how-to-resell-e-books-for-free-online/
|
How to Resell Ebooks for Free OnlineYou can legally make decent money when you resell ebooks for free online but it comes down to the source of your amp quot free amp quot ebooks Here are some tips |
2022-03-05 12:30:12 |
海外TECH |
DEV Community |
Java for beginners: Installation of Java |
https://dev.to/killallnano/java-for-beginners-installation-of-java-nhc
|
Java for beginners Installation of JavaHow do you know that you have java installed How do you install Java How do you write compile and run a java code We will perform all these in this article which will be a continuation of our previous article on Java Introduction to Java Check installationTo run Java programs on your computer you must at least have the Java runtime environment JRE installed This might already be the case on your machine You can test if the JRE is installed and in your current path by opening a terminal or cmd in windows Win R enter cmd and press Enter and by typing in the following command java versionIf the JRE is installed and within your path this command will print information about your Java installation as shown below C Users prof gt java versionjava version LTSJava TM SE Runtime Environment build LTS Java HotSpot TM Bit Server VM build LTS mixed mode sharing If the command line returns the information that the program could not be found you have to install Java How to install java on Ubuntu or any UNIX systemOn Ubuntu you can install the latest Java through the terminal by writing the following command sudo apt get install openjdkor you can specify the version e g for Java we can usesudo apt get install openjdk jdk How to install Java on WindowsFor Windows Oracle provides a native installer which can be found on the Oracle website The central website for installing Java is located under the following URL which also contains instructions on how to installJava for other platforms java com What to do if you come across an installation problemIf you have problems installing Java on your system search via Google for How to install JDK on lt YOUR OS gt This should result in helpful links Replace lt YOUR OS gt with your operating system e g Windows Ubuntu Mac OSX etc For instance if having problem in installing Java on windows Search How to install java on windows which will result to results Validate installationAfter installation you can confirm if Java is correctly installed by running java version on your terminal or cmd If successful the output will be similar toC Users prof gt java versionjava version LTSJava TM SE Runtime Environment build LTS Java HotSpot TM Bit Server VM build LTS mixed mode sharing How can you tell you are using a bit or bit version of Java You can run a b it or a bit version of Java on a bit system If you use java version and the output contains the Bit string then you are using the bit version of Java otherwise you are using the bit version The following is the output of a bit version C Users prof gt java versionjava version LTSJava TM SE Runtime Environment build LTS Java HotSpot TM Bit Server VM build LTS mixed mode sharing Writing compiling and running a Java program Write source codeTo create Java programs use any text editor such as Notepad WordPad or gedit in ubux Linux After creation save the file with Java file extension Example Create file HelloWorld java then write the following source code Simplest Java programpublic class HelloWorld public static void main String args System out println Hello World Congratulations you just created your first java source file The above Java program can be developed under Linux Windows using a text editor and the command line Select or create a new directory in Windows which will be used for your Java development In this description the path C Users prof Desktop javalessons is used On Linux you might see home lt name gt javalessons but this will depend on how you named your folder and the location of the folder We will ignore the first file you created Once done creating a directory open a text editor which supports plain text e g gedit in Linux orNotepad in Windows and write the following source code Simplest Java programpublic class HelloWorld public static void main String args System out println Hello World Thanks for reading this article Did you find it useful Save the source code in your javadir directory my case it s C Users prof Desktop javalessons with the HelloWorld java filename The name of a Java source file must always be the same as the class name within the source code and end with the java extension In this example the filename must be HelloWorld java because the class is called HelloWorld Compiling and Running Java ProgramsOpen a terminal or command line Switch to the javadir directory using the command cd javadir e g in the above example I ll use cd C Users prof Desktop javalessons command to change directory to where the file is located Then use the dir command ls in Linux to verify that the source file is in the directory C Users prof gt cd C Users prof Desktop javalessonsC Users prof Desktop javalessons gt dir lt DIR gt lt DIR gt HelloWorld java File s bytesC Users prof Desktop javalessons gt To compile the source code file into a class file use the javac command For example the following command compiles HelloWorld java javac HelloWorld javaAfterward list again the content of the directory with the ls or dir command The directory contains now a file HelloWorld class If you see this file you have successfully compiled your first Java source code into bytecode C Users prof Desktop javalessons gt javac HelloWorld javaC Users prof Desktop javalessons gt dir lt DIR gt lt DIR gt HelloWorld class HelloWorld java File s bytesC Users prof Desktop javalessons gt You can now start to run your compiled Java program Ensure that you are still in the jardir directory To run use the java command For example the command java HelloWorld will display Hello World Thanks for reading this article Did you find it useful C Users prof Desktop javalessons gt java HelloWorldHello World Thanks for reading this article Did you find it useful C Users prof Desktop javalessons gt Using the classpath Common Error when compiling programs is To solve the problem set the classpath in the environmental variables as follows ClasspathThe classpath defines where the Java compiler and Java runtime look for class files to load These instructions can be used in the Java program You can use the classpath to run the program from another place in your directory Configure classpath in Java environment on Windows Windows Click on the Start menuSearch Advanced System settingClick on Environment Variables under System Variables find path and click on it In the Edit windows modify PATH by adding the location of the class to the value for PATH If you do not have the item PATH you may select to add a new variable and add PATH as the name and the location of the class as the value e g PATH C ProgramFiles Java jdk bin In my case it is already configured Reopen Command prompt window and run your java code using the javac command Congratulations you completed the second article on Java If you missed the first one kindly visit Introduction to Java Next article is Java Fundamentals |
2022-03-05 12:44:03 |
海外TECH |
DEV Community |
🧑💻 Building CLIs with React Ink |
https://dev.to/carrotfarmer/building-clis-with-react-ink-2038
|
Building CLIs with React InkYes dear reader you read that right You can build beautiful CLIs with React using an awesome library called React Ink The way this library works is best said summed up by the README of the repo Ink provides the same component based UI building experience that React offers in the browser but for command line apps It uses Yoga to build Flexbox layouts in the terminal so most CSS like props are available in Ink as well If you are already familiar with React you already know Ink Since Ink is a React renderer it means that all features of React are supported Head over to React website for documentation on how to use it Only Ink s methods will be documented in this readme What we ll build ️In this post we ll explore how Ink works by building a cool little CLI that fetches info about pokemon using PokeAPI Creating an Ink project 🪜This is extremely simple and straightforward First you will create an empty directorymkdir pokecli amp amp cd pokecliThen you can run the create ink app commandnpx create ink app typescriptIn this post I will use TypeScript but you can follow along with plain JS too If we take a look at what this command has generated we can see a very basic file structure pokecli source editorconfig gitattributes package lock json package json readme md tsconfig jsonWe can ignore everything other than the source folder source ui tsximport React FC from react import Text from ink const App FC lt name string gt name Stranger gt lt Text gt Hello lt Text color green gt name lt Text gt lt Text gt module exports App export default App This is a normal App component like you would see in plain React A prop name is passed on to this component which is set to a default value of Stranger And a message of “Hello name is rendered Note that the Text component comes from ink It can be used to style many aspects of the text like the color background color etc ink uses a library called chalk to do this source cli tsx usr bin env nodeimport React from react import render from ink import meow from meow import App from ui const cli meow Usage pokecli Options name Your name Examples pokecli name Jane Hello Jane flags name type string render lt App name cli flags name gt This file is the entry point of the CLI application The meow function displays the text that will appear in the help flag And then it pulls the render function from ink to display the exported App component from ui tsx name is a command line argument that can be set by the user like this pokecli name CharmanderWe can see that this arg has an explicit type of string Since we now have a basic understanding of how Ink works let s get on to creating our CLI Running the CLI We can run this code by first compiling our source code into an executablenpm run buildAnd then running the executable pokecli name CharmanderAnd we ll be able to see our output You can also run pokecli with the help flag to see the output of what s passed to the meow function in cli tsx Building our CLI ️Let s first make a simple function to fetch the data of a pokemon through it s name in ui tsx We will do this using a library called axios npm i axiosWe can then use this function to send a request to PokeAPI fetch pokemon data with its name using pokeapiconst pokemon name string void gt axios get name toLowerCase then res gt console log res data And if you test this out we ll be able to see the data associated with what is passed in the CLI name flag The problem with this is that TypeScript doesn t know the properties that exist in this data object So let s declare interfaces for the API response interface Type slot number type name string interface Stat base stat number effort number stat name string interface PokemonData name string height number weight number types Type stats Stat Ref Let s also create a state variable to store our pokemon data const pokemonData setPokemonData React useState lt PokemonData null gt null Now we can update our function to fetch the pokemon data accordingly fetch pokemon data with its name using pokeapiconst pokemon name string Promise lt PokemonData gt gt const url name return axios get lt PokemonData gt url then response AxiosResponse lt PokemonData gt gt return response data Cool Now let s call this function in a useEffect hook call useEffect and use store the pokemon data in stateuseEffect gt pokemon name then data PokemonData gt setPokemonData data name Awesome Now all we have to do is just render the data Since our state will be null if the pokemon data is not yet set we can use that as a loading indicator return pokemonData amp amp pokemon stuff lt Text gt Loading lt Text gt And then we can display the pokemon data return pokemonData amp amp lt Box gt lt Text gt lt Text bold color blue gt pokemonData name toUpperCase pokemonData name slice lt Text gt n Display a divider lt Text color magentaBright gt Array pokemonData name length join lt Text gt n lt Text color yellowBright gt Metrics lt Text gt lt Text color greenBright bold gt Height is in decimeters pokemonData height m pokemonData weight kg lt Text gt n lt Text color yellowBright gt Type lt Text gt lt Text color greenBright bold gt Display the pokemon s types pokemonData types map type Type gt type type name join lt Text gt n n Display the pokemon s stats lt Text color yellowBright bold gt Stats n lt Text gt lt Text color greenBright gt pokemonData stats map stat Stat gt stat stat name stat base stat join n lt Text gt lt Text gt lt Box gt lt Text gt Loading lt Text gt Now you should be able to see this We can clear the terminal screen before the data is shown There is an NPM library called clear which we can use to achieve this npm i clearSince it is written in JS we ll need the type definitions for it too npm i D types clearNow we can call the clear function above our JSX clear return pokemonData amp amp lt Box gt lt Text gt lt Text bold color blue gt Cool You can also change the help text cli tsxconst cli meow Usage pokecli Options name The name of the pokemon Examples pokecli name charmander Charmander Metrics m kg Type fire Stats hp attack defense special attack special defense speed flags name type string Final OutputAfter following with me you should be able to see this You can find the source code for the repo here carrotfarmer pokecli ️A CLI for searching pokemon stuff pokecliA CLI to find information about Pokemon Built using React InkInstall npm install global pokecli pokecliCLIUsage pokecliOptions name The name of the pokemonExamples pokecli name charmander Charmander Metrics m kg Type fire Stats hp attack defense special attack special defense speed View on GitHubIsn t it cool how all the hooks and other React features work in a CLI React sure is taking over the world I ll see you in the next post |
2022-03-05 12:38:15 |
海外TECH |
DEV Community |
Ultimate ReactJS Resources For Web Developer 🔥🔥 |
https://dev.to/david_jackson/ultimate-reactjs-resources-for-web-developer-5ch9
|
Ultimate ReactJS Resources For Web Developer The best React js courses job boards interview resources templates books and libraries all in one place React js is the most popular front end JavaScript library out right now The problem is that there are too many resources to choose from How do you know where to find the best resources React js is a library with a big ecosystem and there are many articles courses and resources out there It can be confusing to know which are the correct ones to use for your purposes In this article we went through a lot of React focused resources We found the best ones for you These resources are designed to help you save time land jobs learn faster and build your app more effectively Read Full Component Here Ultimate ReactJS Resources For Web DevelopersReact helps you to create an interactive user interface easily No matter how complicated the data is you can easily create interactive charts and UI elements smoothly with the ReactJS Since it is created and maintained by the Facebook and Instagram community you needn t worry about the quality of how well it manages the complex codes In addition The major advantage of ReactJS is the option to render and view the components easily It ensures readability and makes maintainability more comfortable Reasons behind the popularity of ReactJS Easy creation of dynamic applicationsReusable componentsImproved performanceSmall learning curveDedicated tools for easy debuggingUnidirectional data flow |
2022-03-05 12:16:36 |
海外TECH |
CodeProject Latest Articles |
Fluent Interface Pattern in C# - With Inheritance Problem |
https://www.codeproject.com/Articles/5326456/Fluent-Interface-Pattern-in-Csharp-With-Inheritanc
|
fluent |
2022-03-05 12:33:00 |
海外ニュース |
Japan Times latest articles |
Russia’s invasion of Ukraine prompts Japan to rethink security strategy toward Moscow |
https://www.japantimes.co.jp/news/2022/03/05/national/russia-invasion-national-strategy/
|
Russia s invasion of Ukraine prompts Japan to rethink security strategy toward MoscowThe strategy which lays out Japan s basic policy for diplomacy and security currently calls for promoting Japan Russia cooperation in the fields of security and energy |
2022-03-05 21:29:42 |
ニュース |
BBC News - Home |
Siege of Mariupol: Fresh Russian attacks throw evacuation into chaos |
https://www.bbc.co.uk/news/world-europe-60629851?at_medium=RSS&at_campaign=KARANGA
|
chaosmass |
2022-03-05 12:01:40 |
ニュース |
BBC News - Home |
Ukraine war: Sky News journalist Stuart Ramsay and team shot at in ambush |
https://www.bbc.co.uk/news/uk-60627841?at_medium=RSS&at_campaign=KARANGA
|
ramsay |
2022-03-05 12:03:16 |
ニュース |
BBC News - Home |
Ukraine: Workers refuse to unload Russian oil from ship |
https://www.bbc.co.uk/news/uk-england-merseyside-60631735?at_medium=RSS&at_campaign=KARANGA
|
refinery |
2022-03-05 12:17:55 |
ニュース |
BBC News - Home |
Unvaccinated women in Scotland can resume IVF |
https://www.bbc.co.uk/news/uk-scotland-60631282?at_medium=RSS&at_campaign=KARANGA
|
january |
2022-03-05 12:47:14 |
北海道 |
北海道新聞 |
性別役割の意識なお強く 道内の大学進学率に男女格差 「地方の女子は特に不利」の声も |
https://www.hokkaido-np.co.jp/article/653304/
|
大学進学 |
2022-03-05 21:18:02 |
北海道 |
北海道新聞 |
「ゆず」北川さん、コロナ感染 岩沢さんは体調に異常なし |
https://www.hokkaido-np.co.jp/article/653327/
|
北川悠仁 |
2022-03-05 21:12:00 |
海外TECH |
reddit |
コメダ珈琲で人生初ラザニア食べた。「宇宙船サジタリウス」見てた時から気になってたラザニアを初めて食べたのだが感想は「食べにくいな」だった。 |
https://www.reddit.com/r/newsokunomoral/comments/t784io/コメダ珈琲で人生初ラザニア食べた宇宙船サジタリウス見てた時から気になってたラザニアを初めて食べたのだ/
|
ewsokunomorallinkcomments |
2022-03-05 12:06:36 |
海外TECH |
reddit |
/r/WorldNews Live Thread: Russian Invasion of Ukraine Day 10, Part 3 (Thread #109) |
https://www.reddit.com/r/worldnews/comments/t78dh1/rworldnews_live_thread_russian_invasion_of/
|
r WorldNews Live Thread Russian Invasion of Ukraine Day Part Thread submitted by u WorldNewsMods to r worldnews link comments |
2022-03-05 12:23:08 |
コメント
コメントを投稿