with open('bookQueries.sql', 'w') as output_file:
with open('books.data', 'r') as input_file:
for book in input_file:
with open(book, 'r') as current_book:
It's binominal though, so with a dice you're stretching it (unless you plot the amount of times you threw X vs the amount of times you didn't throw X).
But in my head it already gets difficult if I need at least one of the remaining picks to be true
It's case 1) At least one of the special cases is true and none of the normal cases are true, or 2) At least one of the normal cases is true and none of the special cases are true
Then you multiply the inner parts of 1) and 2) and sum them together... but is it really that simply?
I wrote a java program that given a text message will print the encoded message. the problem is described in the following link :
https://www.hackerrank.com/challenges/encryption
import java.util.Scanner;
public class Encryption {
public static void main(String[] args) {
Scanner scan = new...
I can't imagine nobody has ever thought about this though
@JeroenVannevel You're the C# guru, what do you suggest if I want to create a (simple) desktop application for Windows? I was thinking about Xamarin.Forms
I may eventually want to support macOS and Linux too
Also deploying as UWP app may be very nice as users can then install it easily, but I haven't investigated that much more than that Xamarin is capable of that
Though in a later stadium I need to interface with the user32.dll to capture the screen of another program and I don't even know yet if UWP is capable of that :D
I am just starting to learn programming and I am having trouble making a Tic Tac Toe game (player vs. computer) where the computer picks a random spot. I am using a 2D array for the board. I have a Board class and Game class. Here is some code from the game class:
public void playerMoveX()
{
...
@EBrown I don't really like the MVVM and shenanigans, in that sense Javascript can be way easier, also more hacky but I don't need my codebase to be perfect
Wat. MathJax was broken in Firefox, I load something requiring MathJax through Edge once and now it's working again
Good morning,
I'm creating a webpage and i'm not an experienced developer. I have made a sticky navbar using the jquery plugin sticky.js. Everything was perfect but when i have added the animations to the pictures now the pictures are overlapping the navigation bar. How i can stop the overlapping...
Would it be possible to make a SEDE query to scan for this? Something like: Question has low score, question is edited, question gets much higher score. — Simon Forsberg ♦1 hour ago
I've made 2 object pooling classes -
MonoObjectPooler : MonoBehaviour - can hold a single bucket of pooled objects of 1 type.
PolyObjectPooler : MonoBehaviour - can hold multiple buckets of pooled objects of different types.
The object to pool information is store in a class PooledObject
/// <
#include <iostream>
#include <vector>
using std::vector;
using std::endl;
using std::cout;
int main()
{
vector <vector<int>> arr
{
{10,20,30},
{25,26,60},
{38,47,50}
};
int target = 47; // just test
int r, c;
r = 0;
bool found = false;
...
I want you to review my changes, after posting my query at codereview. I do not want to repeat such mistake reaching at this point. — overexchange14 secs ago
I want you to review my changes, after posting my query at codereview. I do not want to repeat such mistake reaching at this point. Can I ping you, once the query is posted? — overexchange50 secs ago
In chess it is possible to place eight queens on the board so that no one queen can be taken by any
other. Write a program that will determine all such possible arrangements for eight queens given the
initial position of one of the queens.
Input
The first line of the input contains the number o...
I've been working on generating primes and prime products quickly to aid me in my research on prime numbers, their density, etc. The answer to my Large Number Limit Extravaganza question proved to be extremely useful in writing my programs. I have now expanded on this program to look at the diffe...
@Hosch250 doesn't matter. I think those are drive-by until proven otherwise. the percentage of new answerers vs. drive by's is probably acceptable error..
And, if it needs it, I can put the name in the image.
@Vogel612 Basically, it has one default for tiles without the name it in. I can make it not show the name at all, and that serves my purpose quite as well.
I wrote this simple linked list in JavaScript. Feedback is welcome.
function Node(data)
{
this.next = null;
this.data = data;
}
function LinkedList()
{
this.length = 0;
this.head = null;
// add node with given value to the list.
this.add = function (value)
{
...
I just wrote this code and I would like someone to criticize it. I know that's far from being good assembly but I only started learning it a few days ago and I would like to improve.
Feel free to say anything. Oh and if you have general tips and good resources, always appreciated. :)
.section ....
Not sure if there would be a neat closed form expression for this. However, we essentially want to sum up the probabilities of all events in which $k_6 + k_8 \geq k$, where we define $k_6$ as the number of ones rolled from the $n$ six-sided dice, and $k_8$ as the number of ones rolled from the $m...
I'm not convinced by this answer actually, gave my upvote too early
Thanks, i'm still learning about this site so i didn't know about code review. so what, i go there and state my issue like i do here or what? — Bernardo Trevino51 secs ago
In probability theory and statistics, the Poisson binomial distribution is the discrete probability distribution of a sum of independent Bernoulli trials that are not necessarily identically distributed. The concept is named after Siméon Denis Poisson.
In other words, it is the probability distribution of the number of successes in a sequence of n independent yes/no experiments with success probabilities
p
1
,
p
2
,
…
,
...
Apparently this is.. kind of, the thing I'm looking for, I haven't even had that one in class
I need a collection/bag (something) that will hold some maximum number running Task objects. Adding a new running Task to the collection should block the calling thread (there are many threads trying to add a task so it should be thread safe) until there is an available slot for the new Task to b...
Actually, seeing the formula again and considering there's really only four probabilities in play (with two of them being 1 minus that probability) it should be fairly easy to build it using the binomial coefficient
@EBrown I think they deleted a bunch of questions when they changed the name.
Gosh, I want to hang the UWP designers.
I have to update the UI when I an event fires.
Of course, they would decide that System.Threading.Thread isn't needed anymore, so I can't just get a handle to the thread when the ctor runs and run it on that thread.