Skip to content

Latest commit

 

History

History
776 lines (524 loc) · 48.5 KB

2021-08-22.md

File metadata and controls

776 lines (524 loc) · 48.5 KB

< 2021-08-22 >

1,933,476 events, 1,128,041 push events, 1,612,101 commit messages, 96,322,451 characters

Sunday 2021-08-22 00:54:24 by copperwater

Tick drain life up to level 3

This is another Fourk change. Drain life is a bit of an odd duck among attack spells in that it's not used all that often for actually attacking things, compared to force bolt and magic missile. Other uses I know of include:

  • Ascension tricks like draining the Riders so that they can be tamed.
  • As a noncombat spell, lowering a +6 weapon to +5 or +4 armor to +3 so that it can be reenchanted.
  • Deliberately draining the player's own experience level as part of drain-for-gain. Strategies like that were nerfed in 3.6, so I doubt this happens as much, but it is still certainly a thing to e.g. drain yourself to XL1 so you can buy lots of cheap protection from a priest, then use blessed restore ability to get the levels back.

As an attack spell, it's arguably weaker than magic missile, arguably slightly stronger. But this level boost will make it slightly more difficult to use as a utility spell.


Sunday 2021-08-22 03:35:22 by frank-vaugn

Add files via upload

War of The Worlds.

For so it had come about, as indeed I and many men might have foreseen had not terror and disaster blinded our minds. These germs of disease have taken toll of humanity since the beginning of things — taken toll of our pre-human ancestors since life began here. But by virtue of this natural selection of our kind we have developed resisting power; to no germs do we succumb without a struggle, and to many — those that cause putrefaction in dead matter, for instance — our living frames are altogether immune. But there are no bacteria in Mars, and directly these invaders arrived, directly they drank and fed, our microscopic allies began to work their overthrow. Already when I watched them they were irrevocably doomed, dying and rotting even as they went to and fro. It was inevitable. By the toll of a billion deaths man has bought his birthright of the earth, and it is his against all comers; it would still be his were the Martians ten times as mighty as they are. For neither do men live nor die in vain.

— H. G. Wells, book The War of the Worlds


Sunday 2021-08-22 04:53:30 by jiffydominguez

ReadMe

• Briefly explain the work that you did on this project: What code were you given? What code did you create yourself? The code we were give was about bases for the pirate game. We had to add the part where the pirate learned how to search the map itself. We used multiple AI approaches to show how they would affect the pirate in the game. Overtime, you can see the pirate learning from its mistakes and getting better and faster. It does this thanks to rewards and punishments based off each move it makes.

• Connect your learning from throughout this course to the larger field of computer science: This type of AI is already being used in videogames. Several years ago, a team of computer scientist used AI to play StarCraft. They took the AI to fight the world record holder (team) and the team ended up losing to the AI. I can see this in 5 years where teams of computer scientist set up AI to fight other AI teams in videogames to see which team made the better program.

o What do computer scientists do and why does it matter? Computer scientists advance the possibility of what is and isn’t possible. About twenty years about 21 years old. We have seen google take over the world in web browsing, search, phones, and even email. Just in the last twenty years this has changed everyone’s life. If google never existed, amazon might not be what it is now. Facebook might not even exist.

o How do I approach a problem as a computer scientist? Depending on the problem there are multiple ways to approach it. For example, you can make a list of all the steps you need, or a graph tree that shows which parts connect to each other. It all depends on the problem at hand first.

o What are my ethical responsibilities to the end user and the organization? As an end user, we aren’t given as much responsibility as the person who made the code. However, we can make sure we do what we think is right with the technology at hand. Just because Facebook allows you to stalk an ex doesn’t mean you should be able to. Also, any major bugs should be reported so the company can fix them before they are exploited.


Sunday 2021-08-22 05:43:53 by Can

Create index.html

<title>Hank Quinlan, Horrible Cop</title>

Hi there, I'm Can Wang!

I'm best known as the horrible cop from A Touch of Evil Don't trust me. Read more about my life...


Sunday 2021-08-22 07:39:25 by Debapriya Paul

Basic level

As we know, Ishaan has a love for chocolates. He has bought a huge chocolate bar that contains N chocolate squares. Each of the squares has a tastiness level which is denoted by an array A[]. Ishaan can eat the first or the last square of the chocolate at once. Ishaan has a sister who loves chocolates too and she demands the last chocolate square. Now, Ishaan being greedy eats the more tasty square first. Determine the tastiness level of the square which his sister gets.

Input : arr[ ] = {5, 3, 1, 6, 9} Output : 1 Explanation: Initially: 5 3 1 6 9 In first step: 5 3 1 6 In Second step: 5 3 1 In Third step: 3 1 In Fourth step: 1 Return 1


Sunday 2021-08-22 09:20:49 by Aasma Siddiqui

Update README.md

