AWS |
AWS Messaging and Targeting Blog |
How to use domain with Amazon SES in multiple accounts or regions |
https://aws.amazon.com/blogs/messaging-and-targeting/how-to-use-domain-with-amazon-ses-in-multiple-accounts-or-regions/
|
How to use domain with Amazon SES in multiple accounts or regionsSometimes customers want to use their email domain with Amazon Simples Email Service Amazon SES across multiple accounts or the same account but across multiple regions For example AnyCompany is an insurance company with marketing and operations business units The operations department sends transactional emails every time customers perform insurance simulations The marketing department sends … |
2021-10-11 13:39:10 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
ABC139 C - Lower を解いた |
https://qiita.com/AKpirion/items/2563ac4d0959eb2d1aef
|
hiansmaxanscntcntprintans |
2021-10-11 22:50:27 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
犬・猫画像識別アプリ作成 |
https://qiita.com/genki-0428/items/efe605691eba00e4f66d
|
犬・猫画像識別アプリ作成犬・猫画像識別アプリ作成はじめに初めましてpython初心者のgenkiです。 |
2021-10-11 22:31:12 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
ゲームプログラマーについて |
https://teratail.com/questions/363931?rss=all
|
ゲームプログラマーについて現在大学年生文系偏差値程度です。 |
2021-10-11 22:57:10 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
rails で attributesを条件分岐したい |
https://teratail.com/questions/363930?rss=all
|
railsでattributesを条件分岐したい前提・実現したいこと元々Java開発をしていましたが、現在Rails開発に携わっています。 |
2021-10-11 22:34:16 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
関数を値にしたファイルを生成するには? |
https://teratail.com/questions/363929?rss=all
|
関数を値にしたファイルを生成するには前提・実現したいこと関数を値に置き換えたファイルを生成しようとしていますが、うまくいきません。 |
2021-10-11 22:31:32 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
【Wordpress】category.phpのページ数の制御、人気記事の表示方法を正常にしたい |
https://teratail.com/questions/363928?rss=all
|
|
2021-10-11 22:25:30 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
pythonでcsvを取り込みグラフ化した内容の修正方法について |
https://teratail.com/questions/363927?rss=all
|
とあるcsvをグラフ化して見やすいレポートを作ろうと思い、色々情報をググって、CSVから取り込んだデータをグラフ化したところ、棒グラフ内の数値がズレたり、一部グラフの高さが数値に反して高くなったりしています。 |
2021-10-11 22:20:30 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
devise ログイン後の遷移先を指定する時に気になったことを深掘りしてみた。 |
https://qiita.com/gobtktk/items/9f13aa271b7876ba9935
|
つまり、extractpathfromlocationlocationの戻り値こそが、ログイン後のリダイレクト先ということになります。 |
2021-10-11 22:45:06 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
WSL2 上のアプリケーションに別ホストからアクセスする方法(管理者権限なし) |
https://qiita.com/yokra9/items/cc81b2869ec1e9bda950
|
ホストからWSLにポートフォワードさせるポートフォワード機能を持ったアプリケーションの一例として、stoneを利用してみましょう。 |
2021-10-11 22:39:12 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
WPScanを使ってWordpressの脆弱性チェック |
https://qiita.com/holdout0521/items/03a2297cda8f20289c7b
|
WPScanを使ってWordpressの脆弱性チェックはじめにWPScanを使用することで、プラグインやテーマの脆弱性チェックすることができます。 |
2021-10-11 22:03:53 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
devise ログイン後の遷移先を指定する時に気になったことを深掘りしてみた。 |
https://qiita.com/gobtktk/items/9f13aa271b7876ba9935
|
つまり、extractpathfromlocationlocationの戻り値こそが、ログイン後のリダイレクト先ということになります。 |
2021-10-11 22:45:06 |
技術ブログ |
Developers.IO |
Unity上のモーションでUE4のモデルを動かしてみた |
https://dev.classmethod.jp/articles/vmc_to_mop_ue4_mocap_test/
|
motioncapture |
2021-10-11 13:06:35 |
海外TECH |
Ars Technica |
The Chevrolet Bolt recall has begun; cars will get new battery packs |
https://arstechnica.com/?p=1802937
|
battery |
2021-10-11 13:12:28 |
海外TECH |
DEV Community |
Writing an Engaging, SEO-Friendly Technical Content: Tips from Fellow Creators |
https://dev.to/aviyel/writing-an-engaging-seo-friendly-technical-content-tips-from-fellow-creators-3pn1
|
Writing an Engaging SEO Friendly Technical Content Tips from Fellow CreatorsThe role of writers in building brands is indispensable today From global tech giants like Facebook to budding startups carefully articulated content is essential in attracting consumers building user base and maximising user retention rate Aviyel works with creators around the globe and features informative content around open source projects Here s a quick guide to the basics of technical writing that certainly answers how to begin with technical writing from a scratch with Aviyel Who are we Aviyel works with open source creators to build and incentivise active communities achieve financial independence and increase adoption of their projects At Aviyel we are building a knowledge repository to share their contents experiences and support for open source projects We are the bridge connecting open source communities businesses and developers who build great products Role of freelancers in building a platform like AviyelGreat open source projects deserve great content Open source has always had a content problem creating difficulties connecting with the audience Here s where writers come into the picture Creators are a building block of any organisation regardless of the size The content developers through their product allow companies like Aviyel to kickstart the conversations around open source and help OSS projects to climb the desired mark We want you to help build OSS communities for our partners through your content What do enterprises expect from creators To create well planned well researched and well crafted articles Inform the developer ecosystem stimulate a new and critical discourse around Open Source creators projects and community The blog post should sound human and curated in a way that all reader questions are answered While preparing a draft of your blog please ask yourself if this is what I want to read as a reader This is how you will polish your writing style by quick elimination and bringing rigor to your content If you encounter any difficulty while writing formulating your thoughts on a write up reach out to our content community and Aviyel s content management team on our Discord channel Above all we will assist each other to learn grow and accomplish their missions in life Voice and ToneGenerally most articles follow this standard VoiceInformativeTechnicalConfidentHuman ToneQ amp A ConversationalBlog OpinionatedHow to s and Tutorials InformativeCheat Sheets Checklists and To do s ReportReviews AnalystThought pieces Storyteller Word CountThe article should contain around words Although editors do appreciate you going the extra mile please make sure the extra content adds rigor and value to your content rather than make it dormant Structure of BlogIntroduction First line should have the primary keyword Please use a stat or recent example to supplement your introduction Must contain at least one external linking mostly to your stat Body The body should have a minimum of two headings Both internal and external linking is required The headings must include your keywords Conclusion Can be quoted as “Way Forward Parting Note Please connect your article with Aviyel s vision and add Aviyel s relevant social media blog links Sample Aviyel is partnering with MobSF to deliver a one of a kind mobile security infrastructure available in the electronics industry We are embarking on a journey to monetise open source software and build a developers driven community with constant flow of knowledge ideas and goals To know more about Aviyel s recent endeavors follow our discussions here Join Aviyel s Twitter space at AviyelHQ Moreover the structure of your blog primarily depends on the niche of your post For instance if you are curating a step by step tutorial or contribution guide try to include some generalised pointers like prerequisites attributions and a summary of your writeup in conclusion Similarly if you are attempting a benchmarking article make sure to enlist pros cons and difference between the two technologies you are writing about You can checkout a sample guide Keyword OptimisationThis is the heart and soul of your write up A blog mainly consists of main keywords out of which primary keyword will lift your blog ranking To rank your blog on search engines please ensure your keyword is stuffed at the right places Do not overuse your keywords An ideal keyword density means using your primary keyword once in every three lines Please follow the ritual the next time you draft an article Other pointers At least two of your headings must have the primary keyword The first paragraph of your blog must contain the primary keyword It s better if you use it in the first two lines themselves There is no right answer to how many times your keywords should appear in your blog However please make sure your secondary keywords are stuffed at least times in the entire blog Frame your content around your keywords not vice versa The title should not be more than word long The keyword must come in the first words PlagiarismAviyel or any other company per se is strictly against plag Please use any plag detection tool before submitting your article to the content team at Aviyel At times plag is a result of adding repeated quotations or stats Try to modify their language without changing the essence Important PointersUse minimum passive voice It decreases the readability score of your blog Try not to use big words with more than two syllables Use Headings as much as you can It decreases the complexity meter Image caption and title should involve keywords in a robust manner Download your images with the title of your blog Complex sentences reduce readability scores and may not pacify the reader s imagination Short and crisp sentences enrich the content Try to wrap most of your sentences in words Use Social media links Embed them in your articles Internal and external linkingDo not end your headings with a period semicolon Make sure your content is fresh Freshness enhances the SEO of your content Conclude your blog with Aviyel s vision social media links Formatting Headlines TitlesWrite in title caseMake sure you use your primary keyword within the first five words Primary Section Headers Use Heading Key Subheads That Should Show Up in Contents Use Heading Third Tier Subheads Use SubtitleBody Normal TextExamples Indent Normal Text use bullets as necessary SubheadsInclude and follow the H gt H gt H hierarchy strictly Your headings should start with H then followed by H Do not forget to use your primary keyword in headings and subheadings BodyBullets default CMS bullet aligned leftNumbering default CMS aligned leftFont bold italicsLeave font as “paragraph style unless using a subhead Bold subheads No need to italicize HyperlinksEmbed link for SEO set to open in a new tab ImagesWhenever you download images from Google Images make sure the title of the blog is the title of your images When inserting the image in the doc CMS platform please caption the image with the primary keyword If project title MobSF Best practices and TipsImage captions can be Features of MobSF Analysis of Mobile Security Framework Embeddable ContentHere I am talking from Aviyel s perspective VideosBe opportunistic to include YouTube of vloggers approved by Aviyel here in this case only Social media postsBe opportunistic to embed Facebook Twitter Instagram and other posts of Aviyel yours or other Aviyel freelancers writing on similar issues Find social media handles of our partners Docz MobSF etc and embed them into your posts Aviyel House StylebusinessPlural businessesSing possessive business sPlural possessive businesses FinTech businesses burst onto the scene in The business s toxic work environmentBusinesses policies for work life balance emailOne word no hyphen internetAlways lowercase except when used as part of a name or proper noun log in loginlog in intransitive verb and login adjective noun Never log on never hyphenated Log into the master as root Log in to complete the steps multicloudOne word no hyphen operating systemThe foundational software that runs a computer server mobile device OS is acceptable on second use operating systems OSsopen source softwareNo hyphen between open and source Do not capitalise on open source in between the sentences softwareAs an uncountable noun software is always singular job titlesDo not capitalise job titles unless they follow a name or are used as part of the name Co Founder Jose KuttanJose Kuttan the co founder of Aviyel SourcingDon t use only one source of informationDon t exclusively or repeatedly use the same sourcesSources should reflect the diversity in our communities Attribution In line in copy“The open source industry will grow by X by according to McKinsey Parting NoteIt is vital to build a fresh SEO laiden copy of your posts Above I have summarised a number of tips and techniques you can use to master your content However SEO enrichment would work only if your content is up to date with greater visibility Gaining followers to your blog isn t about fine keywords but quality of your content You can follow Aviyel for similar styleguides To read the full article tap here |
2021-10-11 13:45:46 |
海外TECH |
DEV Community |
How Much Does It Cost To Build a CRM System? |
https://dev.to/ascendixtech/how-much-does-it-cost-to-build-a-crm-system-5ag
|
How Much Does It Cost To Build a CRM System Originally published at Ascendix Tech s blog The worldwide CRM software market is expected to reach over bln by with a CAGR of per year according to Statista These numbers mean that more and more companies continue to invest large funds into improving their lead generation funnels customer service lead to deal rates and other activities through purchasing or building a powerful CRM system Today we want to discuss how much does it cost to build a CRM system comparing both ready made solutions and custom CRM software for your business Let s get down to business Custom CRM Development vs Ready Made SolutionsBefore getting right into discussing the CRM development cost we want to briefly shed the light on the key options you have to get a customer relationship management system for your business Generally there are three of them Develop custom CRM from scratch Customize existing CRM solutions i e on top of Salesforce or Dynamics Purchase a ready made CRM software license Let s now highlight the pros and cons of each solution and then compare them by the same criteria Custom CRM DevelopmentPros High system performance level High compatibility in terms of integrations with any third party platforms you need High data security level using the latest encryption protocols High flexibility by building a single IT infrastructure for all departments Cost efficient solution in the long run ConsHigh initial price for building and setting up the system Much time required to create a CRM from scratch Costly maintenance CRM CustomizationProsCost savings as you need only to build several specific features on top of ready made solutions Save much time as most features and infrastructures are preliminary ready for use Avoid much technical issues Get enough customizability and flexibility for your business Frequent platform updates automatically ConsYou still need to purchase licenses for each new CRM user You still don t get full flexibility in terms of features and integrations Off The Shelf CRM SystemsProsSave much time and start using a CRM within a couple of minutes hours Lots of features out of the box Existing integrations with third party tools ConsLow flexibility level Extra funds on the functionality you may never use High CRM development cost in the long run Limited customization opportunities Potential scalability issues in the future Let s now dive into a more detailed comparison of the mentioned options covering and cover the most crucial aspects for your business CRM Development Cost Key Price ComponentsNow we want to share the core CRM system modules that will impact the final CRM development cost This way you will have a better understanding of the key components that should complement your CRM system so that you know what you re paying for Admin PanelThis is a cornerstone of your future custom CRM software which is responsible for system rights management authorization processes navigation and account settings So software engineers will need to develop advanced server side logic and features to make server request architecture as fast as possible Moreover development teams will need to create an easy to use and lightweight user interface to offer your employees easy to use and advanced CRM software user experience Sales ModuleSales functionality block is one of the most crucial parts of your CRM system as it empowers your sales managers to automate their daily workflows and utilize contacts management task management get sales data analytics and many other features Marketing ModuleCRM software is a must have system for your marketing department as well Marketers create personalized customer profiles analyze market segments verify the quality of leads they generate and build powerful email campaigns for leads and contacts stored in your CRM software Customer Support ModuleYour custom CRM software should provide an advanced customer support functionality block In general it includes a help desk agent console knowledge base portal service analytics case report and management cloud based data storage and many other features So we have discussed the most default features and modules of your custom CRM software And here comes the question how much does it cost to build a CRM Below is the list of technical specialists required to build the functionality blocks listed above Frontend developers Backend developers Technical team leads UI UX designers Project managers QA testing engineers DevOps specialists Business analysts Now you have a better understanding of the technical specialists that will most likely take part in building testing designing and controlling your custom CRM development project In terms of the CRM development cost it may greatly vary depending on the complexity and number of features you need You will have a more clear understanding after conducting a discovery phase or requesting an estimate from a CRM development company that you want to partner with Generally an approximate custom CRM software development starts from building must have functionality Final WordsCustom CRM development cost is a complex and multicomponent term which should be estimated based on your business challenges and technical needs If you want to learn more details check the full blog article CRM Development Cost Ready Made Solutions vs Custom CRM Software |
2021-10-11 13:43:30 |
海外TECH |
DEV Community |
Button Fill Animation |
https://dev.to/codezhub/button-fill-animation-1bfk
|
Button Fill Animation You Can Check Here for More Codelivly com If you enjoyed this article you can on where I regularly post bite size tips relating to HTML CSS and JavaScript Happy Coding |
2021-10-11 13:41:41 |
海外TECH |
DEV Community |
Resolving Conflicts within your dev team |
https://dev.to/codesphere/resolving-conflicts-within-your-dev-team-1hfh
|
Resolving Conflicts within your dev teamConfrontation is inevitable in the close knit and often stressful environments many dev teams work in It is a rare group of people that can work together towards the same goal and not disagree sooner or later The issue is not the arisal of conflict but how you manage it The way a team works through disagreements to find common ground can be the difference between a good team and a great one Denial is not a river in Egypt but it is one of the most common problems when it comes to resolving conflict Unfortunately avoidance is an all too common response to conflict A response that usually only serves to draw an issue out and ultimately helps nobody Granted not every disagreement needs an intervention and team building retreat before it s solved but having the tools to help your team communicate is how you will find your way to productivity Conflict can come from anywhere a bad code review a design disagreement or even just a team member having a bad day In a high paced environment the smallest miscommunication can escalate into an issue that can cause the whole team to be disrupted Whatever the conflict there is always a simple rule to remember Conflict exists when one party has a need for another and that need is not being met The first thought you might have is that not all disputes fit so neatly into this simple definition but think of it as a jumping off point to help you understand and hopefully solve the issue… Communicate the needIt is important to understand what each party is trying to achieve in any given conflict what is their stance and why are they involved at all This might be as simple as one party requesting a resource or action from another or it may be much more complicated in that there is no single need to be filled in order to resolve the issue The important thing is to establish communication on what all parties are trying to accomplish In many cases simply allowing all parties to vocalize their position can create enough space for a compromise to be achieved Whether or not the need can be realistically met is not the goal of this step it is simply to establish communication and an understanding Meet the needIf the need can be met within reason then great Conflict resolved If not then negotiation can begin Again we cannot speak to all situations with a single magic solution but once all parties have vocalized their argument and there is still no clear solution then you would hope cooler heads can prevail and a compromise that suits everyone or at least restores harmony can be made Only if these steps fail do rd parties need to be involved for conflict resolution a very common issue that many teams totally skip these steps People can have a tendency to avoid the issue altogether or manifest their issue with aggression instead of trying to hear both sides…If you take anything away from this article it should be that all members of a successful dev team should be equipped with the tools to vocalize their needs with conflict counterparts and try to meet that need if possible Conflict resolutionThird party intervention is the only option left if the conflicting parties are unable to find a solution on their own A member of the leadership team should be able to act as an impartial adjudicator of a disagreement and make an unbiased decision that gets everyone involved back on track The key here is listening and understanding the argument and making the most effective decision for the development of the project not to disrespect or diminish any team member A resolution needs to be found one way or the other in order for the team to get back to work and steps to keep everyone as happy and efficient as possible are the result of any good conflict resolution How to avoid conflictThese tools are great for your team to know and implement but avoiding situations that cause friction between team members is an altogether better approach Set clear goalsEnsuring all team members are well informed and on the same page is a great first step to avoiding miscommunication and conflict Trying to make any group of people pull together to achieve a task can be difficult everyone has their own opinion Well defined tasks will help team members see the destination clearly and avoid disputes about the best route to get there Lines of communicationHealthy lines of communication don t need much explanation but make sure the team is able to speak to one another and clear up any issues before they escalate into a potential problem Maybe your goals were not as clearly defined as you thought Well accessible communication will allow all team members to clarify what may be causing them a bottleneck Effective onboardingA well planned and informative onboarding process will help every new team member s transition into the team be as smooth as possible Company vision KPIs technical documentation tools the team uses roles and responsibilities are all key things for a new hire to know and understand to avoid any conflict with new team members down the line ConclusionClearly defining the roles and responsibilities of each team member along with a well defined goal and metrics will keep conflicts to a minimum It s easier for everyone to sing from the same hymn sheet if everyone has the same one A well structured company with well established and open communication is the best way to keep your team working together and in harmony If and when conflict does arise the ideal scenario would see all parties involved exercising their ability to vocalize their issue with as little ego as possible Understanding one another and finding a compromise where possible should be the goal This isn t always going to be possible but it should be a skill set all team members at least strive to achieve if an effective workflow is to follow Understandably not every hire your team ever makes will be an emotionally mature and well balanced individual capable of clearly communicating their needs and finding healthy solutions to conflict The foundation of any effective team though is communication Giving your team these tools or even trying to establish them as a part of the culture will go a long way in avoiding many issues and keep you focused on the important stuff What does your team use to resolve conflicts Let us know down below And as always happy coding from your friends at Codesphere the bottleneck free cloud provider Written by Dan Parry |
2021-10-11 13:41:34 |
海外TECH |
DEV Community |
Flutter for JS devs - LLF #6 |
https://dev.to/nombrekeff/flutter-for-js-devs-llf-6-dd1
|
Flutter for JS devs LLF Hey there I m back with another entry to this series so Javascript right We all love and hate it yet have no choice but to use it if we want to create interactive websites kinda As a result many developers know Javascript or have at least used it on some occasion Consider this post as a comparison between some common aspects of both JS and Dart applications like async code handling lists arrays Table Of ContentsEntrypointsLoggingFunctionsBoolean checksFutures PromisesAsync AwaitMaps ObjectsRunning an appLearning more EntrypointsThe first step to creating an app is launching starting it In dart an entry point function is required for all applications in contrast to Javascript where it s up to you to define such a function Note that if you use a framework it might require you to define an entry point of some sort Let s see how Dart does it and then show some examples of how we do that in javascript and some frameworks DartIn dart all applications are required to start with a main function void main Your initial code would go here FlutterIn flutter we are also required to define a main function But to start the app we must call the runApp function This will bootstrap and start our app void main runApp const MyApp JavascriptJavascript is not as strict and doesn t force us to write a main function or any kind of entry point really Some might start directly when the script loads or maybe wait until the page is fully loaded Others might only start when a button is clicked and so on When script loads function startHere Your initial code would go here startHere Called when script is loadedWhen page loads function startHere Your initial code would go here document addEventListener load gt Called when the page fully loaded all the HTML and external resources AngularAngular does not require us to define an entry point function but it requires us to create a main file where we will bootstrap start our application That file would look something like this imports platformBrowserDynamic bootstrapModule AppModule catch err gt console error err Angular uses TypeScript but it s the same drill React NativeReact native somewhat forces you to create an entry point in the form of a React Component import React from react import Text View from react native const HelloWorldApp gt return lt View style flex justifyContent center alignItems center gt lt Text gt Hello world lt Text gt lt View gt export default HelloWorldApp LoggingDart does not offer such a variety of logging possibilities as the Javascript console We are limited to just a single method print without adding external packages like logger Dartvar example I will I do I can I should could do yeh print I can only log a single string but can easily interpolate variables like this example JavaScriptlet example I will I do I can I should could do yeh console log I can only log more than a single string but can easily interpolate variables like this example Functions Javascript Regular functionfunction canFly player return player hasWings amp amp player isAChicken Arrow functionconst canRespawn player gt player isInmortal DartcanFly Player player return player hasWings amp amp player isAChicken or specifying the typebool canFly Player player return player hasWings amp amp player isAChicken Arrow functionbool canRespawn Player player gt player isInmortal Boolean checksIn Javascript null undefined an empty string are all evaluated as false And and any other non null value is evaluated as true Dart only considers the boolean value true as true So let s have a close look at how to perform some common checks Javascriptlet undefinedValue undefined let nullValue null let value let emptyString if undefinedValue return if nullValue return if value return if emptyString return null undefined and are all being treated as false Dartvar nullValue null int value String emptyString if nullValue null return if value return if emptyString isEmpty return As you can see in Dart we must implicitly check if it s a certain value Nothing is treated as a boolean except booleans themselves makes sense We must use the equality operator to implicitly check for null and other valuesFor empty string we can use the built in isEmpty method Futures PromisesBoth Javascript and Dart support single threaded execution Javascript offers the Promise object to handle this while in Dart we use Future objects These classes represent the eventual completion or failure of some operation We commonly use Futures and Promises objects when calling remote APIs via HTTP requests as they take a long time to complete Synchronously doing this operation would freeze the application until the operation either fails or completes Javascriptfunction answerOfLife const url return fetch url then result gt result json const result answerOfLife then result gt result answer catch error gt console error error Dartimport package http http dart as http import dart convert Future lt Response gt answerOfLife const url return http get url then response gt jsonDecode response body void main var result answerOfLife then response gt response answer catchError error gt print error Did you know that you can create Web Apps with Flutter It seems it s not ready for big scale applications though it does the job with some work on our part Async AwaitIf you are familiar with Javascript async await Dart is almost exactly the same We mark the function with the async keyword then we can use the await keyword to wait for promises futures to complete Javascriptfunction answerOfLife const url return fetch url then result gt result json async function main try const result await answerOfLife then result gt result answer catch e console error error Dartimport package http http dart as http import dart convert Future lt Response gt answerOfLife const url return http get url then response gt jsonDecode response body void main async try const result await answerOfLife then result gt result answer catch e print error Arrays ListsDart handles arrays quite similarly to javascript with some differences Let s take a look at some of the most common list operations Creating arraysDart Typed listList lt int gt steps Untyped listList stepsAndBabyNames Jonathan Joseph Tommy Javascriptconst steps const stepsAndBabyNames Jonathan Joseph Tommy Iterating arraysDart Using for in loopfor var step in steps print Step step Clasic for for int i i lt steps length i print Step steps i forEachsteps forEach step gt print Step step Javascript Using for in loopfor let step in steps console log Step step Clasic for for let i i lt steps length i console log Step steps i forEachsteps forEach step gt console log Step step Map itemsDartsteps steps map step gt step step toList In dart we need to call toList to convert back to a List as map returns a lazy Iterable docs Javascriptsteps steps map step gt step step Filter itemsDartsteps steps where step gt step gt toList Javascriptsteps steps filter step gt step gt Get a part of the listDartsteps sublist Javascriptsteps splice Item existsDartsteps contains Javascriptsteps indexOf steps includes Find index of itemDartsteps indexOf Javascriptsteps indexOf Find single itemDartsteps firstWhere step gt step Javascriptsteps find step gt step toList Has itemsDartsteps isNotEmpty Javascriptsteps length gt Maps ObjectsMost languages offer some sort of data structure to create unstructured data dart is not different and offers the Map type Creating mapsDartMap lt String dynamic gt info name Samuel age Javascriptconst info name Samuel age Serializing Deserializing JSONDartimport dart convert Map lt String dynamic gt info name Samuel age var encodedString json encode info var decodedMap json decode infoString Javascriptconst info name Samuel age const encodedString JSON stringify info const decodedMap JSON parse infoString Running an appRunning apps differs from language to language and from framework to framework FlutterLet s first see how we do it in flutter Using the run utility in the IDEExecuting flutter run in the project root React NativeIn react native we use npm script npm runor yarn npm run AngularRun ng serve in the project rootExecute npm start Learning moreIntroduction to Dart for JavaScript DevelopersFirst flutter app SummaryAs seen in the post Javascript and Dart have quite a few things in common But differ in some aspects such as handling booleans or working with arrays This post just scratches the surface so let me know if you would like a follow up If you found this post useful please consider checking my previous post It s a similar format to this one but comparing the theming styling aspects of Flutter against CSS Flutter styling explained in CSS LLF Keff・Oct ・ min read dart flutter css tutorial And as always thanks for reading And remember to comment if you have any suggestions doubts or something you would like me to cover in these posts |
2021-10-11 13:39:19 |
海外TECH |
DEV Community |
Dynamic styling in Vue.js |
https://dev.to/ecordani/dynamic-styling-in-vue-js-46l
|
Dynamic styling in Vue jsWhen I started using Vue js as a front end framework I immediately enjoyed the easy way I can set up and manage my components Using single file components let me focus on all aspects regarding the way I build them I simply need to put tags inside a vue file and I can start shaping both the visual aspect and all the logics behind the component itself Talking about styling the first thing that official doc tells you is how to style a component simply insert a style tag usually at the end of the file and you re done But when you move on and start to build complex interfaces you immediately need to perform styling that goes beyond the simple composition of CSS classes So during my journey I discovered several ways to perform dynamic styling and this article aims to be a short reference for people that come up at first with this need In order to show you the different techniques I ll use a super simple button component that must use a specific background color value if a boolean prop is true ok maybe is too simple but so you ll grasp the concepts quickly Let s start with the component code lt template gt lt button class my button gt text lt button gt lt template gt lt script gt export default props text type String default isWarning type Boolean default false lt script gt lt style lang scss gt my button padding px px border radius px border lt style gt and we call the component like so lt my button text Attention is warning true gt Style bindingThis is the simpler solution just use Vue js style binding and change the CSS background color property lt template gt lt button class my button style background color isWarning FC CCC gt text lt button gt lt template gt Class bindingWith class binding we append a specific class only if the prop isWarning is truthy lt template gt lt button class my button warning isWarning gt text lt button gt lt template gt and below in the style tag lt style lang scss gt my button padding px px border radius px border amp warning background color FC lt style gt Computed styleAhh this is the technique I like the most We start defining a classes computed value that returns a string of CSS class names based on the component property isWarning value computed classes if this isWarning return my button warning return my button then we use the class binding we used above passing only the computed value lt template gt lt button class classes gt text lt button gt lt template gt Styled componentsStyled components is a famous CSS in JS library used especially by React developers and you can use it with Vue js too You can find the package here please note that it s compatible only with Vue x Install the package using yarn as the package manager yarn add vue styled componentsDue to the simplicity of the component we define it inside the parent component in the script tag First we must import the library import styled from vue styled components then we define the component a styled button and its property isWarning const btnProps isWarning Boolean const MyButton styled button btnProps padding px px border radius px border background color props gt props isWarning FC CCC Note the background color props gt props isWarning FC CCC here we are telling the library to change the CSS property based on then prop isWarning value Last step is to register the newly created component and use it inside the template components MyButton lt my button is warning true gt Attention lt my button gt Besides of styled components library there are also other CSS in JS libraries usable for Vue js for example Emotion through vue emotion package That s all hope you find this article useful If you know other techniques feel free to write me and I ll update the article Thanks for reading |
2021-10-11 13:26:57 |
海外TECH |
DEV Community |
Divtober Day 11: Slice |
https://dev.to/alvaromontoro/divtober-day-11-slice-bkd
|
Divtober Day SliceToday s divtober drawing got a little bit out of hand The word of the day is slice so I went for the obvious choice of a slice of pizza It looked a bit sad so I added cute eyes and a mouth Then I made it dance àla Peanut Butter Jelly Time and then I turned it into an audio element so it could dance sing to the music Here s the demo on CodePen Unfortunately due to the browsers privacy policies the songs don t autoplay anymore or not every time So the song won t start until you click on the slice of pizza In order to do that I had to cheat a little by adding an inline JavaScript command onclick this play It was fun using the lt audio gt tag instead of a lt div gt It opened a lot of doors for enhancing the drawing adding more than just animation A pity that the audio doesn t support autoplay or play on click without needing JS Also I learned about the playing pseudo class which I was going to use so the slice of pizza danced only with the music unfortunately it is not supported anywhere This is another example of an animation that looks better on Chrome than on the other browsers because of the property support that allows to animate the backgrounds |
2021-10-11 13:16:15 |
海外TECH |
DEV Community |
Use these expert-verified tips to enhance your technical writeups! |
https://dev.to/saharshlaud/use-these-tips-to-enhance-your-technical-writeups-3239
|
Use these expert verified tips to enhance your technical writeups There is no better feeling in this world than having your thoughts transformed into words and those words being helpful to other people The entire essence of Technical writing is to convert complex technical terminologies into a clear concise and easily understandable format for your audience While the result of technical writing seems to be quite clear the process of reaching that goal is definitely not a piece of cake The main point here is to keep things simple for the audience which a lot of writers struggle to incorporate in their write ups I recently had the chance to be a part of the Hashnode Technical Writing Bootcamp where I met some of the most outstanding personalities in the technical writing community Quincy Larson Sam Sycamore Edidiong Asikpo Chris Bongers and many others and the tips and suggestions shared by them surely helped me to shape my thoughts and actions as a technical writer Here are some tips that I think are useful for any technical writer despite the experience level or background Beginners Mindset is an AssetBeing a beginner at technical writing might be quite intimidating at times but this lack of expertise can be your biggest advantage also There are millions of beginners out there just like you who are trying to figure out different technologies Writing articles with a beginner s mindset makes it easier for the other beginners to relate to your content since they might also have gone through the same steps and encountered the same problems that you did So every time you re learning something new just write about it the steps that you followed and any issues that you encountered This way you ll not only connect with other beginners like yourself but also get your issues resolved by someone who had the same problems and has resolved them Let your personality shine through your articlesAlways try to provide a personal tone to your articles instead of copying the theme of an existing article Being yourself is the best way for your articles to be interesting and unique from the other articles Nowadays many writers plagiarize technical content and don t even provide proper credits Just be yourself and try to find your own voice because even if one of your articles blows up you ll be able to build an audience for yourself and those people will start to notice you for your personality Understanding your audienceOne of the greatest mistakes technical writers make is an improper perception of their audience An article on advanced React concepts is of no use if a majority of your readers are beginners in React So before writing an article always ask yourself some basic questions such as What does the audience need Where will they be reading it When will they read it etc Through this you shall have a clear idea of whether your audience requires an in depth article or a short and simple post whether the article will pertain to beginners intermediate or expert audiences and many other aspects that ll help you to frame your entire article All your articles should convey proper technical facts but more importantly to the proper audience ResearchThe backbone of technical writing lies in the research around the topic that you are writing on Try to understand every minute detail of the topic clearly and before writing an article to explain it to your audience Lack of proper research and correct technical information is what stops an ordinary writer from becoming extraordinary If you have sound knowledge about the concepts that you want to write on you can easily break them down into simpler ideas to better explain them to your audience and the only way to do so is through rigorous research In short Google the hell out of things that you want to write about It s okay to not knowSometimes you might not have all the desired skills required for technical writing and that is totally fine The most important aspect of technical writing is to start writing even if you might not know certain things Just start writing because you can always learn other skills on the way There are a lot of resources that can help you such as technical writing courses style guides technical communities etc Proper ReviewsReviewing and proofreading are essential tasks that should be performed multiple times before publishing an article online Don t be in a rush to publish your article after the first draft If possible take some time off from the article after finishing the first draft and then try to come back for a second look at it This way you will have a fresh start for your review and you might even notice certain pointers that you didn t notice before Try to fine tune your article to perfection However perfect your first draft might seem there are always some changes that you can do You can even take help from your friends colleagues community members to review your draft and provide suggestions It is always better to publish a properly reviewed article than the first draft GrammarBelieve it or not but all great technical articles have one thing in common proper grammar Grammar is the base of an article and improper grammar might lead to falling interest from the readers However great your technical knowledge and skills might be if you can t follow basic grammar rules in your write ups this knowledge is of no use to your audience Articles with grammatical errors often detract from the message or image the writer is trying to portray So always pay attention to the grammar in your article and you can even use tools such as Grammarly for your assistance Try to be consistentChris Bongers during his session at Hashnode Bootcamp said that there can be two meanings to being consistent according to him Consistency of Time Consistency of effortsConsistency of time simply means that you are consistent in the time that you spend on writing and publishing articles Consistency of efforts means that you put in a constant effort in all your articles no matter how the article performs online Both of these standards correspond to consistent writing Being consistent is a key factor because many writers start with huge excitement and might even publish several articles in the initial phases but then as time passes several factors such as personal problems work schedule content not getting traction etc might lead to fading away of the excitement and efforts Always try to keep writing despite all other things in your path and try to set some weekly or monthly writing goals to help you remain consistent because readers love to get fresh content and writing might even help you to de stress yourself ToolingYou might be giving your best efforts but with proper tooling you can enhance your productivity even further There is a huge array of tools available for each and every requirement whether it be publishing authoring scheduling image editing spell checking or anything else Grammarly is probably the most used spell check tool in the world and you can use its features to ensure proper grammar in your articles Notion is another great tool that can be used to keep a list of article ideas schedules and even drafts for reviewing The word tooling is not specifically restricted to software tools or apps Any resource that can assist you in your technical writing journey can be considered a tool Writer s groups blogging communities discord channels events social media etc are all such tools that might not have a specific set of features for you but they will surely help you enhance your content Graphics and StatsGraphics and visual aids can help your readers to better understand a particular concept Always try to include proper graphics such as images illustrations or videos that are related to the idea that you are focusing on Visuals appeal more to the audience than written content and if you can have a perfect blend between the two then you ll surely have better audience retention for your articles While graphics and images enhance the look and feel of your draft statistics help in building trust and credibility around your technical content Including properly researched statistics along with the reference to the source is generally considered a good practice especially for technical articles Last Words… So there you have it These were some of the tips that will surely help in your technical writing journey Many people think technical writing to be too complex as a profession or even a part time hobby but the reality is that the complexity of technical writing lies in the writer s mind Presenting information in a simple and easy to grasp manner is the main focus of technical writing which if followed correctly will automatically drive the audience towards your writeups So what are you waiting for grab a cup of coffee and get started on that blog post Hope you enjoyed my blog Thanks for reading Feel free to comment share and reach out to me on Dev to Twitter or LinkedIn |
2021-10-11 13:15:33 |
海外TECH |
DEV Community |
How to make a parser and a filter? |
https://dev.to/noriller/how-to-make-a-parser-and-a-filter-4g98
|
How to make a parser and a filter I ve waited to post this on Monday morning because well even if you don t like coffee more than any morning the start of the week is certainly for Coffee and Contemplation I prefer tea but unfortunately Tea and Contemplation doesn t roll of the tongue Now that you re primed what am I talking about ParserParser takes a input generally text and transforms it in a data structure that can be used in the following steps FilterFilter is a filter that filter things More enter and less get out Anyway What can you do if you combine then A search engine Of course there s a lot more behind the biggest ones you can think but in essence it s that it From the query you create a structure that the filter consumes and at the end of the pipeline you have the results you want Have you ever tried making one The easiest thing you can make and here I ll be using Javascript is something like const sourceArray your array with data const queryString probably from a input const filteredDataToReturn sourceArray filter element gt return JSON stringify element includes queryString I did say the easiest right The more right way to do it would be Object values element includes queryString Which is still really simple But far from any search engine Enters EasyFilter Yes as you might be realizing now this is a shamelessly self promotion post but please I will teach you how to make your own EasyFilter noriller easy filterIf you wanted to get even close to a real search engine you have to put in the work and when you re busy doing other things you just don t have the time to give your users what they expect a search input to be Google More than just random words you use quotes and even tag value pairs my inspirations were Google GmailStackoverflowGithubSeriously check their advanced search there s so much you can filter And with EasyFilter you can simply const queryString search for something this between quotes and then here you search for this const filter EasyFilter sourceArray const filteredResult filter search queryString And it will filter just like you expect It works for single values quoted values and even values nested inside keys AND MORE Check the documentation You don t need to settle for the easy you can have it be easy for you and powerful for the users How do I make one For now check the docs or the source code And next week we start at earnest Also EasyFilter ended with as just a warming Let s just say you can wait for the Sequel If you read the docs you will understand Cover Photo by Nathan Dumlao on Unsplash |
2021-10-11 13:13:44 |
海外TECH |
DEV Community |
7 javaScript Array methods you should know |
https://dev.to/mcube25/7-javascript-array-methods-you-should-know-7mf
|
javaScript Array methods you should knowArrays are one of the most common things a programmer uses or is likely to come across in a project In this regard the array method we are going to look into should come in handy We are going to use a single array for our examplesconst clubs name All stars fans name Bay fans name C stars fans name D pillars fans name Clos fans name Magic fans Let us take a look at this methods and what they do to an array filterThe filter method is used to filter out or remove all elements from an array that affirms the subject in the proposition logic and they are returned in a new array without altering the original arrayfor exampleconst filterClub clubs filter item gt return item fans lt All the clubs having fans of less than or equal to fans are going to be returned to a new array The filter method is a simple method to use It returns true or false for each item If the item is true it is included in the new array and if it is false it is not included The filter method does not change the array or object it is being filtered over This method is convenient because we do not have to worry about the old array being changed when using it subsequently mapThis method allows the taking of an array and converting it to a new array so that all items in the array are going to look slightly different Let us say we want to get the names of every clubs in the array sample We can use the map method for this Exampleconst clubNames clubs map item gt return item name We get a new array that prints out the names of the club in the original array without altering the original array This is super convenient when you want to get the items in an object or the keys of an object or convert an array from one form to another It has millions of uses findThis method allows a single object to be found in an array of objects The method takes a single item as a parameter and returns the first item that returns true for the statement const findClub clubs find item gt return item name All stars forEachThis method does not return anything unlike the methods we covered previously It works very similarly to a forLoop but it takes a function instead and takes a single parameterclubs forEach item gt console log item name For every single element inside the array it prints out the names The method makes working with an array where you have to loop through them much easier so that you don t have to write clunky long forLoop syntax someThis function does not return a brand new array Instead what it does is to return true or false We can check if some items in the array affirms or denies the subject in the proposition logic exampleconst highestFans clubs some item gt return item fans lt It checks if any item value returns true and returns the first item that matches the criteria everyThis method checks if every single item in the array affirms the subject proposition logic and returns true or falseexampleconst highestFans clubs every item gt return item fans lt reduceThis method performs an operation on the array and returns a combination of all the different operations To get the total of all the fans in our clubs array we use the reduce method in the following wayconst totalFans clubs reduce x item gt return item fans x It takes a property and an item we want the property to be reduced to It also takes a second parameter which is where we want to start the reduce from In our case it starts from |
2021-10-11 13:11:17 |
海外TECH |
DEV Community |
5 reasons why Frontend Developers love GraphQL |
https://dev.to/bornfightcompany/5-reasons-why-frontend-developers-love-graphql-16h8
|
reasons why Frontend Developers love GraphQLBesides creating those beautiful UIs our beloved designers give us handling complex application logic and component architecture we as frontend developers work with a lot of data manipulating in the process In this post I will talk about how can a frontend developer be more productive and have a better developer experience by simply using GraphQL Probably like most developers out there I used to work with REST APIs and mostly enjoyed it but recently I ve got an opportunity to work with GraphQL and instantly fell in love with it Here are the reasons why GraphQL has only one endpointWhen working with REST APIs you are surrounded with a lot of endpoints as their configuration is based on the names of the application s entities they represent On top of that each entity has different methods to manipulate its data POST GET DELETE PUT PATCH All that taken into consideration basic REST API will look something like the image below With greater complexity there will be more entities and more specific endpoints queries GraphQL to the rescue GraphQL uses only one endpoint GraphQL server operates on a single URL endpoint usually graphql and all GraphQL requests for a given service should be directed at this endpoint GraphQL is self documentingDeveloping big applications having deadlines difficult or indecisive clients is a developer s everyday experience and to be honest sometimes documenting the APIs isn t the highest priority task Because of that developer s productivity and developer experience DX may decrease as more time will be needed to understand what exactly a developer needs it gets harder to onboard other developers on the project and so on GraphQL to the rescue again GraphQL is self documenting GraphQL documentation will keep frontend developers up to date with all the changes that might happen No more underfetching overfetchingRESTful APIs assume for us which entity s information should be coupled together as a whole They don t look at the design of the application With that said frontend developers usually get more information than what they need to display on the screen This is called overfetching On the other hand some screens need a little extra information that we don t get with only one GET request This is called underfetching To overcome this problem we will make another request to fetch the data we need OK now we overcame that underfetching problem but remember that we only needed a little more information so we are now overfetching again I can smell an infinite loop here GraphQL to the rescue and again GraphQL lets us query for the data that we actually need Send a GraphQL query to your API and get exactly what you need nothing more and nothing less GraphQL is actually a query language Graph Query Language and it lets us write our own queries This way we can look at the given design and decide what information we need to fetch And it is simple too queries are written in an object like syntax where you specify the keys and get back the key value pairs like on image below GraphQL playgroundThat brings us to GraphQL playground GraphiQL GraphiQL is a powerful tool that lets you test your queries see the response check out the documentation schema and types for the needed fields Everything is typed and it even helps you with autocomplete as a nice finishing touch All you need to do is enable GraphiQL in your backend BE developer will do that and enter your only endpoint into URL Example of a free to use Rick and Morty API below Apollo ClientEven though Apollo Client is not the part of GraphQL out of the box it makes the DX much nicer and post title reasons why Frontend Developers love GraphQL wouldn t be as catchy Apollo Client most importantly provides us with three easy to use custom hooks for manipulating the data useQuery useLazyQuery and useMutation useQuery we use it when we need to fetch the data when the component mounts It returns an object containing data error if any and loading state All you need to pass is a query and options object if there are variables anything that needs to be done onCompleted etc const loading error data useQuery SOME QUERY options useLazyQuery we use it when we need to fetch the data on some event for example on search button click It returns an array containing a function to use on some event and an object with data error if any loading state const fetchOnSearch error loading data useLazyQuery SOME QUERY options useMutation we use it when we need to mutate the data It returns an array containing a function to which mutates the data and an object with data error if any loading state const fetchOnSearch error loading data useMutation MUTATION QUERY options ConclusionGraphQL was created by Facebook developers and it is used by many big companies which means it is not going anywhere So if you are a frontend developer and looking for something new to try out start with GraphQL you might fall in love with it For more in detail information please check the official GraphQL and Apollo Client documentations |
2021-10-11 13:09:39 |
海外TECH |
DEV Community |
Structured logging in Python |
https://dev.to/aaronbassett/structured-logging-in-python-52e4
|
Structured logging in PythonCreating usable logs in Python can be somewhat complexーjust ask my boss Jonan Scheffler thejonanshow The secret to logging in Python is to give up forever and become a farmer PM May Jonan probably isn t the only dev who wants to run off to the countryside to become an agriculturalist because of Python s logging module It s an incredibly powerful and flexible module but this flexibility comes at the cost of complexity If you find it confusing you re not alone In this article we ll look at how you can get started with logging in Python why you should think of logs as events not messages and how you can make your log data easier to integrate and explore without the need for nasty regexes Getting started with Python logsThe most basic Python logger consists of just a few lines of code import logging logger logging getLogger Basic Logger logger info This is a log message logger critical This a second log message We import the logging module get an instance of our logger and generate a log message If we were to run this logger we d see only the second message in our terminal because the default log level is WARNING It s also worth noting that logs are not persisted anywhere by default With a bit of configuration we can ensure that all logs are shown in the terminal and that more severe log messages are persisted in a file so we check them later import logging logger logging getLogger Basic Logger logger setLevel logging INFO stream handler logging StreamHandler stream handler setLevel logging INFO logger addHandler stream handler file handler logging FileHandler error log file handler setLevel logging ERROR logger addHandler file handler logger info This is a log message logger critical This a second log message In this example we ve created two handlers and attached both to our logger The StreamHandler will output all messages above INFO level to our terminal while the FileHandler will write all ERROR level and above messages to the error log file Logging useful informationThe example messages above are very simplistic and won t provide enough data for a real world application Let s imagine that we want to log data about air traffic These logs could include information about the airline where a plane is departing from where it s going to whether it s delayed and so on It may be tempting to include this information in our logs using string formatting if status departed logger info f flight airline flight flight id from flight origin airport flight origin city flight origin country flight origin iata to flight destination airport flight destination city flight destination country flight destination iata has departed at flight flight time if status landed logger info f flight airline flight flight id from flight origin airport flight origin city flight origin country flight origin iata to flight destination airport flight destination city flight destination country flight destination iata has landed at flight flight time if status delayed logger warning f flight airline flight flight id from flight origin airport flight origin city flight origin country flight origin iata to flight destination airport flight destination city flight destination country flight destination iata is delayed by approximately flight delay duration if status cancelled logger critical f flight airline flight flight id from flight origin airport flight origin city flight origin country flight origin iata to flight destination airport flight destination city flight destination country flight destination iata has been cancelled due to flight cancellation reason This will produce log messages with a high level of detail that are human readable gt WARNING main Air New Zealand flight from El Alto International airport La Paz Bolivia LPB to Wenzhou airport Wenzhou China WNZ is delayed by approximately hours minutes gt INFO main Tianjin Airlines flight from Pinto Martins International airport Fortaleza Brazil FOR to Puerto del Rosario airport Antigua Spain FUE has departed at At first glance these messages seem to contain everything we require But they have a critical flaw They assume that the primary consumer of the logs will be a person which often isn t the case I believe the widespread use of format strings in logging is based on two presumptions The first level consumer of a log message is a human The programmer knows what information is needed to debug an issue I believe these presumptions are no longer correct in server side software Paul QuernaThe days of webmasters tailing Apache logs to spot problems with their websites are mostly behind us It isn t feasible for a person to ingest the sheer volume of log data produced by a modern application If we were to tail this log file we wouldn t be able to tell how many Air Canada flights have been cancelled due to mechanical error how many flights from PDX are delayed by over an hour or how many flights have landed in AMS from America The information is all there but it isn t easily accessible That doesn t mean that logs are no longer useful They can still provide us with vital insights into our applications we just need to structure them so that machines can parse the data instead of humans Introducing structured loggingStructured logging means that you don t write hard to parse and hard to keep consistent prose in your logs but that you log events that happen in a context instead Instead of writing our log messages as human readable stringsーwhich are notoriously difficult for machines to parseーwe store the data in dictionaries that can then be serialized We could write a custom formatter for the standard library logging module but instead we re going to use the wonderful structlog package from structlog import get logger log get logger Structured Logger if status in departed landed log info status flight elif status delayed log warning status flight else log critical status flight Like the Python logging module you can start logging with structlog in just a few lines But now we no longer have long formatted strings instead we simply provide structlog with the relevant information as a dictionary gt warning delayed airline Tropic Air delay duration destination airport San Pedro airport iata SPR icao city San Pedro state Belize country Belize flight id origin airport Mingaladon airport iata RGN icao VYYY city Insein state Yangon country Myanmar price stops Our log messages are now structured in terms of key value pairs This isn t as human readable as the string format example but that s okay People will no longer be the primary consumers of our logs Logging pipelinesAnother powerful feature of structlog is the processor pipeline The processor pipeline is a list of callables or processors where the return value of each callable is passed on to the next The return value of the last callable gets passed to the logging method Structlog comes with several built in processors including a JSON renderer Here s an example of JSON data after it s rendered gt flight id airline Skymark Airlines origin airport Cheju International airport iata CJU icao RKPC city Jeju Si state Jaeju Do country South Korea destination airport Viracopos International airport iata VCP icao SBKP city Campinas state Sao Paulo country Brazil stops price cancellation reason mechanical fault event cancelled logger Structured Logger level critical timestamp T Z Using the New Relic Logs APINow that we have our logs as a JSON string we can send them to other services to be ingested For this example we re going to POST our logs to New Relic using the Log API Check the New Relic documentation for more information on the different ways you can forward logs to New Relic def send to newrelic logger log method event dict headers Api Key os environ API KEY payload message f logger log method event dict event attributes event dict httpx post json payload headers headers return event dict We can now log into New Relic and explore our log messages in the Logs UI If we click on a log we can see all of the additional structured information for that entry New Relic will automatically parse the JSON from our API request into attributes Putting it all together import os import httpx import structlog from structlog import get logger log get logger Structured Logger Custom processor Uses the New Relic Log API def send to newrelic logger log method event dict Your New Relic API Key headers Api Key os environ API KEY Our log message and all the event context is sent as a JSON string in the POST body json content payload message f log method event dict event attributes event dict httpx post json payload headers headers return event dict Configure Structlog s processor pipeline structlog configure processors send to newrelic structlog processors JSONRenderer Your application code that is generating the data to be logged flight get flight details status get flight status Generate our log events if status in departed landed log info status flight elif status delayed log warning status flight else log critical status flight Querying logsWe can now query our New Relic logs for useful data using NRQL New Relic Query Language and answer the questions we posed earlier How many Air Canada flights have been canceled due to mechanical error SELECT count FROM Log WHERE airline Air Canada AND event cancelled AND cancellation reason LIKE mechanical How many flights from PDX are delayed by over an hour SELECT count FROM Log WHERE origin iata PDX AND event delayed AND delay duration gt How many flights have landed in AMS from America SELECT count FROM Log WHERE destination iata AMS AND origin country United States AND event landed With structured logs we can access the information we need now but we also have the historical data available to answer questions in the future too including questions that we couldn t predict during our initial development Learn more about structured logging with PythonOnce you are happy with the basics of structured logging you can explore some of the more complex configurations and features Learn how you can use structlog as a drop in replacement for the Python logging module Try integrating structlog with common Python frameworks like Flask and Twisted Install the New Relic infrastructure agent and configure it to forward your custom log files Explore the Logs UI identify patterns create dashboards and even trigger alerts Watch the StreamYou can also watch our live streams about Structured Logging amongst many other things on my Twitch channel aaronbassettdev or for the inside scoop on what s new with New Relic catch our streams on new relicThere is a quick recap of my latest Structured Logging stream on Youtube |
2021-10-11 13:02:43 |
Apple |
AppleInsider - Frontpage News |
Eve blinds release window, Mysa controller, and more on HomeKit Insider |
https://appleinsider.com/articles/21/10/11/eve-blinds-release-window-mysa-controller-and-more-on-homekit-insider?utm_medium=rss
|
Eve blinds release window Mysa controller and more on HomeKit InsiderIn this episode of HomeKit Insider your hosts reveal the release date for Eve s HomeKit shades talk about the new Mysa controller discuss an expensive high end Secure Video camera and much more Eve along with Coulisse has announced the impending availability of their HomeKit enabled shades There s no exact date yet but they revealed they will be coming in early which is only a few months out at this point Eve MotionBlinds will be the first to support Thread for simplified installation and use Mysa has announced its second generation electric baseboard heater which will be making its way to North America Wozart said its Sense Pro will be the first occupancy sensor coming to HomeKit differing from existing motion sensors and that should be more accurate in detecting when people are in a room Read more |
2021-10-11 13:33:45 |
Apple |
AppleInsider - Frontpage News |
Apple promotes third Turkey Store in Istanbul with giant artwork |
https://appleinsider.com/articles/21/10/11/apple-promotes-third-turkey-store-in-istanbul-with-giant-artwork?utm_medium=rss
|
Apple promotes third Turkey Store in Istanbul with giant artworkApple is preparing to open a new store in Turkey with the Bagdat Street outlet in the middle of Istanbul promoted by a giant mural covering the front of the store via Bigumigu Apple Apple confirmed there would be a new store opening in Bagdat Street Istanbul in the future While an opening date for the outlet is currently unknown Apple has started to promote the store announcing its presence via its online store listings as well as through a mural on the store itself Read more |
2021-10-11 13:30:39 |
金融 |
RSS FILE - 日本証券業協会 |
公社債発行額・償還額等 |
https://www.jsda.or.jp/shiryoshitsu/toukei/hakkou/index.html
|
発行 |
2021-10-11 15:00:00 |
金融 |
金融庁ホームページ |
スチュワードシップ・コードの受入れを表明した機関投資家のリストを更新しました。 |
https://www.fsa.go.jp/singi/stewardship/list/20171225.html
|
機関投資家 |
2021-10-11 15:00:00 |
ニュース |
BBC News - Home |
Carbon dioxide supply deal agreed between government and firms |
https://www.bbc.co.uk/news/business-58867911?at_medium=RSS&at_campaign=KARANGA
|
prices |
2021-10-11 13:28:55 |
ニュース |
BBC News - Home |
Nobel economics prize rewards work on minimum wage |
https://www.bbc.co.uk/news/business-58870395?at_medium=RSS&at_campaign=KARANGA
|
world |
2021-10-11 13:47:06 |
ニュース |
BBC News - Home |
Clarke warns Scotland of 'improving' Faroes |
https://www.bbc.co.uk/sport/football/58793557?at_medium=RSS&at_campaign=KARANGA
|
Clarke warns Scotland of x improving x FaroesSteve Clarke warns his Scotland players you are never too far away from the next crisis as they travel to face a tough Faroe Islands side on Tuesday |
2021-10-11 13:29:49 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
黒谷(3168)、「増配」を発表し、配当利回り2.8%、 配当+株主優待の合計利回り3.5%に! 2022年8月期 の配当額は前期比「5円」増の「1株あたり20円」に! - 配当【増配・減配】最新ニュース! |
https://diamond.jp/articles/-/284518
|
|
2021-10-11 22:50:00 |
LifeHuck |
ライフハッカー[日本版] |
iPhoneの画面をテレビに映すならやっぱりコレ!買って損なし純正アダプタ【今日のライフハックツール】 |
https://www.lifehacker.jp/2021/10/243304lht-apple-lightning-digital-av-adapter.html
|
iphone |
2021-10-11 22:05:00 |
北海道 |
北海道新聞 |
新生銀、反対方針を確認 SBIの株式買い付けに |
https://www.hokkaido-np.co.jp/article/598938/
|
新生銀行 |
2021-10-11 22:12:00 |
コメント
コメントを投稿