Getting incorrect answers - equation

I'm new to Python with three minor inquiries. Thank you.
Tried to solve this equation (last question of the three) and got the wrong answer based on me working it out by hand Last question is incorrect.
I could use some guidance on the simplest way to present the answer.
This other equation is also showing the wrong answer for a modulo - see before and after Before change Modulo/After change.

Related

PhpStorm's "Find" window - How can I make the regex checkbox visible by default?

As highlighted by the screenshots above, the regex checkbox of PhpStorm's find window is no longer visible by default. This is annoying, because I cannot always see, whether a regular expression is narrowing my search or not. I already googled for a solution, but I cannot seem to find one.
Does anybody of you know how to "fix" this?
Thanks a lot in advance :)
Edit: In case you need to know, I am working on a Mac.
It's a bug in 2018.1.
https://youtrack.jetbrains.com/issue/IDEA-188790 -- ticket status says fixed ... but target version is only 2018.2.
Try asking there if the fix will be included in 2018.1.3 or so .. or will it be in 2018.2 only.

Chrome debug/source displacement

I know a lot of users had faced the issue. Did somebody solve this one? Maybe Chrome developers addressed this somewhere?
It's clear from the screenshot, but I'll spell this:
Chrome is misplacing string numbers time to time. And the misplacement is fixed through the file, it's 2 lines miss in this particular case.
Ok, the one way is to simply edit debugging source right in the middle of the process in Chrome (in my case it's: to add 2 empty lines in the beginning of the file).
But I hope someone can advise a better solution.

How to update the form based on a crosstab

I suppose the solution is at http://wiki.lessthandot.com/index.php/Crosstabs,_forms_and_updating (frequently mentioned by user Fionnuala)
but unfortunatelly the images do not show. Can anyone give me similar examples? I find the solution so useful but cannot understand it well enough.

Starting off with Mozilla development/contribution to Fennec

This is the first time I am trying to contribute to Mozilla. I went through several articles and documentation/resources to get a hang of what could be the best first steps to get started. I started off from this page http://whatcanidoformozilla.org1 and chose to start off with Java.
On initial tinkering I was taken to https://wiki.mozilla.org/Mobile/Get_Involved and eventually https://wiki.mozilla.org/Mobile/Fennec/Android/Suggested_workflow resource suggested that the best way to get started with it would be to pick up some simple bug and propose a patch for it.
So then I went to http://www.joshmatthews.net/bugsahoy/?java=1&simple=1 and this specific bug drew my attention. The description of the bug mentioned this :
There are some methods that we share (or can share) across our DB
implementations, like appending PARAM_SHOW_DELETED, PARAM_LIMIT, or
PARAM_PROFILE.
These are currently spread across LocalBrowserDB, TabsAccessor,
URLMetadata, and so on. It'd be nice to clean these up.
Question 1. Now how do I get some more context on what exactly is the bug and what is required to be done ?
As of now there seems to be 2 patches already submitted from what I understood (and please correct if my understanding is wrong here). So to get some context about the bug I went ahead and opened up the first patch submitted here.
It gave me some idea as to at least where exactly is the code itself that needs to be fixed. And I found it here
Question 2. Am I on the right track on how to figure out the code that needs to be fixed ?
Question 3. Even after reaching the DBUtils.java file I could not find any documentation about what the class basically does, or where does it fit into the whole picture. Could someone please help me with this, as to how do I figure out what a class is supposed to be doing etc. or at least some documentation around it?
You're on the right path. Basically, the What Can I Do For Mozilla website is a quick and easy way to let you discover projects you might be interested in, so it's the first gateway to the coding contributions.
That said, you did good in picking a bug to start off. However, as you saw the bug was already being worked on by somebody else (marked as Assigned). Your best bet is to find some new "good first bug" to work on. This might be a complicated task, as Bug's Ahoy shows only a few not owned good first bugs.
You should try to get in touch with the Fennec team, either via email or IRC (the latter for quicker responses).
Now, to answer your questions, in a more general way
Question 1. Now how do I get some more context on what exactly is the
bug and what is required to be done ?
Usually, this should be described in the first comment in the bug, on Bugzilla. If that's not the case, feel free to drop a message there and ask for more directions. You can also flag the reporter or the mentor of the bug using the needinfo functionality, as they are usually better shown.
As you can see, somebody asked for more info in comment 1 and some new directions were given.
In general, you won't find a patch with code on the bug itself, but you might find links to files and more precise directions on what to change and how. If not, again, feel free to ping the reporter and/or mentor.
Question 2. Am I on the right track on how to figure out the code that
needs to be fixed ?
You're on the right path. In general, if there are no links to files or DXR on the bug, but some code is mentioned, you can look it up using DXR, as you did.
Question 3. Even after reaching the DBUtils.java file I could not find
any documentation about what the class basically does, or where does
it fit into the whole picture. Could someone please help me with this,
as to how do I figure out what a class is supposed to be doing etc. or
at least some documentation around it?
What I usually do when navigating the Firefox code and need some more background on a not so well documented class, is browse the change log for that file, clicking on the Log button in the top-right panel on DXR (when displaying the file). It will show you a list of bugs that affected the file. You can even trace back the original file that implemented it, to get more context.
On the other hand, if you're only interested to the history of a single line of code within a file, then the blame tool is your friend. It tells you who last touched the line, the changeset and the related bug number. That is also accessible from where you can find the Log, here.
In the case of DBUtils.java, however, it looks like the class just holds some utility functions for database access.
To see how something is being used within the Firefox codebase, you can still use DXR. Here's a sample search for the DBUtils object.

Where can I find previous ACM ICPC contest problems?

I'm leading a small group of developer at my university and I'd like to work through a couple of ICPC problem sets from previous years.
Searching on Google yields no useful results, just page upon page of broken links and private .edu domains.
Does anyone know where to find these problem sets from previous years?
Found the motherload here:
http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8
You might also like the following problems:
Google has posted some interesting problems. People also post their solutions, so you can see how others implemented a solution.
http://code.google.com/codejam/contests.html
Reddit is also another good source to get interesting problems.
http://www.reddit.com/r/programmingchallenges/