The BCG Open-Access Data Science & Advanced Analytics Virtual Experience Program

Welcome to the Open-Access Data Science & Advanced Analytics Virtual Experience Program

We recognize that these tasks are challenging and that there are undoubtedly phrases and terminology you may not have heard before – don’t worry! We have tried to make this experience as true to life as possible and therefore our ask is that you attempt to seek out independent sources of information and do your own research, as required, to help guide you through the tasks.

Welcome to the BCG GAMMA virtual experience! BCG GAMMA is transforming the businesses of today through data science and advanced analytics initiatives and our goal is to help companies generate competitive advantage through these initiatives. This module is designed to give you a feel of what it is like to work at BCG GAMMA as we help our clients using data science.

Our client for this project is Powerco, a major utilities company. Powerco has had declining profits due to significant customer churn. We have been engaged to drive churn reduction within their Small & Medium Enterprise (SME) customers.

As a BCG GAMMA Data Scientist, you can expect to work in many different industries, and on many different types of business challenges. The skills you will use and develop today are part of the consultant and data scientist toolkits, and will be applicable to many different types of cases.

We hope you will enjoy your virtual experience and get a glimpse into the exciting life of a Data Scientist at BCG GAMMA!

Tasks 1: Business Understanding & Problem Framing How to quickly understand the business context

Background information on task 1

PowerCo is a major gas and electricity utility that supplies to corporate, SME (Small & Medium Enterprise), and residential customers. The power-liberalization of the energy market in Europe has led to significant customer churn, especially in the SME segment. They have partnered with BCG to help diagnose the source of churning SME customers.

One of the hypotheses under consideration is that churn is driven by the customers’ price sensitivities and that it is possible to predict customers' likely to churn using a predictive model. The client also wants to try a discounting strategy, with the head of the SME division suggesting that offering customers at high propensity to churn a 20% discount might be effective.

The Lead Data Scientist (LDS) held an initial team meeting to discuss various hypotheses, including churn due to price sensitivity. After discussion with your team, you have been asked to go deeper on the hypothesis that the churn is driven by the customers’ price sensitivities.

Your LDS wants an email with your thoughts on how the team should go about testing this hypothesis.

Objectives:

Your first task today is to understand what is going on at the client and think about how you would approach a problem like this to test this specific hypothesis.

Formulate the hypothesis as a data science problem and lay out the major steps needed to test this hypothesis. Communicate your thoughts and findings in an email to your LDS, focusing on the potential data that you would need from the client and the analytical models you would use to test such a hypothesis.

We would suggest spending no more than one hour on this task.

Please note, there are multiple ways to approach the task and that the sample answer is just one way to do it.

2: Exploratory Data Analysis & Data Cleaning Understanding business through data

Background information on task 2

The BCG project team thinks that building a churn model to understand whether price sensitivity is the largest driver of churn has potential. The client has sent over some data and the LDS wants you to perform some exploratory data analysis and data cleaning.

The data that was sent over includes:

Historical customer data: Customer data such as usage, sign up date, forecasted usage etc Historical pricing data: variable and fixed pricing data etc Churn indicator: whether each customer has churned or not These datasets are otherwise identical and have historical price data and customer data (including churn status for the customers in the training data).

We recommend spending no more than 1.5 hours on this task.

Please note, there are multiple ways to approach the task and that the sample answer is just one way to do it.

Objectives:

Sub-Task 1: Clean the data – you might have to address missing values, duplicates, data type conversions, transformations, and multicolinearity, as well as outliers.

Sub-Task 2: Perform some exploratory data analysis. Look into the data types, data statistics, and identify any missing data or null values, and how often they appear in the data. Visualize specific parameters as well as variable distributions.

3: Feature Engineering Uncovering signals with data

The team now has a good understanding of the data and feels confident to use the data to further understand the business problem. The team now needs to brainstorm and build out features to uncover signals in the data that could inform the churn model.

Feature engineering is one of the keys to unlocking predictive insight through mathematical modeling. Based on the data that is available and was cleaned, identify what you think could be drivers of churn for our client and build those features to later use in your model.

Objectives:

We’ve included some pre-written functions to help you focus on your analysis as opposed to programming syntax.

Sub-task 1: Think through what key drivers of churn could be for our client

Sub-task 2: Build the features in order to get ready to model

4: Modeling & Evaluation Modeling the problem and evaluating the model

Background information on task 4

Recall that one of the hypotheses under consideration is that churn is driven by the customers’ price sensitivities and that it would be possible to predict customers likely to churn using a predictive model.

The client also wants to try a discounting strategy, with the head of the SME division suggesting that offering customers at high propensity to churn a 20% discount might be effective.

Build your models and test them while keeping in mind you would need data to prove/disprove the hypotheses, as well as to test the effect of a 20% discount on customers at a high propensity to churn.

Objectives:

