python |
Pythonタグが付けられた新着投稿 - Qiita |
python基礎 |
https://qiita.com/Naoki_74goriken/items/d07f34aa327de5eb5a0e
|
phpprintHelloWorldnameJohnprintHelloname型変換strint異なる型同士の連結はできないphppriceprintりんごの値段はpriceです。 |
2022-03-05 18:35:24 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
静的サイトジェネレーター「Astro」を軽く調べて立ち上げてみた |
https://qiita.com/pauli-agile/items/a2d1a53639787e4e72a8
|
yarnstartyarnrunvastrodevastroServerstartedmsastroLocal無事立ち上がりましたおわりにこのような静的サイトジェネレータービルダーは他にも色々あり、結局どれがいいのどれが自分・プロジェクトに合っているのと迷うかもしれませんですがご安心をなんと各種静的サイトジェネレーターとの比較まで公式ドキュメントにまとまっているではありませんか百聞は一見にしかず。 |
2022-03-05 18:16:29 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
ボトルの残量を推定する |
https://qiita.com/foluyucic/items/77b519acbe0096cb09d4
|
|
2022-03-05 18:12:44 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
Redshiftのクエリエディタv2を試す |
https://qiita.com/zumastee/items/598c9fafbf5e399c5f0f
|
なお、デフォルトではAWS管理のKMSが利用されるが、チェックボックスの「Customizeencryptionsettingsadvanced」を選択することで顧客管理のKMSも選択が可能である。 |
2022-03-05 18:59:49 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS Route53 位置情報ルーティングポリシー 複数レコードで同じ「場所」は選べない(Udemy SysOps問題集④ ラボ試験問題1 質問70) |
https://qiita.com/hiyanger/items/e5b117862c1cbabbcc0b
|
AWSRoute位置情報ルーティングポリシー複数レコードで同じ「場所」は選べないUdemySysOps問題集④ラボ試験問題質問UdemySysOps問題集④ラボ試験問題質問にて、位置情報ルーティングポリシーの設定があるのですが、ここでつ以上登録するレコードに対してどちらも同じ「場所」解答では「デフォルト」だが、場所はどこにしても同じになるとを設定すると登録ができなかったのでここにメモしておきます。 |
2022-03-05 18:50:07 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS KMS でアプリケーション内の暗号化をしようとしてハマった話 |
https://qiita.com/nabesuke5098/items/5079a9e85133332a438d
|
キーポリシー、キーユーザーにロールを登録していないからです最終的にはテスト用のIAMロールと同じ設定にして確認するまでしましたが、当たり前ですが、動きませんでした。 |
2022-03-05 18:30:58 |
GCP |
gcpタグが付けられた新着投稿 - Qiita |
Cloud Load BalancingのログをBigQueryで解析 |
https://qiita.com/pict3/items/7b21f034006f6ee18b77
|
どなたかのお役に立てば準備ログをBigQueryに流し込むLoggingのRouterから容易に設定可能。 |
2022-03-05 18:36:48 |
技術ブログ |
Developers.IO |
Securing API Gateway using Amazon Cognito User Pools |
https://dev.classmethod.jp/articles/securing-api-gateway-using-amazon-cognito-user-pools/
|
Securing API Gateway using Amazon Cognito User PoolsAPI It stands for Application Program interface which helps in connection of two applications computers or b |
2022-03-05 09:33:39 |
海外TECH |
DEV Community |
Basic JS Concepts |
https://dev.to/mahmudurbd/basic-js-concepts-n8i
|
Basic JS ConceptsHow does JavaScript work or What is the JavaScript Event Loop Ans In JavaScript the event loop is a process that waits for the Call Stack to be clear before pushing callbacks from the Task Queue to the Call Stack Once the Stack is clear the event loop triggers and checks the Task Queue for available callbacks and If there are any it pushes it to the Call Stack waits for the Call Stack to be clear again and repeats the same processOr Though JavaScript is single threaded how does it handle concurrent work Or Is JavaScript Single threaded or multi threaded Ans JavaScript is a single threaded language Because the language specification does not allow the programmer to write code so that the interpreter can run parts of it in parallel in multiple threads or processes Or Is JavaScript Synchronous or asynchronous Ans JavaScript is a client side and server side scripting language inserted into HTML pages and is understood by web browsers JavaScript is also an Object based Programming language How does JavaScript code is executed in Browser Ans Mostly every web browsers nowadays have their own JavaScript engines So it is the JavaScript engine that understands the code and runs it In this case we have used a chrome browser to run our program that has the V JavaScript engine which is also used for creating the Node js As we already know JavaScript is an interpreted language that means it gets executed in line by line manner or which means the JavaScript engine converts the Js code line by line and runs in the same manner instead of converting the whole program once What are the differences between “ and “ Ans Both are comparison operators and “ is used to compare only values whereas “ is used to compare both values and types What is a callback function Ans In JavaScript the definition of callback is a plain JavaScript function passed to some method as an argument or option It is a function that is to be executed after another function has finished executing hence the name call back When will you return something from a function Or How will you return more than one value from a function Ans The return statement is used to return a particular value from the function to the function caller So we can say that the function will stop executing when the return statement is called and the return statement should be the last statement in a function because the code after the return statement will be unreachable We can return primitive values such as Boolean number string etc and Object types such as functions objects arrays etc by using the return statement We can also return multiple values using the return statement It cannot be done directly so that we have to use an Array or Object to return multiple values from a function Tell me about bind call and apply Or How many arguments does call apply bind take Ans Call method invokes the function and allows you to pass in arguments one by one and Apply method invokes the function and allows you to pass in arguments as an array whereas Bind method returns a new function allowing you to pass in a this array and any number of arguments What is a Closure in JavaScript How does it work Ans A closure can be defined as a JavaScript feature in which the inner function has access to the outer function variable The closure has three scope chains listed as follows Access to its own scope Access to the variables of the outer function Access to the global variables It gives you access to an outer function s scope from an inner function In JavaScript closures are created every time a function is created To use a closure simply define a function inside another function and expose it What does the “this keyword indicate in JavaScript Ans In JavaScript this keyword refers to the object it belongs to It has different values depending on where it is used In a method this refers to the owner object and in a function this refers to the global object What is Event bubbling in js Ans Event bubble is a type of event propagation where the event is first triggered on the most bottom target element and then continuously triggered on the ancestor of the target element in the same nesting hierarchy until it reaches the external DOM element or document object Or How does event delegate work in JS Ans Event delegate works such a way if we have a lot of elements handled in a similar way then instead of assigning a handler to each of them we put a single handler on their common ancestor Explain hoisting in JavaScript Ans Housing is the default behavior of javascript Here declaration of functions and variables are moved on top of the scope What is a recursive function function Ans Recursion is a process of calling itself until it arrives at a result So we can say that when a function that calls itself is called a recursive function and recursive function must have a condition to stop calling itself If we do not stop it the function is called indefinitely Difference between undefined and null Ans Null is an object that means it is an assignment value whereas undefined is a type that means a variable is declared but no value has been assigned a value NULL example var demo null alert demo shows nullalert typeof demo shows objectUndefined example var demo alert demo shows undefinedalert typeof demo shows undefinedWhat are the different data types in JavaScript Ans JavaScript has types of data types These are NumberStringBooleanUndefinedNullObjectSymbol From ES Or Primitive data type and non primitive data typeAns Primitives are known as being immutable data types because there is no way to change a primitive value once it gets created Primitives are compared by value Non primitive values are mutable data types The value of an object can be changed after it gets created Objects are not compared by value What is DOM Ans JavaScript can access all the elements in a web page using the Document Object Model DOM The web browser creates a DOM of the webpage when the page is loaded Is JavaScript a static type or a dynamic type Or How will you know the type of a JavaScript variable Ans JavaScript is a dynamically typed language In a dynamically typed language the type of a variable is checked during run time in contrast to statically typed language where the type of a variable is checked during compile time What are the scopes of a variable in JavaScript Ans The scope of a variable means it is the region of a program in which it is defined JavaScript variable will have only two scopes •Global Variables A global variable which has global scope and it is visible everywhere in your JavaScript code •Local Variables A local variable will be visible only within a function where it is defined Function parameters are always local to that function What are the variable naming conventions in JavaScript For naming variables in JavaScript following rules are to be followed Should not use any of the JavaScript reserved keyword as variable name For example break or boolean variable names are not valid Should not start with a numeral for making JavaScript variable names They must begin with a letter or the underscore character For example name is an invalid variable name but name or name is a valid one JavaScript variable names are case sensitive For example Test and test are two different variables In how many ways can you create an array in JS There are three different ways of creating an array in JavaScript namely By creating instance of an array var someArray new Array By using an array constructor var someArray new Array value value … valueN By using an array literal var someArray value value … valueN What are global variables How are these variables declared Ans Global variables are declared outside of a function for accessibility throughout the program while local variables are stored within a function using var for use only within that function s scope If you declare a variable without using var even if it s inside a function it will still be seen as global What is the use of the Push method in JavaScript Ans The push method is used to add or append one or more elements to an Array end Using this method we can append multiple elements by passing multiple arguments How are event handlers utilized in JavaScript Ans Events are the actions that result from activities such as clicking a link or filling a form by the user An event handler is required to manage the proper execution of all these events Event handlers are an extra attribute of the object This attribute includes the event s name and the action taken if the event takes place What is the unshift method in JavaScript Ans The method of unshift is like the push method which works at the beginning of the array and this method is used to prepend one or more elements to the beginning of the array What is Implicit Type Coercion in javascript Ans Implicit type coercion in javascript is automatic conversion of value from one data type to another It takes place when the operands of an expression are of different data types What is NaN property in JavaScript Ans In JavaScript NaN property means Not a Number and It represents a value that is not a valid number It can be used to check whether a number entered is a valid number or not a number What is the typeof operator Ans JavaScript typeof operator is used to find the type of a JavaScript variable It returns the type of a variable or an expression Notes for Hoisting Note Variable initializations are not hoisted only variable declarations are hoisted Note To avoid hoisting you can run javascript in strict mode by using “use strict on top of the code |
2022-03-05 09:32:23 |
海外TECH |
DEV Community |
Important Javascript functions you have to know to be a better developer |
https://dev.to/asapsonter/important-javascript-functions-you-have-to-know-to-be-a-better-developer-2if8
|
Important Javascript functions you have to know to be a better developerI everybody today I am going to show examples of few important Javascript functions DEEP COPYJavaScript allows you to deep copy an object by converting it into string and then back into object Here is an example const deepCopy obj gt JSON parse JSON stringify obj WAIT FUNCTIONJavascript can do a ship with a setTimeout function but it does not return a promise object making it hard to use in async functions So we have to write our own wait sleep function Here is an example const wait new Promise resolve gt setTimeout resolve ms const asyncFunction async gt await wait console log async asyncFunction Intersection ObserverYou can check if an element is visible at viewport I am going to make use of intersectionObserver to check if an element is visible in the viewport const callback entries gt entries foreach entry gt entries forEach entry gt if entry isIntersecting enter target in dom element e g entry target classList add animated console log entry target is visible const options threshold const observer new IntersectionObserver callback options const btn document getElementById btn const bottomBtn document getElementById bottomBtn observer observe btn observer observe bottomBtn Customize the behavior of the observer using the option parameter threshold is the most useful attribute It defines the percentage of the element that needs to be visible in the viewport of the browser trigger HIDE ELEMENTSyou can toggle the visibility of an element using the style visiabilty property and in case you want to remove it from the render flow you can the style display property Here is an example const hideElement element removeFromFlow false gt removeFromFlow element style display none element style visibility hidden GET URL PARAMETERSEasy search of parameters from a URL objects Here is an example const url new URL window location href const paramterValue url searchParams get pramaName console log paramterValue DECTECT DEVICE TYPESUse navigator UserAgent to detect the device running the app Here is example const dectectDeviceType gt Andriod webOS iPhone iPad iPod BlackBerry IEMobile Opera Mini i test navigator userAgent mobile desktop console log dectectDeviceType If you dont remove an element from the render flow it will be hidden but its space will be occupied it is highly useful while rendering long list of elements The elements not in view can be tested using IntersectionObserver Can be hidden to provide a performance boost |
2022-03-05 09:31:18 |
海外TECH |
Engadget |
Facebook blocks Russian advertisers from running ads globally |
https://www.engadget.com/facebook-blocks-russian-advertisers-running-ads-globally-090704252.html?src=rss
|
Facebook blocks Russian advertisers from running ads globallyAdvertisers within Russia can no longer create or run ads on Facebook quot anywhere in the world quot including their home country the social network told Business Insider The website has also suspended all ads targeting people in Russia quot due to the difficulties of operating in the country at this time quot nbsp This is just the latest step Facebook has taken following Russia s invasion of Ukraine Shortly after the attacks started it blocked Russian state media from running ads on its platform before restricting access to RT and Sputnik in Ukraine and across the European Union A few days after that Facebook started demoting the outlets pages and any post linking to them on its main website and on Instagram nbsp As a response to the social network restricting access to state run media Russian telecom regulator Roskomnadzor blocked Facebook in the country though Instagram and WhatsApp remain available The agency throttled access to the website before that when Facebook officials refused to stop fact checking state media outlets upon its request In a statement issued after Roskomnadzor blocked Facebook completely Meta s president of global affairs Nick Clegg said the company quot will continue to do everything it can to restore its services so they remain available to people to safely and securely express themselves and organize for action quot According to a report by independent Russian news agency Interfax Russia also recently blocked Twitter in the country Roskomnadzor previously limited the country s access to Twitter as well after the social network paused ads and recommendations and started labeling tweets from Russian state media outlets The social network said however that it s only seeing the effects of throttling within the region and not of an outright ban nbsp |
2022-03-05 09:07:04 |
海外科学 |
NYT > Science |
Wildlife Personalities Play a Role in Nature |
https://www.nytimes.com/2022/03/05/science/animal-personalities.html
|
interact |
2022-03-05 10:00:21 |
海外科学 |
NYT > Science |
Review: "The Insect Crisis," by Oliver Milman |
https://www.nytimes.com/2022/03/05/books/review/when-did-you-last-clean-bug-splatter-off-your-windshield.html
|
crisis |
2022-03-05 10:00:11 |
海外科学 |
NYT > Science |
Review: "Sounds Wild and Broken," by David George Haskell |
https://www.nytimes.com/2022/03/05/books/review/crescendos-of-crickets-and-choruses-of-frogs.html
|
nature |
2022-03-05 10:00:08 |
ニュース |
BBC News - Home |
Haas sack Mazepin and end sponsorship deal with Russian company |
https://www.bbc.co.uk/sport/formula1/60630464?at_medium=RSS&at_campaign=KARANGA
|
Haas sack Mazepin and end sponsorship deal with Russian companyFormula team Haas terminate the contract of Russian driver Nikita Mazepin and ends a sponsorship agreement with a chemicals company part owned by his father |
2022-03-05 09:40:35 |
ニュース |
BBC News - Home |
Women's Cricket World Cup: England beaten by Australia despite Sciver century |
https://www.bbc.co.uk/sport/av/cricket/60629959?at_medium=RSS&at_campaign=KARANGA
|
Women x s Cricket World Cup England beaten by Australia despite Sciver centuryEngland fall just short of a record chase in a nervy defeat by Australia in their opening match of the Women s World Cup in Hamilton |
2022-03-05 09:26:40 |
北海道 |
北海道新聞 |
中国「人身売買、厳しく対応」 全人代で李首相が表明 |
https://www.hokkaido-np.co.jp/article/653272/
|
人身売買 |
2022-03-05 18:04:00 |
北海道 |
北海道新聞 |
道内新規感染者1627人 死亡8人 新型コロナ |
https://www.hokkaido-np.co.jp/article/653228/
|
新型コロナウイルス |
2022-03-05 18:02:30 |
コメント
コメントを投稿