投稿時間:2021-12-12 02:22:48 RSSフィード2021-12-12 02:00 分まとめ(24件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWS Japan Blog re:Invent 2021- パブリックセクター・パートナー セッションで発表された19の施策 https://aws.amazon.com/jp/blogs/news/top-announcements-aws-public-sector-partners-leadership-session-reinvent-2021/ パートナーのイノベーションを加速するためのプログラムやイニシアティブの拡充AWSMainframeModernizationの発表AWSMainframeModernizationMは、パートナー各社がメインフレームのワークロードをクラウドに移行することを支援するために提供されています。 2021-12-11 16:03:09
python Pythonタグが付けられた新着投稿 - Qiita 全ての曲を1分にする https://qiita.com/o________o/items/d54a7da10c07968c12b9 全ての曲を分にするタイトル通り。 2021-12-12 01:58:08
python Pythonタグが付けられた新着投稿 - Qiita Windows11にインストールしたVisual Studio CodeでPythonプログラムの開発/実行環境を構築する方法 https://qiita.com/tsujiyoshifumi/items/71a7e3eb1d7ee5809d08 今回は先程インストールした環境のPythonが設定されていることを確認してください。 2021-12-12 01:32:10
js JavaScriptタグが付けられた新着投稿 - Qiita wasm_bindgenでRust側のエラーをJavascript側でキャッチする https://qiita.com/deepgreenAN/items/7e3da65552f769845d84 2021-12-12 01:13:49
js JavaScriptタグが付けられた新着投稿 - Qiita WordPress テーマ使用でのランディングページ制作についてメリット・デメリットなど【LP】 https://qiita.com/eldred9930/items/38e2f033ebbb1b763745 メリット操作が簡単操作は言うまでもなく簡単であり、初心者の方でも視覚的に操作できるため、参入障壁を下げることが出来る点、効果的である。 2021-12-12 01:03:16
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) javascriptで記述したブックマークレットの機能の一部として、任意のキーを押したときにだけ処理を実行/停止させたい https://teratail.com/questions/373393?rss=all javascriptで記述したブックマークレットの機能の一部として、任意のキーを押したときにだけ処理を実行停止させたいお世話になります。 2021-12-12 01:24:03
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Chrome で「パスワードを更新しますか?」を表示させない方法 https://teratail.com/questions/373392?rss=all Chromeで「パスワードを更新しますか」を表示させない方法前提・実現したいことページ毎URL毎にパスワードが設定できるサイトを作成しています。 2021-12-12 01:01:04
Docker dockerタグが付けられた新着投稿 - Qiita Dockerのキャッチアップと練習 https://qiita.com/mikohiki/items/e9d6e86cfb1d7923a1c5 Dockerのキャッチアップと練習概要これは学習メモですdockercomposeなどは使わず、シンプルにnetwork、MySQLコンテナWordPressコンテナ作成を作成。 2021-12-12 01:04:47
海外TECH MakeUseOf 6 Differences Between Action Games and Adventure Games https://www.makeuseof.com/action-games-adventure-games-differences/ adventure 2021-12-11 16:30:12
海外TECH MakeUseOf Find Your Pet in Famous Artworks With Google’s Arts & Culture App https://www.makeuseof.com/find-your-pet-google-arts-culture-app/ Find Your Pet in Famous Artworks With Google s Arts amp Culture AppThis fun feature in Google Arts amp amp Culture helps you find lookalikes for your pets in some of history s greatest pieces of art 2021-12-11 16:15:22
海外TECH DEV Community Build your own date time parser in Elixir https://dev.to/onpointvn/build-your-own-date-time-parser-in-elixir-50be Build your own date time parser in ElixirElixir does not have built in date time parser function In this post I will show you how to create one using regex The idea is Define a format stringBuild regex pattern from format stringCompile datetime string with regex patternBuild datetime struct from extracted parts And we will have something like this Toolkit DateTimeHelper parse d m y gt ok U Z Define format string For simplicity we support some basic format using convention from Calendar strftimeformatdescriptionvalue exampleH hour I hour Mminute Ssecond dday mmonth y digits year Y digits yearztimezone offset Ztimezone nameUTC Asia Ho Chi MinhpPM or AMPpm or amdefmodule DateTimeParser do mapping H gt lt hour gt d I gt lt hour gt d M gt lt minute gt d S gt lt second gt d d gt lt day gt d m gt lt month gt d y gt lt year gt d Y gt lt year gt d z gt lt tz gt d Z gt lt tz name gt a zA Z p gt lt p gt PM AM P gt lt P gt pm am gt endHere we define a mapping between format character and regex pattern In the pattern we using named capture to assign name to matched content This will help us handle datetime parts easier Build regex pattern from format stringdef build regex format do keys Map keys mapping gt Enum join Regex compile keys gt Regex scan format gt Enum map fn s key s gt s Map get mapping key s end gt to string gt Regex compile endHere we scan for all string that start with and followed by any of our format character which defined above And then for each matching we do replace the format with appropriate regex string Finally we compile it to a regex struct Capture all required partsThis is the easiest part Regex do this for us def parse dt string format Y m dT H M SZ do format gt build regex gt Regex named captures dt string gt cast data gt to datetime endcast data and to datetime are defined right belows don t worry Build datetime struct from captured partsThis is the heavy part we do it in steps Cast and validate dataBuild datetime struct Cast and validate dataFirst we define some default values default value day month year hour minute second utc offset tz name UTC shift AM Then for each captured parts we cast and validate each one until completed or got an error def cast data nil do error invalid datetime def cast data captures do captures gt Enum reduce while fn part value acc gt case cast part value do ok data gt cont data acc error error gt halt error end end gt case do error error gt error data gt Enum into data default value endendFor each part we have different validation and logics For part of days we do upcase to make them same value so we handle them same way later defp cast P value do cast p String upcase value end defp cast p value do ok shift value endFor timezone offset we calculate utc offset in second For timezone name we keep it as is defp cast tz value do hour minute String split at value with ok hour lt cast offset h hour ok minute lt cast offset m minute do sign div hour abs hour ok utc offset sign abs hour minute else gt error value is invalid timezone offset end end defp cast tz name value do ok tz name value endFor other parts we convert to integer and check against valid range Let s define some validation ranges value rages hour gt hour gt minute gt second gt day gt month gt year gt defp cast part value do value String to integer value valid case Map get value rages part do min max gt value gt min and value lt max gt true end if valid do ok String to atom part value else error value is not a valid part end end Combine those all partsFor year with digits get first digits of current year to make digits year defp to datetime error error do error defp to datetime year value data do current year DateTime utc now gt Map get year year div current year value data gt Map put year year gt Map delete year gt to datetime endFor hours format we convert to hours defp to datetime hour hour data do AM is not valid if hour and data shift AM do error AM is invalid value else hour cond do hour and data shift PM gt hour data shift AM gt hour data shift PM gt hour end data gt Map put hour hour gt Map delete hour gt to datetime end endAfter handling special cases we build Date Time and combine them into DateTime struct and handle time zone name defp to datetime data do with ok date lt Date new data year data month data day ok time lt Time new data hour data minute data second ok datetime lt DateTime new date time do datetime DateTime add datetime data utc offset second if data tz name UTC do DateTime shift zone datetime data tz name else ok datetime end end end ConclusionThere are many way to build datetime parser but using regex in my opinion is simplest way and easiest to understand You can build it yourself and add some more format no need to add another dependency to your library You can see the fullsource code here on gist If you have any feedback or suggestion leave me a comment Thanks for reading 2021-12-11 16:48:02
海外TECH DEV Community Filterable Image Gallery using HTML, CSS & Javascript https://dev.to/shantanu_jana/filterable-image-gallery-using-html-css-javascript-49ij Filterable Image Gallery using HTML CSS amp JavascriptResponsive Filterable Image Gallery is used on various websites to sort images by category In this article I am going to show you how to create a Responsive Filterable Image Gallery with the help of HTML CSS and javascript It is a kind of image gallery where a large number of images are neatly arranged together The notable point is that all the images can be sorted by category here There is a navigation bar where all the categories are sorted When clicking on any one of those categories Then all the images in that category are seen and the rest of the images are hidden As a result the user can easily find the images of his choice You can watch the live demo to see how it works I have shown the complete step by step how to make it for beginners with pictures below Of course you can download the required source code using the download button at the bottom of the article I did the basic design of the webpage using the CSS code below body line height font family sans serif margin box sizing border box row display flex flex wrap wrap img max width vertical align middle Step Create the basic structureI have created the basic structure of this image gallery using my own HTML and CSS code Here I have used background color a and min height vh lt section class gallery gt lt div class container gt lt div gt lt section gt gallery width display block min height vh background color a padding px container max width px margin auto Step Create a navigation bar for categoriesNow I have created a navigation bar using the HTML and CSS code below As I said before there is a navigation bar where all the categories are sorted Here I have used topics and nine images You can increase or decrease the number of categories if you want The text in the category has been given the shape of a button The text in these buttons is font size px and the color is white Border px solid white is used to make texts the size of buttons lt div class row gt lt div class gallery filter gt lt span class filter item active data filter all gt all lt span gt lt span class filter item data filter watch gt Watch lt span gt lt span class filter item data filter headphone gt headphone lt span gt lt span class filter item data filter camera gt camera lt span gt lt span class filter item data filter phone gt Phone lt span gt lt div gt lt div gt gallery gallery filter padding px width text align center margin bottom px gallery gallery filter filter item color ffffff font size px border px solid white text transform uppercase display inline block border radius px margin right px cursor pointer padding px px px px line height transition all s ease I designed the active button with a little bit of CSS code below This means that the category you click on here will change a bit What will change here is determined by the CSS code below Basically the background color and the color of the border will change to blue gallery gallery filter filter item active color white border color bef background bef Step Add images to Image GalleryNow I have added all the images using the following HTML code Here I have added photos I have given the category of the image that I have used here in the first div You see I used two divs for each image lt div class row gt lt st gallery item start gt lt div class gallery item shoe gt lt div class gallery item inner gt lt img src shoe jpg alt shoe gt lt div gt lt div gt lt nd gallery item start gt lt div class gallery item headphone gt lt div class gallery item inner gt lt img src headphone jpg alt headphone gt lt div gt lt div gt lt rd gallery item start gt lt div class gallery item camera gt lt div class gallery item inner gt lt img src camera jpg alt camera gt lt div gt lt div gt lt th gallery item start gt lt div class gallery item headphone gt lt div class gallery item inner gt lt img src headphone jpg alt headphone gt lt div gt lt div gt lt th gallery item start gt lt div class gallery item camera gt lt div class gallery item inner gt lt img src camera jpg alt camera gt lt div gt lt div gt lt th gallery item end gt lt div class gallery item phone gt lt div class gallery item inner gt lt img src phone jpg alt phone gt lt div gt lt div gt lt th gallery item end gt lt div class gallery item camera gt lt div class gallery item inner gt lt img src camera jpg alt camera gt lt div gt lt div gt lt th gallery item end gt lt div class gallery item watch gt lt div class gallery item inner gt lt img src watch jpg alt watch gt lt div gt lt div gt lt th gallery item start gt lt div class gallery item watch gt lt div class gallery item inner gt lt img src watch jpg alt watch gt lt div gt lt div gt lt div gt Step Design the images added aboveNow I have beautifully arranged these images using CSS code Here I have used three images in each column I have used the code width calc to place these three images in each column Here if you want to put four images in each column then use instead of gallery gallery item width calc padding px gallery gallery item inner img width border px solid ddad I have used animations using keyframes When you click on a category each of those categories will appear side by side with the image For example if you click on a category that has four images There are two images in the first row and two images in the second row When you click on this category all the images in the rest of the category will be hidden and all four images will appear side by side The following code has been used to make this relocation a little more animated seconds has been used here which means it will take seconds to change that place gallery gallery item show animation fadeIn s ease keyframes fadeIn opacity opacity when you click on a category all other images will be hidden In that case display none has been used which means those images cannot be seen Now I just put the information and then I implemented it with the help of JavaScript code gallery gallery item hide display none Step Make the filterable image gallery responsiveNow I have made it responsive using the media function of CSS code Here we have added separate information for mobile and tab media max width px gallery gallery item width media max width px gallery gallery item width gallery gallery filter filter item margin bottom px Step Now active this design with JavaScriptAbove we just designed it now we will implement it with JavaScript code In other words if we click on the category in this navigation we will execute the images of that category so that they can be seen First set a constant of gallery filter and gallery item const filterContainer document querySelector gallery filter const galleryItems document querySelectorAll gallery item I have implemented these category buttons using the JavaScript codes below If you do not understand your JavaScript structure then you can watch the video tutorial filterContainer addEventListener click event gt if event target classList contains filter item deactivate existing active filter item filterContainer querySelector active classList remove active activate new filter item event target classList add active const filterValue event target getAttribute data filter galleryItems forEach item gt if item classList contains filterValue filterValue all item classList remove hide item classList add show else item classList remove show item classList add hide Hopefully from the above tutorial you have learned how to create this portfolio filter image gallery You can see many more designs like this I have already made You can visit my blog for more tutorials like this 2021-12-11 16:24:26
海外TECH DEV Community Peregrine Update - The python-like language that's as fast as C https://dev.to/saptakbhoumik/peregrine-update-the-python-like-language-thats-as-fast-as-c-43pb Peregrine Update The python like language that x s as fast as CHello everyone My name is Saptak and this article is going to explain the current state at where Peregrine is at What is Peregrine If you know Python you know how easy it is However it also comes with a big downgrade Python is slow and I m pretty sure every python developer knows this by now This is kind of annoying That s where Peregrine comes in Peregine s syntax is very similar to Python s and it gets translated to C thus making it as fast as C C if not faster Read my previous post to know more We have been rewriting it from ground up in C for the past month to make the compiler more efficient Update on Peregrine s current statusDecoratorsIf you are a python dev then you most probably know about decorators They are used to make your code more readable Similarly peregrine also has decorators This is what it looks like type declarationtype dec type def int gt inttype first type def int def decorator dec type func gt first type def value int c printf Answer is d n func c return value decoratordef dec test int x gt int return x xdef main dec test This will print Answer is as expectedThe above is same as follows type declarationtype dec type def int gt inttype first type def int def decorator dec type func gt first type def value int c printf Answer is d n func c return valuedef temp dec test int x gt int return x xfirst type dec test decorator temp dec test def main dec test And as you can tell that decorators make your code a lot cleanerPowerful Pattern MatchingPattern matching in peregrine is extremely powerful Let me show you an example def main int a int b int c match a b c case printf a is b is and c is case c can be anything printf a is but b is break we dont want default to execute case b can be anything printf a is but c is break we dont want default to execute case b and c can be anything printf a is case printf idk optional default will be executed at the end if no break printf nHello n Read my comments to understand how it works Note Default block is optionalJavascript BackendOther than the primary c backend peregrine also has a javascript backend It is main purpose is to create website frontend which allows you to learn just language to do both backend and frontend devolopment Building it from sourcePeregrine is a completely open source project licensed under the MPL license so you can build it from source because the code is freely available Requirements g latest version meson ninjaFollow the following steps to compile Clone the rewrite branch of git clone b rewrite Cd into the directorycd Peregrine Build itmeson builddircd builddirninjaThis will create the binary of the compiler named peregrine elf in the builddir folder Using itC backendTo compile it using the c backing just run peregrine elf compile path to file pe It will create the executable named a out Run it to see the result Check the can comp pe file in the root directory to know what you can do with the c backend at this point JS BackendTo use the javascript backend use the following command peregrine elf compile path to file js pe js It will create the javascript file named index js Run the generated javascript using node index js Check the can comp js pe file in the root directory to know what you can do with the js backend at this pointImportant point to be notedThe cli is still very rough The only reason is that we are constantly developing it and we need some special commands for that Like for example if you run peregrine elf then it will parse Peregrine test pe and print the tokens and parse tree in the form of s expression Got any more questions that you would like to be answered You can open a new discussion that discusses your questions You can also email saptakbhoumik gmail com or join our discord server Useful linksGithub ConclusionPeregrine is still in it s early phases and is still nowhere near to a functional language It is planned to release version sometime in March so make sure to show some support by starring the repo and make sure to press on the Watch button so you don t miss any updates We would greatly appreciate any contributions so if you find something that you can improve open a pull request You can also check out our open issues Please make sure you contribute to the rewrite branch as we are going to replace the main branch with the rewrite Thanks so much for reading lt 2021-12-11 16:23:14
海外TECH DEV Community One way to make Roulette using Javascript - Part 3 https://dev.to/ozboware/one-way-to-make-roulette-using-javascript-part-3-2odi One way to make Roulette using Javascript Part Place your bets In part we covered creating the wheel and getting it spinning In this part we re going to make it into a game In part we already set the click events for each betting point on the table now we re going to work on the setBet and spin functions First we need to set some variables outside of any functions at the top of the scriptlet wager let bet let numbersBet Here we have a set wager the bet is for an array of objects containing the numbers bet the bet type wager and payout odds The numbersBet variable is for the array of numbers that have been betted on each number will only be placed in once and this is checked against the winning number before the search for the bets begin Now we go back to the setBet function Currently it looks like thisfunction setBet n t o console log n console log t console log o we re going to change it to thisfunction setBet n t o var obj amt wager type t odds o numbers n bet push obj let numArray n split map Number for i i lt numArray length i if numbersBet includes numArray i numbersBet push numArray i Broken down Earlier we set the bet variable as an array ready for objects Here we re setting the object to be pushed into the array containing the wager bet type odds and numbers bet on var obj amt wager type t odds o numbers n bet push obj All of this was set for each betting point in part We then split the numbers into an arraylet numArray n split map Number iterated through them and if each iteration s number isn t already in the numbersBet array add it to the array for i i lt numArray length i if numbersBet includes numArray i numbersBet push numArray i Next we start the build on the spin function function spin Inside that function we ll begin by adding a log in the console for the numbers that have been bet on to see if the numbersBet push is working correctlyconsole log numbersBet Then we ll set a randomly generated number between amp var winningSpin Math floor Math random Next we check to see if the numbersBet array contains the winning numberif numbersBet includes winningSpin for i i lt bet length i var numArray bet i numbers split map Number if numArray includes winningSpin console log winningSpin console log odds bet i odds console log payout bet i odds bet i amt bet i amt Broken down First if the numbersBet array contains the random number chosen we iterate through the bet array containing the betting informationfor i i lt bet length i In that loop we then take the numbers property value and split it into an arrayvar numArray bet i numbers split map Number if the array contains the winning number we get a log in the console of the winning number the odds for the bet and the payout for the win if numArray includes winningSpin console log winningSpin console log odds bet i odds console log payout bet i odds bet i amt bet i amt This will loop over until all the objects bets have been checked in the bet array Next if the numbersBet array doesn t contain the random number we ll get a log in the console of the winning number and a no win messageelse console log winningSpin console log no win Finally we wrap up by resetting the numbersBet and bet arraysbet numbersBet The full function so far should look like thisfunction spin console log numbersBet var winningSpin Math floor Math random if numbersBet includes winningSpin for i i lt bet length i var numArray bet i numbers split map Number if numArray includes winningSpin console log winningSpin console log odds bet i odds console log payout bet i odds bet i amt bet i amt else console log winningSpin console log no win bet numbersBet All that s left is to add in the spin button Now we go back to the end of the buildBettingBoard function and we add the followinglet spinBtn document createElement div spinBtn setAttribute class spinBtn spinBtn innerText spin spinBtn onclick function spin container append spinBtn And give it some basic styling spinBtn position relative top px font size px cursor pointer Now after you ve refreshed the page you ll be able to place bets and get an instant win loss message in the console Now the basic game logic is functioning we can get to work designing the user interface I thought the best place to start was building the chips which will just be elements with the class chip with a choice of colours depending on the size of the bet So in the CSS we add in the following chip width px height px background color fff border px solid border radius position absolute gold border color gold red border color red green border color green blue border color blue Next we want the chip to be placed on the table where the bet has been made so within every call for setBet in the buildBettingBoard function we re going to add this So for instancesetBet num outside oerb will becomesetBet this num outside oerb and the actual functionfunction setBet n t o will becomefunction setBet e n t o then we re going to continue building on the setBet function At the bottom of the setBet function we add the followinglet chip document createElement div chip setAttribute class chip e append chip We put this at the bottom of the function because we re going to have a number on the chip representing the bet and the colour of the chip to change depending on the bet amount All that will come a little later For now the chips are being placed but they re not aligned correctly Now we have to do some aligning It should be relatively easy given the chips are being added to elements already in place All we have to do on our stylsheet is call upon the parent element and chip and change its positioning like such tt block chip margin left px margin top px number block chip margin left px margin top px wlrtl chip margin left px margin top px cbbb chip margin left px margin top px ttbbetblock chip margin left px margin top px wlttb top chip margin left px margin top px bbtoptwo chip margin left px margin top px number chip margin left px margin top px bo block chip margin left px margin top px oto block chip margin left px margin top px Now when you click on a betting spot the chip should be neatly aligned with the bet Next let s tidy up the board a bit and get rid of the betting spot borders In the stylesheet go to ttbbetblock and change it to ttbbetblock width px height px position relative display inline block margin left px top px cursor pointer z index Just remove the border from rtlbb rtlbb rtlbb and with the corner bets remove the border from cbbb change its margin left to px and change the following elements cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb margin left px cbbb cbbb margin left px cbbb cbbb margin left px cbbb cbbb cbbb cbbb margin left px Now the chips can be placed and the game is taking shape We want the chips to disappear after the spin has taken place For this I had to create a recursive function because for whatever reason either the Javascript remove property was only removing half of the elements at a time or the loop was iterating through only half of the elements or it was a combination of the twofunction removeChips var chips document getElementsByClassName chip if chips length gt for i i lt chips length i chips i remove removeChips All that s doing is checking for all the elements with the class name chip and if there are one or more it removes the elements then calls back on itself and repeats the action until all of the elements have been removed We then call on the function at the end of the spin function Now we want to slow things down a bit between the spin button being pushed and the results being shown So we stop our wheel and ball from spinning by removing the animation properties from the wheel and balltrack classes Now we can get to work on making it spin and land on the number randomly chosen I began by placing all the numbers on the wheel in anti clockwise order into a global array at the top of the script so it doesn t have to keep on being setlet wheelnumbersAC and added the variables for the wheel and ballTrack underneath the calls buildWheel and buildBettingBoard at the top of the script again so they didn t have to keep on being set with each spinlet wheel document getElementsByClassName wheel let ballTrack document getElementsByClassName ballTrack Then I created a new function called spinWheelfunction spinWheel winningSpin In this function I began by iterating over the wheelnumbersAC array and calculating the angle the ballTrack should stop at compared to the number that has been chosenfor i i lt wheelnumbersAC length i if wheelnumbersAC i winningSpin var degree i I added in an extra degrees so the ball wouldn t just slowly crawl at the end to the numbers closest to zero Then I added back in the animations we took away earlierwheel style cssText animation wheelRotate s linear infinite ballTrack style cssText animation ballRotate s linear infinite followed by timeout functions which will slow and eventually stop the ball First was the function set to run after secondssetTimeout function ballTrack style cssText animation ballRotate s linear infinite style document createElement style style type text css style innerText keyframes ballStop from transform rotate deg to transform rotate degree deg document head appendChild style This function is slowing the ball rotation down to half the speed as well as creating a new style to stop the ball in the next function The ballStop keyframes here starts at deg but ends at minus the degree angle calculated at the beginning of the main function Next after a further seconds or seconds in total I switched to the ballStop keyframessetTimeout function ballTrack style cssText animation ballStop s linear As the ballTrack was set to seconds the next function would follow seconds later or seconds in totalsetTimeout function ballTrack style cssText transform rotate degree deg This makes sure the ball stops at the angle we want it to instead of it zapping back to zero Finally after seconds we stop the wheel from rotating by removing its extra styling and we remove the ballStop keyframes stylesetTimeout function wheel style cssText style remove Then underneath the winningSpin variable in the spin function we call on the spinWheel function and wrap the rest of the function in a timeout set to seconds function spin console log numbersBet let winningSpin Math floor Math random spinWheel winningSpin setTimeout function if numbersBet includes winningSpin for i i lt bet length i var numArray bet i numbers split map Number if numArray includes winningSpin console log winningSpin console log odds bet i odds console log payout bet i odds bet i amt bet i amt else console log winningSpin console log no win bet numbersBet removeChips Now when you refresh the page after you ve pressed spin the ball should appear to land on the number generated randomly and shown to you in the console The full code from part up to this point is available on the Codepen demo here The full code for this partJavascriptlet wager let bet let numbersBet let wheelnumbersAC let wheel document getElementsByClassName wheel let ballTrack document getElementsByClassName ballTrack function setBet e n t o var obj amt wager type t odds o numbers n bet push obj let numArray n split map Number for i i lt numArray length i if numbersBet includes numArray i numbersBet push numArray i let chip document createElement div chip setAttribute class chip e append chip function spin console log numbersBet var winningSpin Math floor Math random spinWheel winningSpin setTimeout function if numbersBet includes winningSpin for i i lt bet length i var numArray bet i numbers split map Number if numArray includes winningSpin console log winningSpin console log odds bet i odds console log payout bet i odds bet i amt bet i amt else console log winningSpin console log no win bet numbersBet removeChips function spinWheel winningSpin for i i lt wheelnumbersAC length i if wheelnumbersAC i winningSpin var degree i wheel style cssText animation wheelRotate s linear infinite ballTrack style cssText animation ballRotate s linear infinite setTimeout function ballTrack style cssText animation ballRotate s linear infinite style document createElement style style type text css style innerText keyframes ballStop from transform rotate deg to transform rotate degree deg document head appendChild style setTimeout function ballTrack style cssText animation ballStop s linear setTimeout function ballTrack style cssText transform rotate degree deg setTimeout function wheel style cssText style remove function removeChips var chips document getElementsByClassName chip if chips length gt for i i lt chips length i chips i remove removeChips css spinBtn position relative top px font size px cursor pointer chip width px height px background color fff border px solid border radius position absolute gold border color gold red border color red green border color green blue border color blue tt block chip margin left px margin top px number block chip margin left px margin top px wlrtl chip margin left px margin top px cbbb chip margin left px margin top px ttbbetblock chip margin left px margin top px wlttb top chip margin left px margin top px bbtoptwo chip margin left px margin top px number chip margin left px margin top px bo block chip margin left px margin top px oto block chip margin left px margin top px ttbbetblock width px height px position relative display inline block margin left px top px cursor pointer z index cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb cbbb margin left px cbbb cbbb margin left px cbbb cbbb margin left px cbbb cbbb cbbb cbbb margin left px That s it for this part You can now place bets lay chips spin the wheel have the ball land on a designated number and see your win loss in the console In the next and final part we ll be wrapping up by styling the table tidying up the bets repositioning the spin button adding numbers on the chips preventing the chip elements from being set multiple times adding in the ability to change bet value remove bets from the table view win loss messages on the screen and remove all the console logs 2021-12-11 16:12:18
海外TECH Engadget Twitter asks judge to throw out Trump's lawsuit over ban https://www.engadget.com/twitter-asks-for-trump-lawsuit-dismissal-165330145.html?src=rss Twitter asks judge to throw out Trump x s lawsuit over banIt won t surprise you to hear Twitter is fighting former President Trump s lawsuit over his ban Bloombergreports Twitter has asked a judge to dismiss the suit as it allegedly misinterprets and threatens the company s First Amendment free speech rights The social network noted it was a private company that isn t obligated to host speech it doesn t like and that Trump repeatedly violated the rules he agreed to when he chose to use the service A forced ban reversal would challenge quot bedrock principles of constitutional law quot Twitter said Moreover Twitter argued its editorial choices related to basic public concerns including threats to a peaceful White House transition as well as statements that could foster quot further violence quot The company merely flagged Trump s tweets as misleading in the run up to the January th Capitol assault but banned him after he continued Lead attorney John Coale has contended Twitter is a quot state actor quot as Section of the Communications Decency Act supposedly equates to a subsidy that forces it to honor the First Amendment like the government does Biden s Justice Department has objected to this interpretation in a court filing however stating that Section is only meant to protect against liability not regulate the speech of officials like the ex President Trump isn t waiting for a return to Twitter Facebook and other social networks He recently launched Truth Social in a bid to enable himself and other conservatives who ve felt silenced by tech companies If Twitter succeeds in its dismissal request though Trump won t have much of a choice but to give up his once preferred platform 2021-12-11 16:53:30
海外TECH Engadget Hitting the Books: How the Silicon Valley mindset damages rural American communities https://www.engadget.com/hitting-the-books-reimagining-sustainable-cities-christina-rosan-stephen-wheeler-uc-press-163019173.html?src=rss Hitting the Books How the Silicon Valley mindset damages rural American communitiesAmerica has always been a nation segregated into haves and have nots with rampant inequity a seemingly natural aspect of our social order ーthe motif impacting towns and cities just as starkly as the people who live in them But it doesn t have to be this way argue authors UC Davis Professor Stephen Wheeler and Temple University Associate Professor Christina Rosan nbsp In their new book Reimagining Sustainable Cities Strategies for Designing Greener Healthier and More Equitable Communities Wheeler and Rosan examine the steps municipalities across the country have taken in recent years in response to climate change as well as their social and sustainability shortcomings offering community based solutions to ensure that urban development in the st century equitably raises the standard of living for all residents not just for the rich nbsp In the excerpt below the authors take a look at the myriad trials faced by residents of eastern Kentucky a once thriving pastoral region ravaged by the intractable march towards modernization and distillation of wealth to the select few nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp University of California Press Copyright by Stephen M Wheeler and Christina D Rosan Reprinted with permission from University of California Press While this book is about reimagining sustainable cities we pause here to connect sustainable cities with the larger national and international context in terms of spatial inequality We live in a world that is deeply interconnected If we want sustainable cities we need to work on reducing spatial disparities between cities and rural areas and between different regions worldwide Linkages between communities need to be recognized and resources shared and equalized Situations must be ended in which some regions exploit others by giving them the unwanted by products of production such as pollution waste and labor exploitation while simultaneously moving resources and profits from poor regions to rich ones In and around the towns of eastern Kentucky where Stephen Wheeler s ancestral family is from people of English and Scottish descent lived for many generations as self sufficient farming families That way of life changed in the second half of the twentieth century Better roads electricity and telecommunications connected Appalachia with the rest of the world Urban job opportunities lured away the young Farming families became part of the cash economy and acquired new desires for processed foods appliances motor vehicles and personal accessories But hill farms didn t generate enough cash to buy such things especially with rising federal subsidies for agribusiness in other parts of the country So the people of eastern Kentucky became designated as poor and came to see themselves that way Environmental problems grew as well Giant bulldozers scraped away hilltops and extracted coal adding this region to the long list of others worldwide suffering from the “resource curse Runoff from coal mining poisoned wells and polluted waterways Coal jobs left as quickly as they had come leaving many even poorer A new more globalized retail economy brought first Kmart and then Walmart putting family owned stores out of business Fast food outlets proliferated But the new service economy jobs didn t pay much To make better money some people began growing marijuana in hard to reach locations in the hills Drug use alcoholism and obesity spread Fundamentalist religion gained adherents and combined with Fox News starting in the s to promote reactionary political values A region that had been Democratic until the late twentieth century now helped elect US Senate majority leader Mitch McConnell R KY McConnell in turn played one of the largest roles in thwarting progressive legislation from Barack Obama s administration supporting Donald Trump s presidency and fueling the rise of populism in the US If this tale of decline were one isolated example it might not matter much But spatial inequality persists and spreads worldwide Some left behind communities are rural Others are urban Entire countries are stuck in poverty due to the legacy of military or economic colonization Spatial inequality is a core challenge to the development of more sustainable cities Every community needs to be able to thrive not just certain favored ones within a highly unequal global system Instead of engaging in a zero sum approach to development with winners and losers communities need to support one another so that all improve their quality of life and sustainability The so called winners of today s global economic competition have their own problems At the other end of the spectrum from Appalachia is Silicon Valley This forty mile corridor in the San Francisco Bay Area is an economic dynamo envied the world over Covered by orchards and agricultural fields in the s this beautiful area was known as “Valley of Heart s Desire Now no orchards remain and the region is a congested sprawl of poorly connected office parks subdivisions malls and commercial strips Incomes are high but the price of a home is nearly five times that in the US as a whole Many residents cannot afford housing near their jobs and so endure lengthy commutes or are housing insecure Social inequality traffic congestion air pollution and greenhouse gas emissions expanded greatly during the past fifty years reducing the quality of life in the region and contributing to global warming The Silicon Valley ethic of “move fast and break things has created dynamic companies unprecedented technology and great wealth for a few But the new gig economy pioneered there often operates at the expense of workers and the environment It often produces an enormous concentration of wealth that comes from the exploitation of others One study found that one fifth of San Francisco Uber and Lyft drivers earned virtually nothing when their full expenses including things such as health insurance were accounted for The tech industry has also been heavily criticized for sexual harassment during the MeToo movement and racism during the Black Lives Matter movement The combination of individualism predatory capitalism toxic masculinity and lack of concern for the common good that Silicon Valley represents works strongly against a sustainable and equitable future Similar problems of unequal development exist in other successful urban areas worldwide including Shanghai Beijing Tokyo Bangalore Singapore Toronto London Amsterdam Paris and Tel Aviv Though among the world s economic success stories on many dimensions of sustainability they are failures The growing core periphery disparities that produce left behind communities and “sacrifice zones on the one hand and wealthy but unsustainable and highly unequal job centers on the other are at the heart of recent global development patterns Let us imagine instead a world where we are not content with the concentration of wealth and opportunity in a small number of global cities where all communities have affordable housing and provide a decent quality of life where cities meet the needs of people locally and regionally but do not drain wealth from other parts of the world where no areas are left behind in the transition to a green economy their populations increasingly alienated despairing and vulnerable to unscrupulous politicians and warlords and where social dimensions of sustainability are well served everywhere Sources of the ProblemToday s spatial inequity problems have long historical roots illuminated by literature in fields such as economic geography sociology and environmental history One starting point is physical geography Some parts of the world have more fertile soils than others more abundant mineral resources more useful plant animal and fish species and or more benign topography and climate Other places have been strategically well located to serve as trading centers and market towns or have been easy to defend against attack Such communities have been able to accumulate modest amounts of wealth and power The “chessboard of geographical wealth is constantly shifting and with global warming is likely to shift in even greater ways in the future However in other cases spatial inequities have resulted from military religious cultural political and or economic systems that further centralize power and wealth Typically these have drained resources from the periphery to the core of empires Many parts of the world still suffer the legacy of colonization Local traditions and cultures were disrupted peoples were exploited racism was institutionalized ecosystems were harmed and corrupt colonizer friendly governments were installed following independence The damage has been so profound and long lasting in many places that reparations may be appropriate The need for climate justice may likewise call for reparations and repayments Twentieth century economic development philosophies exacerbated spatial inequality on the assumption that economic globalization was to everyone s long term benefit Various versions of “growth pole theory originating in the s sought to focus business development in particular geographical locales within countries on the assumption that this would leverage economic development in other parts Such wider scale progress was rare growth poles instead often channeled resources to local elites created isolated business enclaves and harmed the environment The municipal economic development practice of chasing branches of multinational corporations has likewise undermined prospects for a more stable long term economic base in cities worldwide This “race to the bottom competition leads suburbs to compete to host the newest shopping mall central cities to compete for corporate headquarters and states or countries to lower their environmental and labor standards to attract multinational corporations However the resulting businesses often don t provide the expected number of jobs pay the decent wages promised or stay more than a few years As Margaret Dewar has pointed out in her well titled article “Why State and Local Economic Development Programs Cause So Little Economic Development politicians have an incentive in the short term to appear to be generating jobs by attracting well known companies but little incentive to take into account long term economic or environmental sustainabilIty A recent example of the extreme lengths that municipalities will go to in order to attract development can be seen in the global competition for the second Amazon headquarters The Bretton Woods framework of post World War II development assistance only deepened global spatial disparities creating what economist Andres Gunder Frank termed “the development of underdevelopment Agencies such as the World Bank and the International Monetary Fund loaned funds to developing countries for megaprojects that created wealth for elites but left others poor and displaced while countries accumulated enormous debt to lenders in the Global North National governments focused on what sustainability oriented NGOs refer to as “extreme infrastructure These dams power plants industrial zones and large scale agricultural projects sought to jump start an export oriented form of economic development that was often environmentally harmful and funneled capital created by Third World labor and resources into First World bank accounts Yet another source of disparities has been the structural adjustment policies that neoliberal governments in wealthy nations insisted upon as a condition for international assistance during the past forty years These require developing countries to take actions such as cutting social programs privatizing public assets such as utilities and railroads reducing barriers to foreign investment and lowering taxes on the wealthy The effect has been to make life harder for the poor while enriching elites and international corporations It is increasingly clear that structural adjustment policies need to be discontinued and policies that promote spatial equity put in their place Finally the offshoring of manufacturing from wealthy nations to low cost and less regulated parts of the globe during the past half century has had complex effects on spatial disparities It has impoverished the US Rust Belt as well as the British Midlands leading to the growth of right wing populism in both places Meanwhile it has helped fuel the rise of megacities and megaregions in the developing world leading to massive internal migration and expanding economic disparities between those urban areas and the countryside Undoubtedly these global economic shifts have improved quality of life for many But they have harmed others disrupted societies contributed to the climate crisis and widened the gulf between rich and poor communities figure UC PressAlthough spatial disparities are still expanding in many places there is hope for the rebirth of left behind cities and regions Manchester UK the first industrial powerhouse in Europe lost much of its manufacturing in the middle of the twentieth century but has since rebuilt itself by focusing on culture education physical regeneration and its geographical role as a transportation center The US steel capital of Pittsburgh Pennsylvania after losing industrial jobs in the s reinvented itself as a center of renewable energy health care and education Even the long declining hulk of Detroit one of the most hollowed out American cities is showing signs of a turnaround Examples such as these indicate the possibility for left behind places to rebound But all of these cities had assets to start with including a strong identity and an active elite that led revitalization efforts Other communities and regions don t have such advantages And the pervasive problems associated with spatial inequality affect wealthy as well as declining places necessitating holistic and imaginative solutions at higher levels of governance 2021-12-11 16:30:19
海外科学 NYT > Science As Vaccines Trickle into Africa, Zambia’s Challenges Highlight Other Obstacles https://www.nytimes.com/2021/12/11/health/covid-vaccine-africa.html As Vaccines Trickle into Africa Zambia s Challenges Highlight Other ObstaclesVaccinating Africa is critical to protecting the continent and the world against dangerous variants but supply isn t the only problem countries face 2021-12-11 16:56:20
海外TECH WIRED US Wins Appeal to Extradite Julian Assange https://www.wired.com/story/julian-assange-extradition-log4j-vulnerability-ransomware-security-news security 2021-12-11 16:43:37
ニュース BBC News - Home More than 70 killed in Kentucky's worst ever tornadoes https://www.bbc.co.uk/news/world-us-canada-59620091?at_medium=RSS&at_campaign=KARANGA history 2021-12-11 16:53:33
ニュース BBC News - Home Simon McCoy becomes latest presenter to leave GB News https://www.bbc.co.uk/news/uk-59621747?at_medium=RSS&at_campaign=KARANGA andrew 2021-12-11 16:11:57
北海道 北海道新聞 正恩氏誕生日は来年も平日 北朝鮮カレンダー 父と祖父にまだ及ばず? https://www.hokkaido-np.co.jp/article/621888/ 金正恩 2021-12-12 01:12:53
北海道 北海道新聞 山本4位、渡部暁は7位 W杯複合男子個人第5戦 https://www.hokkaido-np.co.jp/article/621972/ 複合 2021-12-12 01:04:00
北海道 北海道新聞 野党を攻撃「Dappi」何者? ツイート「事実無根」2議員提訴 自民との関係は https://www.hokkaido-np.co.jp/article/621952/ dappi 2021-12-12 01:03:00
北海道 北海道新聞 柴犬盗もうとした疑い 「飼いたい」57歳男逮捕 https://www.hokkaido-np.co.jp/article/621971/ 愛知県警 2021-12-12 01:01:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

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

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