Sub-Task 1: Build churn model(s) to try to predict the churn probability of any customer, taking into account all the explanatory variables you have constructed in the feature engineering process.

Sub-Task 2: Evaluate your model, using a holdout set, and with metrics of your choosing. Be sure to pick a metric that would make sense for this business case.

Sub-Task 3: Interpret the results and use them to formulate your answers to the client’s hypotheses and questions. You will be asked to form these answers into coherent thoughts and recommendations in the next module.

Please note, there are multiple ways to approach the task and that the sample answer is just one way to do it.


Sunday 2021-08-22 09:23:09 by YangWu1227

Give up on floating toc, give up on life, wasted my time, hate my life, never coming back to this


Sunday 2021-08-22 10:08:24 by jgerongco14

Merge pull request #1 from moshOntong-IT/main

Fuck you del


Sunday 2021-08-22 11:03:21 by Ben-Beck

Create 001150 Rachel Pollack.md

Pollack was the subject of a profile article by Cara Hoffman, in Fifth Estate #380. She notes that:

"Her work is often concerned with what is below the surface of everyday matters, what happens when the life of the mind and the concerns of the material world converge.

"This makes Pollack’s work not only transcendent, but often very funny. As in Unquenchable Fire, where God appears in the form of a chocolate chip cookie salesman on Seventh Avenue, and is then perceived to be out of touch with the experiences of mortals, and therefore insane."


Sunday 2021-08-22 16:33:11 by a-soulspark

Thanks to everyone who gave feedback!

• Updated the JEI interface, as well as Cup Drink recipes: now supports up to 6 ingredients + any catalyst item! See the recipes in GitHub if you wish to create your own. • Revamped all leaf textures ^^ • Terra Incognita's Fireweed Tea may be brewed with Tea Kettle mechanics, if Simply Tea is also installed - closes #15 • Tweaked the behavior of the Zen effect: now takes you to the beginning of night rather than morning • You can skip to morning like before by simply sleeping again! • Added configuration files for enabling optional tweaks to the mod (all are disabled by default): • quickLattes allows for the brewing of lattes directly from a cup, skipping the need for boiling water; • limitedWater makes water in the world be picked up when filling a kettle with water; • skipToDawnZen reverts the change to the Zen effect, to match 0.3.2 behavior.

• Updated Tea Kettle integration with Simply Tea! after the 2.4.0 update - closes #16 • Simply Teas will now be sweetened just like when crafting them with honey, so rather than providing Tea Kettle's extended duration from sweetening, they now give the bonus from the original mod: stronger effect levels! • Hot Chocolate can be spiced up with cinnamon! • The new Apple Iced Tea can now be brewed with Tea Kettle thanks to the cup drink recipe overhaul! • Added compatibility with Biomes O' Plenty Lavender for crafting Lavender Tea (if Abundance is installed). Closes #14 • Fixed kettles accepting any fluids - closes #17 • Sorry Creosote Oil tea, but you're not quite the healthy drink! • Fixed crashes due to Supplementaries 0.14.4 codebase changes - closes #18 • Fixed crash when trying to make steeping recipes... maybe? - hopefully closes #11 • Fixed kettles being placeable on unlit campfires and thus magically lighting them back up.


Sunday 2021-08-22 17:07:11 by Marko Grdinić

"6:10am. Let me grind poker just for a bit. If history is any guide, I'll lose a couple of times and get tired of it soon enough.

7:30am.

///

Use an actual resume template unless you want your application tossed. Check out r/engineeringResumes and the FAQ in this post.

///

https://www.reddit.com/r/EngineeringResumes/

Let me play a bit more and then I will look into this. No emails today yet.

My biggest problem is not so much getting a job, but filling up my time usefully. Though it is not as cool as beating Holdem, maybe I could take the project I did and beat Python.

8:15am. Ok, let me watch an ep or two of anime to wash away the taste of poker.

I think it might be worth making a series of articles on how to implement and speed up poker in Python. I can't beat Holdem right now, but I could beat Python.

8:40am. Let me watch a few eps of that World Witches comedy short. I only have a couple of eps to go.

Then I will focus. Forget poker, do the resume using the template, this time for good. Then start writing those articles. The worse I make Python look compared to Spiral, the better it is for me. Focus on that. Focus on getting attention. On the side also look into Unity. Spiral could be very good for gamedev. I need some kind of proof of that.

I should also look at the possibilities of attaching Spiral to the embedded niche.

Once I do the resume using the template, I should also try applying to whatever AI companies are advertizing for remote positions. I am not suited for the senior engineering positions unless they are PL related, but it would not be hard to pick up whatever technologies are needed on the job. And since the new AI hardware wave is starting, I do not need to limit myself to AI chip companies, they will have clients and those will need somebody to program their devices.

I applied to Toptal, but the trouble with things like freelancing is that my clients will not give me time to learn on the job. That is the biggest trouble. They'll all want web related work, and I am weak in that area. And it is an area I have no inspiration for or will to learn independently.

