IT |
気になる、記になる… |
Tapbots、「Tweetbot 6.6」をリリース − 投票の追加や返信出来るユーザーの制限機能に対応 |
https://taisy0.com/2021/11/15/148642.html
|
tapbots |
2021-11-14 18:35:14 |
海外TECH |
MakeUseOf |
What Is Rooting Malware, and How Can You Protect Yourself? |
https://www.makeuseof.com/what-is-rooting-malware-how-can-you-protect-yourself/
|
reasons |
2021-11-14 18:45:22 |
海外TECH |
DEV Community |
Learning Svelte Part #4 |
https://dev.to/alessandrogiuzio/learning-svelte-part-4-155m
|
Learning Svelte Part Props and ComponentsHello developers welcome back to my series of articles about my journey to learn Svelte this is my th post about it and so far it s very helpful for my learning writing down my steps make it public make a good contribution to my knowledge Today I am writing about Props and Components Normally a Svelte website is made with of many different components App svelte Header svelte Content svelte Footer svelte and so on All this components will be structured to make up the full page the root component it s the App svelte this component will be directly deployed in the Dom by the main JS file We will nest all the others components with it The question is why we need to split our webapp in so many different pieces and not write all the code in the App svelte root component The main reason is to keep your code easy to read tidy and modular Imagine we put everything in one module the chances that our code will be disorganized are very high Another reason to split in different modules is that with this method we can easily reuse it we can create components to use whenever we need We can easily import our components in the App svelte using the syntax importAnd then we will display it in our HTML like in the follow example If we want to change any data in the reused component we can do that using props How can we pass props to a component We need to declare the props we want to pass in in the component itself we can call it how we like it and we need to set it to a value that ca be a string an object could be an integer When the components it s created it will read the props and the valueTo access the prop inside the Footer component we need to declare that we are going to use that variable called “prop you can name it how you like most We declare the variable “prop and set to “export so now this way we can access the value outside the component That s it for my contribution today it s difficult for me write in English but I will keep going please feel free to leave a comment and roast my explanation |
2021-11-14 18:44:14 |
海外TECH |
DEV Community |
LeetCode - Symmetric tree |
https://dev.to/_alkesh26/leetcode-symmetric-tree-35kf
|
LeetCode Symmetric tree Problem statementGiven the root of a binary tree check whether it is a mirror of itself i e symmetric around its center Problem statement taken from Example Input root Output trueExample Input root null null Output falseConstraints The number of nodes in the tree is in the range lt Node val lt Explanation Recursive functionWhen it comes to solving problems related to trees recursion is the best choice If not recursion the iterative approach will use queues Let s explore a simple recursive approach in this blog The approach is to use two pointers as arguments that pointsto the root of the tree The first pointer will move left and second will move right and verify if the nodes are same or not Let s check the algorithm main function call recursive function areSymmetric root root areSymmetric function root root if root amp amp root return true else if root amp amp root if root gt val root gt val return areSymmetric root gt left root gt right amp amp areSymmetric root gt right root gt left return false C solutionbool areSymmetric TreeNode root TreeNode root if root amp amp root return true else if root amp amp root if root gt val root gt val return areSymmetric root gt left root gt right amp amp areSymmetric root gt right root gt left return false class Solution public bool isSymmetric TreeNode root return areSymmetric root root Golang solutionfunc areSymmetric root TreeNode root TreeNode bool if root nil amp amp root nil return true else if root nil amp amp root nil if root Val root Val return areSymmetric root Left root Right amp amp areSymmetric root Right root Left return false func isSymmetric root TreeNode bool return areSymmetric root root Javascript solutionvar areSymmetric function root root if root amp amp root return true else if root amp amp root if root val root val return areSymmetric root left root right amp amp areSymmetric root right root left return false var isSymmetric function root return areSymmetric root root Let s dry run our algorithm to see how the solution works Input root in main functionStep return areSymmetric root root in areSymmetric functionStep if root amp amp root root nil nil true root nil nil true true amp amp true false else if root amp amp root amp amp true if root gt val root gt val true return areSymmetric root gt left root gt right amp amp areSymmetric root gt right amp amp root gt left return areSymmetric amp amp areSymmetric we will ignore the nd condition here since both are same In actual recursive call it will be evaluated Step if root amp amp root root nil nil true root nil nil true true amp amp true false else if root amp amp root amp amp true if root gt val root gt val true return areSymmetric root gt left root gt right amp amp areSymmetric root gt right amp amp root gt left return areSymmetric amp amp areSymmetric areSymmetric Step if root amp amp root root nil nil true root nil nil true true amp amp true false else if root amp amp root amp amp true if root gt val root gt val true return areSymmetric root gt left root gt right amp amp areSymmetric root gt right amp amp root gt left return areSymmetric nil nil amp amp areSymmetric nil nil areSymmetric nil nil Step if root amp amp root root nil nil nil false root nil nil nil false false amp amp false true areSymmetric Step if root amp amp root root nil nil true root nil nil true true amp amp true false else if root amp amp root amp amp true if root gt val root gt val true return areSymmetric root gt left root gt right amp amp areSymmetric root gt right amp amp root gt left return areSymmetric nil nil amp amp areSymmetric nil nil areSymmetric nil nil returns true so we move back from step to step till step and evaluate return areSymmetric root gt left root gt right amp amp areSymmetric root gt right amp amp root gt left which is trueSo the answer we return is true |
2021-11-14 18:28:30 |
海外TECH |
DEV Community |
Writing tests for CLI tool |
https://dev.to/hphan9/writing-tests-for-cli-tool-3p6b
|
Writing tests for CLI toolThis week I was working on writing tests for my Shinny SSG project It was the most challenging lab in the OSD course since I had to modify both my code and my project s folder structure to implement the tests Set upThe testing framework that I chose is XUnit The first reason is that it is trendy compared to another test framework such as NUnits I created test method stubs from the existing code by Create Unit Tests command To use it with Xunit I have to implement the XUnit net TestGenerator extension to my project ChallengesI want to test how my tools generated files and folders in the destination with different arguments passed to the program However in my old code I put all the logic of working with arguments in the static int main string args function I could not use Interface and Dependency injection to mock the CommandLineApplication because CommandLineUtils does not have an interface for this class Luckily I found this guidance from the owner of CommandLineUtils and he advised that Split the command line argument parser and application execution into separate class structures to test various options programmatically It is a great suggestion and I rewrote my program by adding class CommandLineOptions and adding logic to the constructor of class Generator I can kill two birds with one stone by this change code refactoring and writing better tests Another problem I had was my folder structure Before I put the project s sln file git file and src files in the root of the folder However when I added a new test project for Shinny SSG I had it outside my git folder and it would be impossible to commit the change and put it in my remote repository To resolve that I had to change my folder structure to this C ├ーshinny ssg│├ーbin││├ーDebug│││└ーnetcoreapp│││├ーdist│││└ーpublish││├ーDestination││└ーRelease││└ーnetcoreapp│├ーobj││├ーDebug│││└ーnetcoreapp││└ーRelease││└ーnetcoreapp│├ーProperties│└ーsrc└ーshinny ssgTests ├ーbin │└ーDebug │├ー netcoreapp version v │└ーnetcoreapp ├ーobj │└ーDebug │├ー netcoreapp version v │└ーnetcoreapp └ーsrc TestingI wrote test for Generator class run function that cover different cases config file option input path option and invalid input path option My tests help uncovering a huge bug in my application Before I thought that default keyword was used to specified the default value of a variable cssUrl cssOption HasValue cssOption Value default However the default literal is for producing the default value of a type that is null in this case CssUrl is the string type I also wrote a test that testes the core feature of my application Given a text and checked if the generated HTML value matched the expected output Pull requestThroughout this experience I learn a lot about software testing and why it is essential for software development In the future I will implement more tests for my project and explore other test frameworks |
2021-11-14 18:27:00 |
海外TECH |
DEV Community |
.Net Core vs NodeJS (Resumen) |
https://dev.to/arielcalix/net-core-vs-nodejs-resumen-275h
|
Net Core vs NodeJS Resumen Hola Amigos y bienvenidos a este vs entre dos tecnologías en esta ocasion haremos un resumen de los que hemos venido Hablando ¿NodeJS o Net Core Como lo hemos dicho anteriormente hablar de cada una y confrontarlas no es que queramos hacerte usar una o la otra por el contrario que tengas un panorama más amplio sobre cada una y los proyectos que pueden realizar en cada uno para que asícompletes el proyecto sin problemas cada una tiene sus bondades para un proyecto en específico que la otra no posea y viceversa queda a tu elección cual usar Solamente ten en cuenta que para el lado web tanto a nivel de cliente como servidor NodeJS es bastante rapido lo que lo hace un gran candidato y ganador es ese ambito mientras que en proyectos transaccionales Net Core se lleva el premio Ventajas Net CoreNodeJSEs MultiplataformaEs multiplataformaSistema de almacenamiento en cache confiableBase de Código única y potenteImplementacion y mantenimiento flexible y sencilloEscalabilidad e implementación seguras Desventajas Net CoreNodeJSSoporte relacional de objetos limitadoBloqueo de E SLa brecha entre el lanzamiento y la estabilidadEstandarización de librerias Tipos de Proyectos Net CoreNodeJSWeb mismas que pueden ser desplegadas en Windows Linux o Mac OSAplicaciones de chat en tiempo realAplicaciones con Docker en cualquiera de las nubes ya sea Azure AWS o GCP Aplicaciones webAplicaciones de Escritorio UWP lo que permite que tus apps sean ejecutadas en Windows XBOX y HoloLensServicios de API RestIoTIoTIAStreaming de datosDesarrollo de juegosAplicaciones complejas de una sola PáginaEn resumen cada una de ellas estáen continuo desarrollo para el soporte de distintos proyectos y arquitecturas queda de tíimplementarlos de la mejor forma Me despedido y espero les agrade este vs espero sus comentarios Imagen por Marius Niveri en Unsplash |
2021-11-14 18:19:01 |
海外TECH |
DEV Community |
How to deploy any Python Web Application? |
https://dev.to/abhijithganesh/how-to-deploy-any-python-web-application-1707
|
How to deploy any Python Web Application Hey everyoneIn this blog post I will explain how you can deploy any ASGI WSGI compliant Python Web App DISCLAIMER Only ASGI Compliant Frameworks can be deployed using this method other frameworks can t be deployed List of Tools I will be using NGINXHypercornFastAPI Now here there are alternatives to Hypercorn and FastAPI Alternatives to Hypercorn GunicornUvicornDaphne Other Frameworks that can be deployed FlaskDjangoStarletteAny ASGI WSGI compliant framework Step One Setup your framework using the docs mentioned DjangoFastAPIFlaskSince I ll be using FastAPI my main py looks like thisfrom fastapi import FastAPIapp FastAPI app get def hello world return f Hello World We now have a FastAPI app ready we now have to deploy it using NGINX ️ Step Two Depending upon your framework and choice of ASGI WSGI Server this process will be slightly different For Django Devs Your wsgi asgi application would be called as lt application name gt lt a w gt sgi applicationChoose ASGI or WSGI clearly and stay with that option throughout For Flask Devs If your app is in main py it would be called as main appIn this step we ll be binding the web server to UNIX socket Learn more about UNIX Sockets hereI am attaching the docs of Daphne Uvicorn and Gunicorn down which use different flags to bind the application to a port Run this command to bind it to the sockethypercorn b unix var tmp hypercorn sock w main appIn this w defines the number of workers Change hypercorn sock to the server which you choose to use Change the socket name according to your web serverNow we have our app listening on the hypercorn sock Step Three We ve to proxy this socket to NGINX and route NGINX to listen to the hypercorn socket worker processes events worker connections http server listen server name localhost access log var log nginx access log error log var log error log location proxy pass http unix var tmp hypercorn sock I ll briefly explain this config file Worker processes gt worker process has been assigned for this specific task processWorker connections gt Number of connections that can be handled by processListen gt Listens at the mentioned portServer Name gt Listens at this domainAccess log gt The file location at which access log is stored access log stores requests madeError log gt The file location at which error log is stored Proxy Pass gt The socket port which needs to be proxied This file should change based on your socket but the other configuration can be the same Save this file as nginx confFeel free to read about NGINX hereOnce this file is made save it at etc nginx Either you can use docker to run a Linux server or shell into an instance If you want to copy it to docker COPY nginx conf etc nginx You are ready to launch except one last step Step fourYou have now wonderfully setup your web server and the NGINX proxy You are just one step away from accessing the port and perhaps this is the or stepCurrently NGINX can t read or write from the socket so we need to change access modeTo do this run the following command chmod var tmp lt socket gt sudo service nginx restartNow you can listen from the port http localhost If you are using systemctl please use this command instead sudo systemctl restart nginxPlay around with NGINX config as you wish based on your application s requirements Thanks for reading Docs UvicornGunicornDaphne |
2021-11-14 18:17:01 |
Apple |
AppleInsider - Frontpage News |
NYTSTND Quad Tray MagSafe review: bring some class back to nighttime charging |
https://appleinsider.com/articles/21/11/14/nytstnd-quad-tray-magsafe-review-bring-some-class-back-to-nighttime-charging?utm_medium=rss
|
NYTSTND Quad Tray MagSafe review bring some class back to nighttime chargingThe NYTSTND Quad Tray MagSafe is an expensive four way charger made from leather and Amish sourced wood that declutters your bedside table while remaining stylish The NYTSTND Quad Tray MagSafe can charge four devices at onceNYTSTND offers a variety of chargers made of premium materials We tested the Quad Tray MagSafe with an oak finish black leather and USB C iPad connector but there are other configurations to suit individual needs Read more |
2021-11-14 18:54:42 |
海外TECH |
Engadget |
Apple has tight control over states' digital ID cards |
https://www.engadget.com/apple-digital-id-card-iphone-control-over-states-182100119.html?src=rss
|
Apple has tight control over states x digital ID cardsApple s digital ID card support in iOS may be convenient but it also comes with tight requirements for the governments that use them CNBC has learned states using Apple s system are required to not only run the platforms for issuing and checking credentials but hire managers to handle Apple s requests and meet the iPhone maker s performance reporting expectations States also have to quot prominently quot market the feature and encourage other government agencies both state and federal to adopt the technology Contracts are nearly identical for Arizona Georgia Kentucky and Oklahoma some of the earliest adopters of the program That suggests other states including Connecticut Iowa Maryland and Utah may have to honor similar terms Apple declined to comment A representative for Arizona s Transportation Department told CNBC there were no payments to Apple or other quot economic considerations quot though the states would have to cover the costs The details raise a number of concerns While it isn t surprising that states would have pay for at least some of the expenses the contracts give a private company a significant amount of control over the use and promotion of government systems while asking governments to foot the bills There s also the question of what happens when Android digital IDs become available ーhow do states juggle multiple platforms Apple isn t preventing states from offering IDs on Android but its requirements could give it a significant early advantage |
2021-11-14 18:21:00 |
ニュース |
BBC News - Home |
COP26: Climate deal sounds the death knell for coal power - PM |
https://www.bbc.co.uk/news/uk-59284505?at_medium=RSS&at_campaign=KARANGA
|
glasgow |
2021-11-14 18:25:14 |
ニュース |
BBC News - Home |
Liverpool Women's Hospital: One dead in car explosion outside hospital |
https://www.bbc.co.uk/news/uk-england-merseyside-59282354?at_medium=RSS&at_campaign=KARANGA
|
police |
2021-11-14 18:38:53 |
ニュース |
BBC News - Home |
T20 World Cup: Australia beat New Zealand by eight wickets in final |
https://www.bbc.co.uk/sport/cricket/59282104?at_medium=RSS&at_campaign=KARANGA
|
world |
2021-11-14 18:36:09 |
ニュース |
BBC News - Home |
Japan's former princess Mako arrives in New York after giving up title |
https://www.bbc.co.uk/news/world-asia-59280707?at_medium=RSS&at_campaign=KARANGA
|
commoner |
2021-11-14 18:47:29 |
ニュース |
BBC News - Home |
Lewis Hamilton takes superb win in Sao Paulo after Max Verstappen overtake |
https://www.bbc.co.uk/sport/formula1/59284292?at_medium=RSS&at_campaign=KARANGA
|
Lewis Hamilton takes superb win in Sao Paulo after Max Verstappen overtakeLewis Hamilton passes title rival Max Verstappen after an intense battle to take one of his greatest victories and win the Sao Paulo Grand Prix |
2021-11-14 18:40:54 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「アベノマスクは無駄」と断罪した会計検査院とはどんな組織なのか - ニュース3面鏡 |
https://diamond.jp/articles/-/287273
|
「アベノマスクは無駄」と断罪した会計検査院とはどんな組織なのかニュース面鏡会計検査院は年度決算検査報告をまとめ、新型コロナウイルス対策を巡る関連事業を含めた計件、総額億万円の無駄遣いなどを指摘し、岸田文雄首相に日、報告書を手交した。 |
2021-11-15 03:55:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「赤ちゃんって、どうしたらできるの?」と聞かれたとき、親が絶対にしてはいけないこと - 100倍明るい家族計画 |
https://diamond.jp/articles/-/287083
|
明るい家族計画 |
2021-11-15 03:50:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
テレワーク疲れや孤独感からオフィス回帰の傾向、心理的ケアも含めたデジタル化を - 数字は語る |
https://diamond.jp/articles/-/287233
|
警戒 |
2021-11-15 03:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
日本生命で三度発覚した「退職金共済」不正契約の特殊な中身 - ダイヤモンド保険ラボ |
https://diamond.jp/articles/-/287467
|
中小企業 |
2021-11-15 03:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
南アに脱石炭の難題、富裕国は支援するのか - WSJ PickUp |
https://diamond.jp/articles/-/287464
|
wsjpickup |
2021-11-15 03:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
米の若年富裕層、資産運用でプロの助言求めず - WSJ PickUp |
https://diamond.jp/articles/-/287465
|
wsjpickup |
2021-11-15 03:30:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
習氏さらなる権威固め 「歴史的人物」に - WSJ PickUp |
https://diamond.jp/articles/-/287466
|
wsjpickup |
2021-11-15 03:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【お寺の掲示板95】“雑用”という用事はない - 「お寺の掲示板」の深~いお言葉 |
https://diamond.jp/articles/-/287138
|
牧野富太郎 |
2021-11-15 03:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
優れた経営者にはもう常識!世界標準のビジネスをドライブする「SF思考」 - SFでビジネスが跳ぶ! |
https://diamond.jp/articles/-/287001
|
|
2021-11-15 03:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「孤独」がマイナスからプラスに転じるきっかけとは - 孤独からはじめよう |
https://diamond.jp/articles/-/287443
|
自分 |
2021-11-15 03:10:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
なぜ、ダメなリーダーほど「部下のやる気」にこだわるのか? - チームが自然に生まれ変わる |
https://diamond.jp/articles/-/287405
|
そんな新時代のリーダーたちに向けて、認知科学の知見をベースに「“無理なく人を動かす方法」を語ったのが、最注目のリーダー本『チームが自然に生まれ変わる』だ。 |
2021-11-15 03:05:00 |
海外TECH |
reddit |
Toto Wolff reaction to Lewis overtaking Max Verstappen |
https://www.reddit.com/r/formula1/comments/qtvwbs/toto_wolff_reaction_to_lewis_overtaking_max/
|
Toto Wolff reaction to Lewis overtaking Max Verstappen submitted by u magony to r formula link comments |
2021-11-14 18:22:47 |
海外TECH |
reddit |
2021 São Paulo Grand Prix - Post Race Discussion |
https://www.reddit.com/r/formula1/comments/qtw6a9/2021_são_paulo_grand_prix_post_race_discussion/
|
São Paulo Grand Prix Post Race DiscussionROUND Brazil FORMULA HEINEKEN GRANDE PRÊMIO DE SÃO PAULO Fri Nov Sun Nov São Paulo Session UTC Free Practice Fri Qualifying Fri Free Practice Sat Sprint Qualifying Sat Race Sun Click here for start times in your area Autódromo JoséCarlos Pace Length km mi Distance laps km mi Lap record Valtteri Bottas Mercedes pole Max Verstappen Red Bull Racing Honda fastest lap Valtteri Bottas Mercedes winner Max Verstappen Red Bull Racing Honda Race results Pos No Driver Team Laps Time Retired Points Lewis Hamilton Mercedes Max Verstappen Red Bull Racing Honda s Valtteri Bottas Mercedes s Sergio Perez Red Bull Racing Honda s Charles Leclerc Ferrari s Carlos Sainz Ferrari s Pierre Gasly AlphaTauri Honda lap Esteban Ocon Alpine Renault lap Fernando Alonso Alpine Renault lap Lando Norris McLaren Mercedes lap Sebastian Vettel Aston Martin Mercedes lap Kimi Räikkönen Alfa Romeo Racing Ferrari lap George Russell Williams Mercedes lap Antonio Giovinazzi Alfa Romeo Racing Ferrari lap Yuki Tsunoda AlphaTauri Honda lap Nicholas Latifi Williams Mercedes lap Nikita Mazepin Haas Ferrari laps Mick Schumacher Haas Ferrari laps NC Daniel Ricciardo McLaren Mercedes DNF NC Lance Stroll Aston Martin Mercedes DNF Useful links F com Race Wiki Race Autódromo JoséCarlos Pace Streaming amp Downloads For information on downloads please visit r MotorSportsReplays Please do not post information about downloads in this thread Thank you submitted by u F Bot to r formula link comments |
2021-11-14 18:35:25 |
海外TECH |
reddit |
SKYSPORTS ANGRY NOISES |
https://www.reddit.com/r/formuladank/comments/qtvo3r/skysports_angry_noises/
|
SKYSPORTS ANGRY NOISES submitted by u subhuffer to r formuladank link comments |
2021-11-14 18:12:16 |
コメント
コメントを投稿