投稿時間:2022-04-18 20:25:45 RSSフィード2022-04-18 20:00 分まとめ(31件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia News] ハワイ上空に謎の“渦巻き”出現、ライブカメラが捉えた UFO? 隕石? その正体とは https://www.itmedia.co.jp/news/articles/2204/18/news150.html itmedia 2022-04-18 19:41:00
IT ITmedia 総合記事一覧 [ITmedia News] 「うちのゼロトラスト化は何点?」測るセキュリティ診断 三菱グループのSIerが公開 https://www.itmedia.co.jp/news/articles/2204/18/news148.html itmedia 2022-04-18 19:38:00
IT ITmedia 総合記事一覧 [ITmedia News] Final Cut Proの「声を分離」がすごい Mac Studioユーザー以外でも使える3つの新機能 https://www.itmedia.co.jp/news/articles/2204/18/news147.html finalcutpro 2022-04-18 19:36:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] 吉野家、取締役の不適切発言で謝罪 若手女性向け自社戦略を「生娘をシャブ漬け戦略」 https://www.itmedia.co.jp/business/articles/2204/18/news142.html itmedia 2022-04-18 19:27:00
IT ITmedia 総合記事一覧 [ITmedia News] “箱形メタバース空間”、ブイキューブが開発 少人数向けテレワークブースを転用 https://www.itmedia.co.jp/news/articles/2204/18/news133.html itmedia 2022-04-18 19:20:00
python Pythonタグが付けられた新着投稿 - Qiita LTE-MモジュールSIM7080Gをpython&micropythonで使う https://qiita.com/m_take/items/c26da3080decf4848244 mstackcatmunit 2022-04-18 19:35:08
python Pythonタグが付けられた新着投稿 - Qiita Blender の UV データが入り組んでいる件 https://qiita.com/hibit/items/074250e94a3042165334 ameshescubeforvertinmesh 2022-04-18 19:22:49
Ruby Rubyタグが付けられた新着投稿 - Qiita カラムの合計値を出す方法 https://qiita.com/hukuryo/items/058ff44ffcdbc2c04864 allsum 2022-04-18 19:50:31
Ruby Rubyタグが付けられた新着投稿 - Qiita 【Rails】画像と動画、どちらかを表示する方法 https://qiita.com/setsunan76253/items/08ea537a68b6f9ec586d activestrage 2022-04-18 19:07:00
AWS AWSタグが付けられた新着投稿 - Qiita node.jsでpresigned_urlを使用して画像データをs3に保存、表示する方法 https://qiita.com/Musashi555/items/f35f2ace573e6803fe72 nodejs 2022-04-18 19:09:54
Docker dockerタグが付けられた新着投稿 - Qiita dockerで立ち上げたlaravelとmysqlのDB接続できなかった話 https://qiita.com/vanshi/items/41cb24598b036d72fb40 docker 2022-04-18 19:57:52
Ruby Railsタグが付けられた新着投稿 - Qiita Rails 6/7にjQueryとBootstrap 5を入れる(その1) https://qiita.com/kazutosato/items/c9dfa99d10411ced64b7 bootstra 2022-04-18 19:51:01
Ruby Railsタグが付けられた新着投稿 - Qiita カラムの合計値を出す方法 https://qiita.com/hukuryo/items/058ff44ffcdbc2c04864 allsum 2022-04-18 19:50:31
Ruby Railsタグが付けられた新着投稿 - Qiita JavaScript BundlingとCSS Bundlingのしくみ https://qiita.com/kazutosato/items/1ae1cf0ec380a75d4dc4 importmap 2022-04-18 19:49:43
技術ブログ Developers.IO SecretsManager 패스워드로테이션을 이용한 RDS 암호 교체 https://dev.classmethod.jp/articles/secretsmanager-change-password/ SecretsManager 패스워드로테이션을이용한RDS 암호교체소개안녕하세요 클래스메소드금상원입니다 이번블로그에서는SecretsManager 패스워드로테이션을이용하여RDS의마스터암호를교체해보도록하겠습니다 SecretsManager란 2022-04-18 10:22:04
技術ブログ Developers.IO Amazon SESの送信承認ポリシーを使って、送信先や送信元情報を制限する https://dev.classmethod.jp/articles/amazon-ses-send-auth-policy/ amazon 2022-04-18 10:12:58
海外TECH MakeUseOf What Can Someone Do With Your IP Address? https://www.makeuseof.com/what-can-someone-do-with-your-ip-address/ address 2022-04-18 10:45:14
海外TECH DEV Community Javascript 1O1 series : Variables vs Constants, and Let keyword. https://dev.to/osam1010/javascript-1o1-series-variables-vs-constants-and-let-keyword-m0p Javascript O series Variables vs Constants and Let keyword You ll learn about constant and const keyword and variables declared with let keyword and the differences between these types of variables constant we all know about variable and it is container that hold specific value during program s execution and this value can be changed whenever to whatever the programmer want constants are the same thing but the only difference is the const value can not be changed during the code execution the initiated value when we declare the constant will remain the same the whole time Constants are block scoped much like variables declared using the let keyword The value of a constant can t be changed through reassignment i e by using the assignment operator and it can t be redeclared i e through a variable declaration However if a constant is an object or array its properties or items can be updated or removed MDN The const keyword was introduced in ES Variables defined with const cannot be Redeclared Variables defined with const cannot be Reassigned wSchools Syntax const identifier anyValue const x const keyword identifier assignment operator any valuevariable declared by const keyword its value can not be changed object s properties and array s elements still can be updated or removed it can not be redeclared and last thing its scope will be Blocked Scope you ll learn about scopes in later tutorialLet keyword The let statement declares a block scoped local variable optionally initializing it to a value MDNvariables declared with let keyword and variables declared with var do the same thing they are variables and its rules pretty much the same the key difference is their scope limitation var is function scope and let is blocked scope if you want to read and understand what scope is wschools com Rules for let variables The let keyword was introduced in ES Variables defined with let cannot be Redeclared Variables defined with let must be Declared before use Variables defined with let have Block Scope wschoolsSyntax let identifier anyValue let x let keyword identifier assignment operator and a given value you can drop the initiated value when declaring let variables and can assign it later the default value will be undefined when no value assigned to the let variable expression Let vs Var vs Const let and var variables can be reassigned const can tvar variables can be redeclared let and const can tlet and const are blocked scope while var is a function scopelet and var can be declared without initial value const can tlet and var default values without initialization values will be undefinedMore The Difference of “var vs “let vs “const in Javascript by Megan Lo The Startup Medium Megan Lo・Oct ・ Medium References and useful links Var Let and Const What s the Difference A lot of shiny new features came out with ES ES And now since it s it s assumed that a lot of JavaScript developers have become familiar with and have started using these features While this assumption might be partially true it s still possible that some of these features freecodecamp org Difference between var let and const keywords in JavaScript GeeksforGeeks A Computer Science portal for geeks It contains well written well thought and well explained computer science and programming articles quizzes and practice competitive programming company interview Questions geeksforgeeks org The Difference of “var vs “let vs “const in Javascript by Megan Lo The Startup Medium Megan Lo・Oct ・ Medium Thanks for reading feel free to ask any question about javascript or about this series I appreciate any feedback or advises to improve My content find me on twitter github and my portfolio 2022-04-18 10:38:17
海外TECH DEV Community Astro JS Tutorial: Quick Start Astro Guide https://dev.to/askrodney/astro-js-tutorial-quick-start-astro-guide-1hep Astro JS Tutorial Quick Start Astro Guide ‍Astro JS TutorialIn this Astro JS tutorial we will see how to create an AstroJS site from spinning up a local development server right up to getting the app into the cloud and hosted Although we will build a fairly simple site we will see some important Astro features like hydration in action We will also take advantage of Astro s Islands architecture to add Svelte and React components This is just a quick introduction to Astro so be sure to explore the related posts and videos listed at the bottom of the page to boldly go further Astro JS Tutorial What we re BuildingWe build a simple app which shows YouTube videos in Svelte and React as well as an Astro Markdown component We will do that in three steps First of all is the setup which should take a couple of minutes Then we will add our own content to the minimal app we created in the previous step Finally we will see how to deploy the app to the cloud ‍Quick StartYou spin up a new Astro project from the command line First you need to create a new directory for the project then change into that directory and spin up Astro We will be using Svelte and React in our Astro JS tutorial app We can configure Astro to use these as part of the setup Let s do that now running these commands mkdir astro js tutorial amp amp cd pnpm init astropnpm installpnpm astro add react sveltepnpm run devIn the init astro step select Minimal Then in the astro add step enter yes so Astro configures React and Svelte for you After the final step you should have a dev server running The Terminal will give you the URL for it so you can open it in your browser Typically it will be running on http localhost However Astro will automatically find a free port if there is already something running on port Open up the browser using the given URL and you should just see the word Astro in black text We will add our own content to this minimal app next astro config mjsJust before moving on open up astro config mjs in the project root folder This is Astro s main config file You will see the setup tool has imported the necessary Svelte and React integration packages and added them to the config for you ContentIn this section we are going to build out our app and learn a little about the structure of an Astro project in the process We will also see how to add vanilla CSS styling in Svelte Astro routing works similar to NextJS Remix and SvelteKit Astro generates pages from files in src routes So the file you saw in the browser is generated from the content in src routes index astro Let s look at that file next src routes index astroReplace the content in the file with this import styles styles css import Markdown from astro components import ReactVideo from components Video jsx import SvelteVideo from components Video svelte lt html lang en GB gt lt head gt lt meta charset utf gt lt link rel icon href favicon png gt lt meta name viewport content width device width gt lt title gt RodneyLab Minimal Astro Example lt title gt lt head gt lt body gt lt main class container gt lt h gt Astro JS Tutorial Site lt h gt lt p gt This demo is not endorsed by Ben Awad just thought the video content was fitting lt p gt lt ReactVideo client load gt lt SvelteVideo client load gt lt section class mdx container gt lt Markdown gt Astro in Seconds lt div class video container gt lt iframe title Astro in Seconds width height src frameborder allow accelerometer autoplay clipboard write encrypted media gyroscope picture in picture allowfullscreen gt lt iframe gt lt div gt lt Markdown gt lt section gt lt main gt lt body gt lt html gt lt style gt container display flex flex direction column background hsl var colour dark hue var colour dark saturation var colour dark luminance color hsl var colour light text hue var colour light text saturation var colour light text luminance padding var spacing var spacing var spacing container a color hsl var colour secondary hue var colour secondary saturation var colour secondary luminance mdx container display flex flex direction column background hsl var colour alternative hue var colour alternative saturation var colour alternative luminance align items center width padding var spacing var spacing var spacing color hsl var colour light text hue var colour light text saturation var colour light text luminance lt style gt We have a fair bit in here Broadly the file has three sections The first is the frontmatter in lines In the first line we import our global stylesheet We will create that file in a moment We also add the components which we will use to add video here This might be new if you are coming from an HTML JavaScript CSS background Though the other two sections might look a little more familiar In the frontmatter we can write JavaScript which defines any variables we want to use in the following section In our case we are just importing items which we will use in the main markup The main markup lines looks a lot like HTML with a head and body section As well as regular HTML elements we use our ReactVideo and SvelteVideo components The final section contains styles The styles in this file will be automatically scoped just to the content of this file Our app will not work for the moment we need to add some of the new content we reference in the frontmatter first HydrationBy default Astro does not load JavaScript ーit will not hydrate the page By including the client load directive in lines amp we tell Astro to hydrate our components Because of this when we click the buttons in the app our JavaScript code will change the background colour tsconfig jsonWe will put our components in a new src components directory You might notice though that the import statement mentions components This is just an alias for src components which we will use for convenience For the alias to work we need to update the tsconfig json file in the project root folder Let s do that compilerOptions moduleResolution node baseUrl paths components src components styles src styles You will notice we also defined styles You can add any other aliases that might make sense for the project you are working on Note we only add these for convenience they are optional and as an example we could instead have written import styles styles css I prefer the alias as well as looking neater on larger projects where you might have to traverse multiple directories to get to your file the syntax is more manageable src styles styles cssSpeaking of styles lets add our global styles Astro works with SCSS Tailwind and other styling frameworks To keep this project simple and also because modern CSS is now quite powerful we stick to vanilla CSS Create a src styles folder and inside add a styles css file with the following content root colours honey yellow colour brand hue colour brand saturation colour brand luminance safety orange blaze orange colour secondary hue colour secondary saturation colour secondary luminance moss green colour alternative hue colour alternative saturation colour alternative luminance pine tree colour dark text hue colour dark text saturation colour dark text luminance old lace colour light text hue colour light text saturation colour light text luminance colour dark hue colour dark saturation colour dark luminance spacing spacing px px spacing spacing rem spacing rem spacing rem spacing rem spacing rem roboto regular latin font face font family Roboto font style normal font weight src local url fonts roboto v latin regular woff format woff url fonts roboto v latin regular woff format woff roboto latin font face font family Roboto font style normal font weight src local url fonts roboto v latin woff format woff url fonts roboto v latin woff format woff body margin var spacing background hsl var colour dark hue var colour dark saturation font family Roboto text align center h font size rem margin bottom var spacing h font size rem margin bottom var spacing p margin var spacing var spacing var spacing button cursor pointer margin var spacing border solid var spacing px hsl var colour light text hue var colour light text saturation var colour light text luminance border radius padding var spacing video container position relative aspect ratio width max width px margin var spacing var spacing video container iframe position absolute inset width height border screen reader text border clip rect px px px px clip path inset height px margin px width px overflow hidden position absolute important word wrap normal important react container display flex flex direction column background hsl var colour secondary hue var colour secondary saturation var colour secondary luminance align items center width padding var spacing var spacing color hsl var colour light text hue var colour light text saturation var colour light text luminance react container alt background hsl var colour alternative hue var colour alternative saturation var colour alternative luminance react button background hsl var colour alternative hue var colour alternative saturation var colour alternative luminance react button alt background hsl var colour secondary hue var colour secondary saturation var colour secondary luminance In lines you will notice we have some self hosted fonts We will download those to our project shortly At the bottom of the file you will see we have some style for our react component We take a different approach for the Svelte component taking advantage of in built scoped styles similar to what we have for the index astro page src components Video jsxNext we can paste in the React code Create a src components folder and then create a Video jsx file with the following content inside import useState from react export const ReactExample function ReactExample const altColours setAltColours useState false return lt section className react container altColours react container alt gt lt h gt Example React Component lt h gt lt div className video container gt lt iframe width height src title Should you Stop Using React frameBorder allow accelerometer autoplay clipboard write encrypted media gyroscope picture in picture allowFullScreen gt lt div gt lt button className react button altColours react button alt onClick gt setAltColours altColours gt lt span className screen reader text gt Toggle colours lt span gt lt button gt lt section gt export default ReactExample src components Video svelteThe final component we need to add is the Svelte one The app should work again once we have this in place Create the Video svelte file in the components folder with this content lt script gt altColours false lt script gt lt section class container altColours container alt gt lt h gt Svelte Component lt h gt lt div class video container gt lt iframe title Trying Svelte for the Third Time width height src frameborder allow accelerometer autoplay clipboard write encrypted media gyroscope picture in picture allowfullscreen gt lt div gt lt button class button altColours button alt on click gt altColours altColours gt lt span class screen reader text gt Toggle colours lt span gt lt button gt lt section gt lt style gt container display flex flex direction column background hsl var colour brand hue var colour brand saturation var colour brand luminance align items center width padding var spacing var spacing color hsl var colour dark text hue var colour dark text saturation var colour dark text luminance container alt background hsl var colour secondary hue var colour secondary saturation var colour secondary luminance color hsl var colour light text hue var colour light text saturation var colour light text luminance button background hsl var colour secondary hue var colour secondary saturation var colour secondary luminance button alt background hsl var colour brand hue var colour brand saturation var colour brand luminance lt style gt FontsWe mentioned that we are using self hosted fonts above For the hosting to work we need to include the fonts in our repo so our host can serve them Download the Roboto Font in Regular and Extract the zip and then create a new fonts folder in the project s public folder Drop the four unzipped files in that folder The public folder is for anything which we do not need Astro or Vite under the hood to process As well as fonts web manifest files for PWA and favicons fall into this category We won t optimise fonts here just to get finished a little quicker There is a nice video which focusses on self hosted fonts in Astro together with optimisation If you are interested in optimisation do take a look You can save on some fonts files especially where for example you only use the weight font in titles HostingThe app should be working just fine now with a nice Roboto sans serif font and all the colours Try pressing the buttons below the React and Svelte components to check they work You should notice the background colour change The next step is to build the site locally to check it is all working as expected Run these commands to build and preview the site stop the dev server with ctrl C first pnpm run buildpnpm run previewIf all is well commit the code to a git repo and upload it to your GitHub or GitLab account so we can host it as a static site You might notice your site gets built to the dist directory in your project There is no need to include this in your repo as your host will generate the site there for you It is worth adding a nvmrc file to the project root folder whichever host you are using This will tell the host know which version of node to use We will go for the long term support LTS version which is at the time of writing ConfigurationAlthough we have used pnpm in this tutorial to build the site for maximum compatibility in the cloud use npm run build as your build command We just mentioned that Astro outputs projects to the dist directory so on your host console set the build output directory or publish directory to dist Here are screenshots for Netlify and Cloudflare Pages which should help you out Other services will be similar Select the Astro preset if your host has one then just check the build command and output publish directory is dist Astro JS Tutorial Wrapping UpIn this post we have run through the pipeline for building a static Astro site We have seen how to spin up a new Astro project with Svelte and React integrations how you can add global CSS styles local scoped styles and style React components with plain CSS configuration for deploying your static Astro site to the cloud The Astro JS tutorial code is in the Rodney Lab GitHub repo You can also try it on Stackblitz I hope you found this article useful and am keen to hear how you will the starter on your own projects as well as possible improvements Astro JS Tutorial FeedbackHave you found the post useful Would you prefer to see posts on another topic instead Get in touch with ideas for new posts Also if you like my writing style get in touch if I can write some posts for your company site on a consultancy basis Read on to find ways to get in touch further below If you want to support posts similar to this one and can spare a few dollars euros or pounds please consider supporting me through Buy me a Coffee Finally feel free to share the post on your social media accounts for all your followers who will find it useful As well as leaving a comment below you can get in touch via askRodney on Twitter and also askRodney on Telegram Also see further ways to get in touch with Rodney Lab I post regularly on Astro as well as SvelteKit Also subscribe to the newsletter to keep up to date with our latest projects 2022-04-18 10:20:40
海外TECH DEV Community An Introduction To IR Modules Using An Arduino Uno https://dev.to/chrisdinhnz/an-introduction-to-ir-modules-using-an-arduino-uno-5gm6 An Introduction To IR Modules Using An Arduino UnoIntroducing my old Kenwood KR V Receiver rack system well minus the double tape deck player and the turntable which didn t quite survived the test of time This stereo system has been with me for almost years I think But over the years as I settled down it more or less took a backseat And as the family grew I eventually moved it into the garage where it sat for the last few years collecting dust However we are going to breath new life into this rack system again This blog post is going to be the first in a series of posts where we will try to connect it to the internet and maybe control it via some app Ok I know many of you will ask why Well because we can just kidding but seriously though we are doing it because I think we will learn so much for doing it As some of you might have guessed from this post s title already we are going to tinker a little bit with IR communication We are going to simulate the Kenwood receiver s remote so that whatever we can do with the remote we should be able to do with an Arduino InfraredBelow is a diagram of the electromagnetic spectrum The diagram shows the types of electromagnetic waves and it s real world application along the x axis with respect to the waves energy frequency from left to right If we look at the rainbow in the middle of the diagram that s the visible spectrum and is what our eyes can see And if we think back to our high school physics red sits at the bottom of the visible spectrum based on the wave s energy while blue sits at the top of the visible spectrum To the left of the visible spectrum we have the infrared spectrum which has lower energy than red hence the name infra red If you want to learn more about waves and how they relates to colours and light definitely check out this article Waves and Energy and also the concept of Black Body Radiation Infrared CommunicationInfrared IR communication is a form of wireless communication between two devices using infrared light It is widely used in consumer electronics where the equipment is controlled via a remote control such as TVsStereosHeatpumpsMedical devicesThese are often referred to as consumer infrared CIR Infrared communication is a very common and inexpensive communication technology The communication consists of a transmitting device which sends data by emitting bursts of infrared light via an infrared LED As infrared is outside the visible spectrum these bursts of light will not be detectable by the human eye On the receiving device a photodiode is used to detect these bursts of light and convert them into an electrical current Receiving Data Using An IR Receiver ModuleIn this section we are going to look at using an IR receiver module in combination with an Arduino Uno to capture the signals emitting from the Kenwood KR V remote The goal is to map all of the buttons on the remote to a list of key value pairs The IR receiver module we will be using comes with a breakout board as shown below Next we will hook up it up to an Arduino Uno How they are wired together is as follow Actual wiring Now let s head over to VS Code and initialise a new Arduino sketch to interact with the IR receiver module we will need to give the sketch a name so let s go with IrReceiverModuleDemo ino If you are not familiar with working with Arduino in VS Code have a look at my blog post Arduino Visual Studio Code to get you started To help us decode the IR signals we will be using an open source library called IRremote As of writing the latest version and the one we are using is version The sketch is implemented as follow IrReceiverModuleDemo Simple sketch to interact with the IR receiver module to intercept IR signals Copyright Chris Dinh include lt IRremote h gt define RECV PIN IR receiver signal pin void setup Serial begin IrReceiver begin RECV PIN ENABLE LED FEEDBACK void loop if IrReceiver decode Serial println IrReceiver decodedIRData decodedRawData HEX IrReceiver resume This is the remote control that comes with Kenwood KR V receiver as I have mentioned it s been sitting in the garage for the last few years collecting dust We are going to point this remote at the IR receiver module and go through and presses each button on the remote The idea is to decode the Hexadecimal value being transmitted for each button so that later on we can simulate these button presses by sending these Hexadecimal values using an IR transmitter module Below is a demo of what was being decoded as each numeric button was pressed and lastly Remote Control Unit RC R Code SummarySo I have been tinkering with the RC R Remote and the KR V Receiver and there were a couple of things I have learnt The RC R Remote is a universal remote controller what this mean is that depending what device we are trying to control at the time the button that is pressed may send a different command e g the demo above shows the codes being transmitted when Video was selected on the remote Some buttons depend on the context the remote control is in if the remote is not in the appropriate context pressing a button may not send any command at all The RC R Remote is using the NEC IR protocol to transmit the infrared commands If you want to dig a bit deeper into the NEC IR protocol check out NEC IR Remote Control Interface with Given we are only interested in controlling the KR V Receiver the following table describes how the RC R Remote interacts with the KR V Receiver Button IR Code Notes Power DB Toggles power on off FB Numbers can be used to select radio presets EB DB CB BB AB B B B B FDB Select radio presets or greater Volume Up BB Volume Down AB Mute CB Toggle mute Input CCB Iterate through input types Radio Phono CD Video Video Tape Stereo DB Stereo mode Surround Mode DFB Iterate through surround mode Dolby Pro Logic Dolby Stereo DSP Logic DSP Arena Audio CB Iterate through audio settings Bass Trebble Sub Woofer Balance Surround DB Iterate through surround settings Rear Delay Center Up AAB Used to control audio surround settings Down ABB Used to control audio surround settings Sending Data Using An IR Transmitter ModuleIn this section we are going to look at using an IR transmitter module in combination with an Arduino Uno to send IR coded signals to the KR V Receiver The goal is to simulate the RC R Remote using the table above The IR transmitter module we will be using comes with a breakout board as shown below Next we will hook up it up to an Arduino Uno How they are wired together is as follow Actual wiring Again let s head over to VS Code and initialise a new Arduino sketch to interact with the IR transmitter module we will need to give the sketch a name so let s go with IrTransmitterModuleDemo ino So instead of using the remote the plan is to have the Arduino Uno listens for IR commands over the serial connection and forward it to the stereo receiver using the IR transmitter module IrTransmitterModuleDemo v Simple sketch to interact with the IR transmitter module to send IR signals Copyright Chris Dinh INCLUDES include Arduino h include lt IRremote h gt include lt string h gt DEFINITIONS define COMMAND STRING MAX LENGTH U define COMMAND VALUE MASK xFF define COMMAND VALUE OFFSET U define ADDRESS VALUE MASK xFFFF define LINE FEED VALUE U define CARRIAGE RETURN VALUE U define IR SEND PIN U Remote Control R Button Code define BUTTON CODE POWER TOGGLE xDB Toggles power on off define BUTTON CODE xFB Numbers can be used to select radio presets define BUTTON CODE xEB define BUTTON CODE xDB define BUTTON CODE xCB define BUTTON CODE xBB define BUTTON CODE xAB define BUTTON CODE xB define BUTTON CODE xB define BUTTON CODE xB define BUTTON CODE xB define BUTTON CODE X xFDB Selects radio presets or greater define BUTTON CODE VOLUME UP xBB define BUTTON CODE VOLUME DOWN xAB define BUTTON CODE MUTE xCB Toggle mute define BUTTON CODE INPUT xCCB Iterate through input types Radio Phono CD Video Video Tape define BUTTON CODE STEREO xDB Stereo mode define BUTTON CODE SURROUND MODE xDFB Iterate through surround mode Dolby Pro Logic Dolby Stereo DSP Logic DSP Arena define BUTTON CODE AUDIO xCB Iterate through audio settings Bass Trebble Sub Woofer Balance define BUTTON CODE SURROUND xDB Iterate through surround settings Rear Delay Center define BUTTON CODE UP xAAB Used to control audio surround settings define BUTTON CODE DOWN xABB Used to control audio surround settings VARIABLES static char commandString COMMAND STRING MAX LENGTH static uint t commandStringLength PRIVATE FUNCTIONS static void ResetCommandString void memset commandString sizeof commandString COMMAND STRING MAX LENGTH commandStringLength static void sendNecCommand uint t buttonCode uint t repeats uint t address buttonCode amp ADDRESS VALUE MASK uint t command buttonCode amp COMMAND VALUE MASK gt gt COMMAND VALUE OFFSET IrSender sendNEC address command repeats Serial println Command sent static void processCommandString const char command if strcmp command power sendNecCommand BUTTON CODE POWER TOGGLE return if strcmp command vol Must be in volume context already to change volume Otherwise the first vol will only put receiver in volume context sendNecCommand BUTTON CODE VOLUME UP return if strcmp command vol Must be in volume context already to change volume Otherwise the first vol will only put receiver in volume context sendNecCommand BUTTON CODE VOLUME DOWN return if strcmp command mute sendNecCommand BUTTON CODE MUTE return PUBLIC FUNCTIONS void setup ResetCommandString IrSender begin IR SEND PIN true LED BUILTIN Serial begin opens serial port Serial println Begin IrTransmitterModuleDemo v void loop If there are no data to read do nothing if Serial available return char c Serial read if c LINE FEED VALUE c CARRIAGE RETURN VALUE When receiving data over the serial connection we will treat LF and CR as command termination processCommandString commandString ResetCommandString else if commandStringLength gt COMMAND STRING MAX LENGTH Command length exceeded start again ResetCommandString else Carry on retrieving current command commandString commandStringLength c commandStringLength Ok let s summarise the sketch above In the setup function we initialises a couple of things Clear the command bufferSet which GPIO pin the IR transmit module s signal line is connected toUse the built in LED to provide some visual feedback when transmittingSet serial baud rate to listen toIn the loop function we continuously listen to the serial port for incoming data Whatever comes through will be added to a bufferA line feed and carriage return is use to indicate full command has been received and command can be processedCommands assumed to be no more than characters long and it is exceeded the buffer will be cleared and we start overThe commands are mapped to IR code which will then be transmittedBelow is a demo of the above sketch in action In the foreground we have the Arduino Uno connected to a laptop via a USB serial cable while in the background we have the Kenwood stereo receiver As you can see when we issue some commands on the laptop these get sent to the Arduino Uno which are then forwarded to the receiver via the IR transmit module This blog post was originally posted on my blog site An IoT Odyssey 2022-04-18 10:15:34
海外TECH DEV Community Design Pattern React : The State Initialiser https://dev.to/wheelock/design-pattern-react-the-state-initialiser-5g1m Design Pattern React The State InitialiserCe design pattern permet de déporter la gestion du state dans un custom hook On peut l implémenter en étapes simple Step Définition du defaultStateSoit dans une const ou directement au niveau de l argument de la fonctionconst defaultState ouconst useCounter initValue gt Step Création du Hook Customconst useCounter initValue defaultState gt const count setCount useState initValue const add gt setCount count const reset useCallback gt setCount initValue initValue return count add reset Ici on utilise la mémoïsation useCallback et on retourne un tableau Step Utilisation du Hook CustomComme avec useState on va spread le tableau de notre useCounter et y a plus cas const count add reset useCounter 2022-04-18 10:11:18
海外TECH DEV Community 3d physics arcade game https://dev.to/andrasnyarai/3d-physics-arcade-game-10bc d physics arcade gamehey just finished up this game with react three fiber and cannon js have a blast and collect the stars Tell me what you think about the difficulty of the later levels 2022-04-18 10:03:03
Apple AppleInsider - Frontpage News Four new iPhone 14 models show what to expect in the fall https://appleinsider.com/articles/22/04/18/four-new-iphone-14-models-show-what-to-expect-in-the-fall?utm_medium=rss Four new iPhone models show what to expect in the fallAluminum models of the iPhone range offers a first look at what the next flagships could look like ーminus an iPhone mini As rumors about Apple s next smartphone releases raise to fever pitch physical models for the smartphones start to surface In one example from Monday models for the iPhone and iPhone Max show that there s little more to learn beyond existing renders Posted to Weibo by Quick Review Lab the four models show the burr marks left from machining with each also labeled to show their model and screen size The normal and Pro versions each consist of versions with a inch screen and a inch screen indicating the loss of the Mini model Read more 2022-04-18 10:56:37
Apple AppleInsider - Frontpage News Whistleblower Ashley Gjovik would return to Apple despite 'nightmare' life https://appleinsider.com/articles/22/04/18/whistleblower-ashley-gjovik-would-return-to-apple-despite-nightmare-life?utm_medium=rss Whistleblower Ashley Gjovik would return to Apple despite x nightmare x lifeFormer Apple employee and co founder of the anti harassment AppleToo movement says her life is such a goddamn nightmare now but she would return to Apple Ashley GjovikAshley Gjovik was a senior engineering program manager at Apple who was fired on grounds of alleged disclosure of confidential information Her firing came after she co founded the AppleToo movement which has led to hundreds of accounts of harassment within Apple Read more 2022-04-18 10:43:40
海外TECH Engadget Researchers break world record for quantum-encrypted communications https://www.engadget.com/researchers-set-quantum-secure-communication-distance-record-of-64-miles-104334468.html?src=rss Researchers break world record for quantum encrypted communicationsResearchers in Beijing have set a new quantum secure direct communication QSDC world record of km miles smashing the previous mark of km miles The Eurasian Times reported Transmission speeds were extremely slow at bits per second but still good enough for text message and phone call encryption over a distance of km miles wrote research lead Long Guilu in Nature The work could eventually lead to hack proof communication as any eavesdropping attempt on a quantum line can be instantly detected nbsp QSDC uses the principal of entanglement to secure networks Quantum physics dictates that entangled particles are linked so that if you change the property of one by measuring it the other will instantly change too ーeffectively making hacking impossible In theory the particles stay linked even if they re light years apart so such systems should work over great distances nbsp The same research team set the previous fiber record and devised a quot novel design of physical system with a new protocol quot to achieve the longer distance They simplified it by eliminating the quot complicated active compensation subsystem quot used in the previous model quot This enables an ultra low quantum bit error rate QBER and the long term stability against environmental noises quot nbsp As a result the system can withstand much more so called channel loss that makes it impossible to decode encrypted messages That in turn allowed them to extend the fiber from km to the record km distance quot The experiment shows that intercity quantum secure direct communication through the fiber is feasible with present day technology quot the team wrote in Nature nbsp Researchers in China previously made a secure quantum enabled video call by satellite but fiber poses a different set of challenges quot If we replace parts of the internet today where more eavesdropping attacks happen with quantum channels those parts will have the added ability to sense and prevent eavesdropping making communication even safer quot said Long nbsp 2022-04-18 10:43:34
ニュース BBC News - Home Dozens arrested at Sweden riots sparked by planned Quran burnings https://www.bbc.co.uk/news/world-europe-61134734?at_medium=RSS&at_campaign=KARANGA qurans 2022-04-18 10:42:52
ビジネス 不景気.com ハビックスの22年3月期は26億円の最終赤字へ、原料高騰で - 不景気.com https://www.fukeiki.com/2022/04/havix-2022-loss.html 最終赤字 2022-04-18 10:42:58
サブカルネタ ラーブロ 中華そば ふるいち@羽村市<味玉中華そば> http://ra-blog.net/modules/rssc/single_feed.php?fid=198252 ramenstock 2022-04-18 11:31:17
仮想通貨 BITPRESS(ビットプレス) 日本暗号資産ビジネス協会(JCBA)、4/28に会員向け「4月度勉強会」開催 https://bitpress.jp/count2/3_15_13173 資産 2022-04-18 19:33:39
IT 週刊アスキー 『ウマ娘 プリティーダービー』4月26日20時より「ぱかライブ TV Vol.16」が配信決定! https://weekly.ascii.jp/elem/000/004/089/4089552/ cygames 2022-04-18 19:30:00
IT 週刊アスキー 『シン・クロニクル』の「第3章 公開直前生放送」が4月23日21時に配信決定! https://weekly.ascii.jp/elem/000/004/089/4089550/ 最新情報 2022-04-18 19:10:00

コメント

このブログの人気の投稿

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

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

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)