8:45am. Well, I should take it easy.

Giving up on making the Holdem agent freed up so much of my time that I do not know what to do with it. Getting that job will take time. I was starry eyed for a bit there as I imagined getting 12k a month from DDG, but I should accept anything in line with my interests and look for better offers on the side.

World Witches, go!

9:20am. Two eps is enough for now. Let me take that last batch of advice.

https://docs.google.com/document/d/1Q0ucm4M18PH4YRxGbAzyDNDK5KHrLLVl5JIwC2HLBbs/edit

Here is that template.

https://www.reddit.com/r/EngineeringResumes/comments/m2cc65/new_and_improved_wiki/

Don’t rate your skills based on proficiency, this can only hurt you. You can discuss proficiency in the interview

Huh.

Your high school from education

It is telling me to remove this. Ok. Pretty much everyone has this, so I do not need to note it.

ALL coursework, unless they are very specialized like grad electives.

9:45am. Reddit has gone to shit. Edits do not work properly.

Is LinkedIn messing with me? I want to add skills, but the drop down window is so small that I can't see what I am selecting.

9:55am.

Your resume is only visible to you. Changes will not update on your profile.

Why is LinkedIn so confusing? How do I make it visible to others?

Goddamit. I've been putting the thing in the wrong place.

10:05am. I've finally put the resume in the right place on LinkedIn. I have a handle on the site. It is supposed to be added under media. Instead of been trying to push it into the resume builder. The site could use better design.

Let me get back on track.

10:10am. https://www.reddit.com/r/EngineeringResumes/comments/m2cc65/new_and_improved_wiki/

Everyone here talks about networking, but Croatian salaries are so low that it would be a waste of time for me to do this here. It is not like SV. Back when I had friends, one of them told me he could get me in with a job, but I'd probably get paid 2k at most for that. A waste of time. Those people do not understand their own position.

10:15am. Right now I am desperate, not so much to get a job because even if I had 3k right this very moment I'd just get put on a waiting list for the Grayskull card. What I am desperate is not to waste time.

The absolute worst would be for me to lounge around doing nothing. I need to find ways to sharpen my skills while I wait.

10:20am. I won't take the advice in the sticky post. I'll stick with that I have.

https://docs.google.com/document/d/e/2PACX-1vSe88lhaoSZaF-YHKeiA_RlpkPwzLetrIAoY2v6ckbaLn59QQ95nvMC-Cc13hxDsLzVJ-KGE824S1bF/pub

I'll stick with this version which is almost what I had yesterday. Merely pointing me to a FAQ does not do me too much good. Right now I've optimized the resume to the limit. If it is not good so be it.

10:30am. What did I say my plans for the day were. I keep losing track.

Then I will focus. Forget poker, do the resume using the template, this time for good. Then start writing those articles. The worse I make Python look compared to Spiral, the better it is for me. Focus on that. Focus on getting attention. On the side also look into Unity. Spiral could be very good for gamedev. I need some kind of proof of that.

Writing articles. It should not be a part of language documentation, but I should take the poker project and milk it for all it is worth.

I cannot succeed at my primary goal for the time being, but it makes the most sense to highlighting my work rather than droping it and going off into gamedev or whatever.

10:35am. Ok...

Let me read the predictive coding paper for a bit since I haven't done so yet.

Though it is unlikely maybe Zenna will get permission to hire me remotely, or Forward Networks might be interested in me. If so, that will solve my job seeking troubles. If that fails to manifest, I'll apply more widely. Previously I was focusing on .NET related jobs, but this time I'll go with AI ones.

https://arxiv.org/abs/2107.12979 Predictive Coding: a Theoretical and Experimental Review

Let me get breakfast while I read the paper.

11:40am. 15/56.

Precision also has deep relevance to machine learning. As noted in the backpropagation section later in the paper, predictive coding with fixed predictions and identity precisions forms a scheme which can converge to the exact gradients computed by the backpropagation of error algorithm. Importantly, however, when precisions are included in the scheme, predictive coding forms a superset of backpropagation which allows it to weight gradients by their intrinsic variance

No doubt I'll be reimplementing KFAC at some point.

12:10pm. I've gone through 2/3rds of the paper. Forget it for the time being.

Let me take a break here. For the next I'll forget about applying to places and focus on writing those articles. I'll make my best work public and then move to expanding my skillset into game dev. This will give me opportunity to work on Spiral more.

The poker games count a bit towards that already.

I'd also consider GPU and embedded, but I doubt there will be as much demand for Spiral there. With game dev I could be more creative and reach a wider audience.

Yes, going into game dev should give me the most freedom.

1:20pm. Let me finish World Witches and then I am going to get started on the article. The most important thing to do is some ice breaking. I'll want the tutorial series to at least cover training a Leduc agent.

1:40pm. Yeah, this is the way I operate. I prime my mind and then bring out the text. This is a completely different thing than messing with some game.

Sigh, it would be so easy to make money if I could do myself what would otherwise take an entire team. If sounds and graphics were free, I could take care of everything else. This might be unusual, but would it be so troublesome to actually take on a goal of level up those aspects?

Yeah, I should take on the goal of doing the Python articles and put the thing behind me.

1:45pm. I'll leave the last of the World Witches short for later. Let me start.

y = ()

Ok, it is possible to define empty tuples in Python like this.

1:55pm. Why is the create repository button grayed out in Github?

It seems .gitignore should not be selected.

2:10pm. The repo is made. Now I can start writing. I'll start with Serialization.

    let rec text l =
        let f = f s.from
        let rec loop (str : StringBuilder) =
            let l () = if 0 < str.Length then f (TokText(str.ToString())) :: l else l
            let var b =
                let c = if b then '`' else '!'
                if peek s = c then inc' 2 s; loop (str.Append(c))
                else var b (l ())
            match peek s with
            | x when x = eol -> error_char s.from "character or \""
            | '`' -> var true
            | '!' -> var false
            | '\\' -> special_char (l ()) text s
            | '"' -> close (l ())
            | x -> inc s; loop (str.Append(x))
        loop (StringBuilder())
    and var is_type l =
        let f = f s.from
        let text x _ = text (f (if is_type then TokMacroTypeVar x else TokMacroTermVar x) :: l)
        inc s; (many1Satisfy2L is_var_char_starting is_var_char "variable" >>= text) s

I noticed a regression in macros.

2::55pm. This is ridiculous. Why is it not tokenizing macros properly?

let macro' s =
    let inline f from x = {from=from; nearTo=s.from}, x
    let close l = let f = f s.from in inc s; List.rev (f TokMacroClose :: l) |> Ok
    let rec text l =
        let f = f s.from
        let rec loop (str : StringBuilder) =
            let l () = if 0 < str.Length then f (TokText(str.ToString())) :: l else l
            let var b =
                let c = if b then '`' else '!'
                if peek' s 1 = c then inc s; loop (str.Append(c))
                else var b (l ())
            match peek s with
            | x when x = eol -> error_char s.from "character or \""
            | '`' -> var true
            | '!' -> var false
            | '\\' -> special_char (l ()) text s
            | '"' -> close (l ())
            | x -> inc s; loop (str.Append(x))
        loop (StringBuilder())
    and var is_type l =
        let f = f s.from
        let text x _ = text (f (if is_type then TokMacroTypeVar x else TokMacroTermVar x) :: l)
        inc s; (many1Satisfy2L is_var_char_starting is_var_char "variable" >>= text) s
    match peek s, peek' s 1 with
    | '$', '"' -> let f = f s.from in inc' 2 s; text [f TokMacroOpen]
    | _ -> error_char s.from "$\""

Now it is back to normal. Sheesh.

Let me make this a patch.

5:05pm. Done with lunch.

5:10pm. Now I do not feel like programming anymore. But let me do at least the product. Yeah, this is the feeling. Programming is about constantly building things up.

6:20pm. It is taking me long to write this tutorials, but it is fine.

if peek' s 1 = c then inc s; loop (str.Append(c))

No wait. I should have inc'd it twice here. I did do that, but then I undo'd the changes and forgot to redo them.

6:30pm. Pushed out another patch.

Let me also commit the tutorial.

6:40pm. I'll close to the day here. Yes, this is more like how my days usually are. It is good that I took the time to improve the documentation and the editor support for Spiral over the last 9 days. And it makes sense for me to do this. Maybe some RL researchers will learn a thing or two through these articles and that will net me some clout. Maybe.

If I can get some attention, I might be able to interest the CEO in granting me a Grayskull card. If that happens the articles will pay for themselves.

The trade will be - give me a card and I will write an article praising its great speedups in public.

Anyone in a position of power would be interested in that.

6:55pm. It is not particularly unrealistic that it could work. The negative possibility is that they are backed up on orders and might not need the publicity. Or the CEO might not even bother to read my email. The later is a lot more likely than the first.

7pm. Still, I'll do what I must. I should do a good job of this series regardless. Every day I'll push my mind to its limit so that I might grasp the thread of victory. I won't give up no matter the obstacles."


Sunday 2021-08-22 18:01:55 by Scott Connelly

Add files via upload

The Pokedex program was designed as if it it were an actual Pokedex to be used for actual Pokemon battles. Say, for example, you wanted to try for the Pewter City gym badge by defeating its gym leader, Brock. You know that Brock's first Pokemon is a level 12 Geodude. You have a level 10 Butterfree and a level 8 Nidoran. Which of your Pokemon has a better chance of beating Brock's Geodude? That's where the Pokedex comes in.

It works like this. You first pick the Pokemon you will use in the fight, let's say Butterfree. Then you select the Pokemon you will be battling: Geodude. You declare the level of each Pokemon--10 and 12, respectively. Next you list the set of moves each Pokemon has. In our hypothetical example we are assuming you evolved the Butterfree from Caterpie so the move list is Tackle, String Shot, Harden, and Confusion. Now you list the moves the opponent knows: Tackle and Defense Curl for Geodude. The Pokedex takes this data and has the two Pokemon battle it out 1000 times. In the end, the Pokedex will display your chance of winning the battle. For this scenario, we have a 76.2% of defeating Brock's Geodude with our Butterfree.

Now we can see if we have a better chance of using Nidoran instead of Butterfree. The moves available for a level 8 Nidoran are Tackle, Leer, and Horn Attack. The move list will be the same for the opponent because Brock is still using his level 12 Geodude. After passing through the data, the Pokedex concludes that we have a 0% chance of defeating Geodude with our Nidoran. Yikes! Best to stick with Butterfree, then.

So how does the Pokedex actually work? First, it will ask which Pokemon you want to use. You'll need to know what the Pokedex number of your Pokemon is in order for the program to select the right Pokemon. In our example, if we choose Butterfree, we would input the number 12, which is Butterfree's Pokedex number. This is because when I stored the information of each Pokemon in a MySQL database, I used the Pokedex number as the primary key. Then the Pokedex asks which Pokemon the opponent is using. Since Brock uses Geodude, we enter 74, which is Geodude's Pokedex number.

The next thing the program asks for is the level of the Pokemon. While I didn't put any restrictions on the number you can choose (meaning the Pokedex will allow you have a level 10,000 Butterfree), Pokemon the game only allows levels ranging from 2-100. If you really wanted to cheat here you can, it would just make your battle data useless. After picking your level, you input the level of your opponent's Pokemon.

Finally, the Pokedex prompts you for the moves your Pokemon knows and then asks for the four moves your opponent knows. The way I programmed the Pokedex, it assumes a move set of four moves, and caps it at four, meaning you can't have a Butterfree with seventeen moves. (The game Pokemon uses this four-move restriction and I copied that philosophy here.) But because there is an assumption of four moves, in the cases where your Pokemon only knows three moves depending on its level, you would have to enter one of the moves twice. For example, our level 8 Nidoran only knows three moves: Tackle, Leer, and Horn Attack. When I entered the list of moves, I input Tackle, Leer, Horn Attack, and Horn Attack. (I favored Horn Attack because it was the strongest attack that a level 8 Nidoran would know.)

After inputting the information, the Pokedex has the two Pokemon fight each other in a loop for 1000 matches. The attacks are chosen at random. When the battle loop ends, your wins are displayed as a percentage out of 100.

I only created a database of the original 151 Pokemon and included every move to choose from except for Flail. Flail isn't a move in itself per se, but rather a side effect of when a learned move runs out of PP. What is PP? In the Pokemon game, PP is how many times you can use a move in a battle. The move Tackle has a PP of 40. The move Fire Blast has a PP of 5. You can use Tackle 40 times in a single battle and can only use Fire Blast 5 times. I did not program any PP restrictions into the Pokedex. I wanted it to feel like it would be an actual Pokemon battle in real life. If Pokemon were real creatures, there would still be the move restrictions (a Fire-type Pokemon would not be able to use a Water-type move, for example, and there would still be the four-move cap), but there would be no restrictions on how many times a Pokemon could use a move that it knows. I followed that philosophy in creating the Pokedex.

I hope you have fun playing around with the Pokedex and using it to give you an advantage in your battles. Best of luck, trainers!


Sunday 2021-08-22 18:52:33 by Bruno Shiohei

Update Projects - First half of 2021

This C program asks the user to enter a date. Then the software will check which day of the week that date refers to. This was my first project in the area, so sorry if it's bad, I did it with all love :D


Sunday 2021-08-22 19:28:46 by Ayush Agarwal

change terminals, overhaul nvim config

I decided to switch to alacritty from kitty because kitty doesn't support disabling italic fonts. Most monospace fonts don't have decent italic fonts and some terminals don't support it. I also feel that italics basically make up another unique font besides the 'regular' style that you'd use. The result is messy so we're better off not using italic fonts at all.

I did search for other alternatives and zutty and foot came up. Unfortunately, zutty probably doesn't support disabling italic fonts and although foot does, it's exclusive to Wayland. If I ever migrate to Wayland in the future, I guess I might switch to foot but judging from the state of affairs on Wayland, I don't expect to switch for at least for 2 to 3 years. Let's see if I'm wrong.

After chatting in the neovim chat room, thanks to a user called 'salt rock lamp', I realized that trying to use neovim as an IDE will probably be a painful experience, no matter what fundamentalists on an internet forum say. However, at this point, I'm too used to neovim so I'll try to adapt my neovim config to VSCode.

Also deleted a lot of unnecessary fish config files. I'm not sure why I committed them to my dotfiles repo.


Sunday 2021-08-22 20:46:01 by Xyphiz

holy shit its working kinda

idk what i did but its working now!?


Sunday 2021-08-22 22:34:24 by kangalioo

WIP attempt at implementing BotCommand in a cool way

I thought BotCommand could directly contain references into the framework's command objects... but this turned out to be a MAJOR FUCKING PAIN because then the framework instance has to be passed into every goddamn place where arguments are passed, and this brings a bunch of stupid problems with it. Just looks at slash/argument.rs, it's atrocious. The coolness of this approach isn't worth it


Sunday 2021-08-22 22:40:39 by raelorg

Third time Gravity Forms Area filed not working

[Part 1/2]

As we discussed, the chained select fields in some language versions of the https://www.rael.org/contact/ page seem to break intermittently.

I noticed that the chained select JavaScript in the page was actually working perfectly, so this is a different issue to the original problem that we resolved a couple of months ago.

However, the server was not always returning the list of State/Province/Area values. Sometimes the list was empty.

I examined the Ajax requests that the page was making to https://www.rael.org/wp-admin/admin-ajax.php and noticed that the requests for the working (English) and broken (Spanish) pages were identical, apart from one difference: the nonce value was different in each case.

By replaying the requests in Postman, I could see that the nonce value was critical to the script working correctly. If I used the English-page nonce value, the server returned the results correctly. If I used the Spanish-page nonce value, the server returned nothing.

Inspecting the page source, I can see that the nonce value is embedded in the page as follows:

/* */

It looks like Gravity Forms started adding nonces to their inline JavaScript as of version 2.5.8 (released 28 July):

API: Added new function GFCommon::get_inline_script_tag() which allows filtering of our theme inline scripts in WordPress 5.7 and up with the 'wp_inline_script_attributes' filter.

This is part of a WordPress initiative to move towards implementing a Content Security Policy.

Looking at /wp-content/plugins/gravityformschainedselects/includes/class-gf-field-chainedselect.php, I can see that Gravity Forms is indeed checking the nonce for chained selects and rejecting the request if it's not valid:

public static function get_next_chained_select_choices() { if ( ! wp_verify_nonce( rgpost( 'nonce' ), 'gform_get_next_chained_select_choices' ) ) { die(); }

[Part 2/2]

Since in Postman I could see that some nonces appeared to be valid while others were not - presumably because they had expired - I suspected that caching was the issue here, at the Kinsta and/or Cloudflare level.

Furthermore, the Gravity Forms authors recommend that you don't cache forms for security reasons:

Pages containing forms should be excluded from caching to prevent populated forms being cached and displayed to others.

I noticed that you are using the Fresh Forms for Gravity plugin to tell Cloudflare not to cache forms; however this plugin doesn't work with Kinsta hosting:

Certain hosts like WP Engine and Kinsta don’t allow HTTP headers modification from WordPress side of things, therefore CloudFlare support will not work for these hosts.

Logging into your Cloudflare, I could see that there was a page rule for rael.org/ that had Cache Level set to Cache Everything (at the bottom of the list of rules). This makes Cloudflare cache HTML pages.

This means that Cloudflare is caching those nonce values inside the HTML. WordPress nonces are valid for 12-24 hours by default. This explains the erratic behaviour with the form: If the version of the that page you visit happens to have been cached by Cloudflare less than 12-24 hours ago then the nonce will still work, but if Cloudflare cached it more than 12-24 hours ago then the nonce will be too old and will be rejected (breaking the chained selects feature).

To fix the issue, I added Cloudflare page rules for the contact form that set Cache Level to Bypass, and purged the Cloudflare cache. (Since there are different URLs for different language versions of the form, I needed to add 7 page rules to do this.) Now the contact form page is not cached by Cloudflare.

Similarly, I noticed that your Kinsta page cache expiration (Kinsta admin > Tools > Site cache > Modify > Change cache expiration) was set to 24 hours. Again, this may cause issues, because it could be caching nonces that have expired. So I've changed this to the default value of 1 hour.

I've tested the contact form after making these changes and the chained selects now appear to work in all languages.

Please let me know if you have any questions on the above.

Thanks Luc! Matt


Sunday 2021-08-22 22:42:06 by Hugh Dickins

mm: put_and_wait_on_page_locked() while page is migrated

Waiting on a page migration entry has used wait_on_page_locked() all along since 2006: but you cannot safely wait_on_page_locked() without holding a reference to the page, and that extra reference is enough to make migrate_page_move_mapping() fail with -EAGAIN, when a racing task faults on the entry before migrate_page_move_mapping() gets there.

And that failure is retried nine times, amplifying the pain when trying to migrate a popular page. With a single persistent faulter, migration sometimes succeeds; with two or three concurrent faulters, success becomes much less likely (and the more the page was mapped, the worse the overhead of unmapping and remapping it on each try).

This is especially a problem for memory offlining, where the outer level retries forever (or until terminated from userspace), because a heavy refault workload can trigger an endless loop of migration failures. wait_on_page_locked() is the wrong tool for the job.

David Herrmann (but was he the first?) noticed this issue in 2014: https://marc.info/?l=linux-mm&m=140110465608116&w=2

Tim Chen started a thread in August 2017 which appears relevant: https://marc.info/?l=linux-mm&m=150275941014915&w=2 where Kan Liang went on to implicate __migration_entry_wait(): https://marc.info/?l=linux-mm&m=150300268411980&w=2 and the thread ended up with the v4.14 commits: 2554db916586 ("sched/wait: Break up long wake list walk") 11a19c7b099f ("sched/wait: Introduce wakeup boomark in wake_up_page_bit")

Baoquan He reported "Memory hotplug softlock issue" 14 November 2018: https://marc.info/?l=linux-mm&m=154217936431300&w=2

We have all assumed that it is essential to hold a page reference while waiting on a page lock: partly to guarantee that there is still a struct page when MEMORY_HOTREMOVE is configured, but also to protect against reuse of the struct page going to someone who then holds the page locked indefinitely, when the waiter can reasonably expect timely unlocking.

But in fact, so long as wait_on_page_bit_common() does the put_page(), and is careful not to rely on struct page contents thereafter, there is no need to hold a reference to the page while waiting on it. That does mean that this case cannot go back through the loop: but that's fine for the page migration case, and even if used more widely, is limited by the "Stop walking if it's locked" optimization in wake_page_function().

Add interface put_and_wait_on_page_locked() to do this, using "behavior" enum in place of "lock" arg to wait_on_page_bit_common() to implement it. No interruptible or killable variant needed yet, but they might follow: I have a vague notion that reporting -EINTR should take precedence over return from wait_on_page_bit_common() without knowing the page state, so arrange it accordingly - but that may be nothing but pedantic.

__migration_entry_wait() still has to take a brief reference to the page, prior to calling put_and_wait_on_page_locked(): but now that it is dropped before waiting, the chance of impeding page migration is very much reduced. Should we perhaps disable preemption across this?

shrink_page_list()'s __ClearPageLocked(): that was a surprise! This survived a lot of testing before that showed up. PageWaiters may have been set by wait_on_page_bit_common(), and the reference dropped, just before shrink_page_list() succeeds in freezing its last page reference: in such a case, unlock_page() must be used. Follow the suggestion from Michal Hocko, just revert a978d6f52106 ("mm: unlockless reclaim") now: that optimization predates PageWaiters, and won't buy much these days; but we can reinstate it for the !PageWaiters case if anyone notices.

It does raise the question: should vmscan.c's is_page_cache_freeable() and __remove_mapping() now treat a PageWaiters page as if an extra reference were held? Perhaps, but I don't think it matters much, since shrink_page_list() already had to win its trylock_page(), so waiters are not very common there: I noticed no difference when trying the bigger change, and it's surely not needed while put_and_wait_on_page_locked() is only used for page migration.

[[email protected]: add put_and_wait_on_page_locked() kerneldoc] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Hugh Dickins [email protected] Reported-by: Baoquan He [email protected] Tested-by: Baoquan He [email protected] Reviewed-by: Andrea Arcangeli [email protected] Acked-by: Michal Hocko [email protected] Acked-by: Linus Torvalds [email protected] Acked-by: Vlastimil Babka [email protected] Cc: Matthew Wilcox [email protected] Cc: Baoquan He [email protected] Cc: David Hildenbrand [email protected] Cc: Mel Gorman [email protected] Cc: David Herrmann [email protected] Cc: Tim Chen [email protected] Cc: Kan Liang [email protected] Cc: Andi Kleen [email protected] Cc: Davidlohr Bueso [email protected] Cc: Peter Zijlstra [email protected] Cc: Christoph Lameter [email protected] Cc: Nick Piggin [email protected] Signed-off-by: Andrew Morton [email protected] Signed-off-by: Linus Torvalds [email protected] Change-Id: I3e95f927445a686b02c7a8d9932a2acdc9a1baf5 [[email protected]]: Fixed trivial merge conflicts Git-Commit: 9a1ea439b16b92002e0a6fceebc5d1794906e297 Git-Repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Charan Teja Reddy [email protected] (cherry picked from commit 2719bee9e573eaf37e51786d689f933c305ae325) (cherry picked from commit 0e9971bf2f237ece211a329868426f43a62c2a1d)


Sunday 2021-08-22 23:34:59 by Stalkeros2

RCD disks, more rev PDA sounds, an attempt at music, also stupid mistake i did with a defib pls forgive

Uuuuuuuuh I wanna sleep I'm sorry if I broke something


< 2021-08-22 >