« first day (1331 days earlier)      last day (2542 days later) » 
00:00 - 15:0015:00 - 00:00

3:10 PM
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:
The nesting is strong with this one.
But at least I got my context properly secured.
 
Wow indeed
 
It gets better.
With the open book, I scan over every word.
I don't know much about complexities, but this probably screws with the metrics.
I probably need to optimize it before I run it over my entire library.
 
Anyone selling me some coding motivation?
I first need to figure out something with using two binomial distributions though
 
Plot them.
 
That would be very easy
 
3:18 PM
Throw dice.
Throw coins.
Throw something, plot result.
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).
 
I need to calculate remaining picks in a game: You have 30 picks, so you take the current pick and then you have 30 - current remaining
Easy right?
 
Yup.
 
And I need to calculate the odds of at least K of them being true
However picks 1, 10, 20 and 30 have different probabilities :|
 
So?
 
So the "at least K" part is over both distributions
 
3:21 PM
So you need to track whether you've had 1, 10, 20 and 30 yet. That's not hard.
 
I thought it is solvable by case distinction, but there should be an easier way
 
Make it work first, make it pretty later.
It doesn't sound hard, but you probably miss something halfway.
 
I'd rather have the calculations down first
 
Yup.
 
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?
 
3:29 PM
You could start writing the code and find out :-)
 
I don't want code... yet
 
13 mins ago, by skiwi
Anyone selling me some coding motivation?
 
Let's see if I can dumb this example down...
New question: What is the probability of throwing at least six ones when throwing three six-sided dies and twenty eight-sided dies?
That's the same as I was trying, right? :)
 
> output 3d6 + 20d8
That's what you're trying, right?
 
Hmm... not really? I don't care about the numbers, adding them up has no meaning
 
3:40 PM
No, this just rolls the correct dice. I don't know how to select the probability of 'at least N of X'.
 
Don't you have that exact problem statement in your courses?
I know I had literally that on exams
 
@JeroenVannevel What is "that"?
 
> What is the probability of throwing at least six ones when throwing three six-sided dies and twenty eight-sided dies?
 
I don't recall having had that, I've taken a Probability Theory & Statistics course though
(And successfully finished it)
 
If I hadn't thrown my notes away after I graduated, I could've looked up that exact question (apart from the 8-sided) in there
This wasn't in your probability course?
 
3:50 PM
Well, I don't recall it :P
All I remember is that there's different distributions
 
too bad it doesn't show the formula used
could've just plugged in the 8-sided one in there as well
 
Oh right, Wolfram Alpha, I've used that site a lot :D
The calculation with a single die is easy though, that's not the issue
 
With many dice it's easy as well, it gets complicated when you mingle two types of dice.
 
Questions about improving working code belong on CodeReview. — Paul R 38 secs ago
 
0
Q: Encryption program

SalmaI 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...

 
4:05 PM
possible answer invalidation by wdsa on question by wdsa: codereview.stackexchange.com/posts/150799/revisions
 
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
 
start with good old WPF
don't make choices based on potential eventual changes once it's all done
 
I don't really like WPF though, from experience
I was under the impression that Xamarin made it simpler, but that may be incorrect
 
WPF and Xamarin forms are very similar iirc
One just has a lot more documentation while the other is CP
 
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
 
4:14 PM
there ya go
WPF it is
do a trial later when you're in an advanced stadium
 
@skiwi Then look into that first to see if UWP serves your needs.
It probably doesn't.
 
Merry Christmas and/or Happy Holidays to yinz.
 
0
Q: Java - simple beginner Tic Tac Toe - problem with randomized computer

gelato0110I 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 It's more of a stretch goal, I suppose you could hack it into UWP somehow...
But I've had nightmares about WPF
 
I'm learning to like WPF.
Though I've been using UWA lately. Similar to WPF, but it is missing a few features.
 
4:26 PM
@CaptainObvious Broken Code is Broken.
 
@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
 
Remonking or something
 
@Vogel612 Soon it's Nomking
Omnomnomnom
 
0
Q: Other stuff on the page overlapping the navigation bar jquery.sticky

SandroGood 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...

 
@CaptainObvious HAMMERTIME
 
4:55 PM
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
For the SEDE enthusiasts: is it possible?
 
IIUC it isn't.
because the aggregate question score is not given with time. For that you'd need to analyze vote counts and that's not possible
 
0
Q: Object Pooling in Unity

denisI'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 /// <

 
if your code works fine post this on codereview other wise tell what is the problem. — M.kazem Akhgary 43 secs ago
 
5:59 PM
0
Q: Find element in 2D matrix where rows and columns are sorted

Pranit Kothari#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; ...

 
If it's a working piece of code then this belongs to codereview.stackexchange.comMYGz 43 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. — overexchange 14 secs ago
 
6:16 PM
Merry Christmas.
 
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? — overexchange 50 secs ago
 
Overall, CR seems to be losing ground.
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Displaying dynamic fields for Trac tickets
 
It seems to be a bit of a niche community revolving around a core set of users :(
I wish answering the zombies wasn't quite so hard.
 
0
Q: UVA 750: 8 Queens Chess

AbhisekIn 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...

 
6:23 PM
@CaptainObvious Ohh, I'll take that.
 
6:41 PM
0
Q: Number Theory Inhibitor Calculator

Linus RastegarI'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...

 
6:54 PM
You probably want to move this to Code Review site which is for, well, code review. — Sami Kuhmonen 40 secs ago
I'm voting to close this question as off-topic because it belongs on CodeReview. — Scott Hunter 48 secs ago
 
@Hosch250 in what respect
 
It doesn't seem to be as active and vibrant as it was shortly before graduation.
I don't think it is just the holidays because it has been like this for a while.
Maybe this is just the chatroom effect, though.
 
probably not only
but yes, voting has significantly reduced since graduation has seen us shutting down the mission™
 
Has the answer rate per active user reduced as well?
@EBrown Do you have that stat somewhere?
What about the question rate per active user rate?
I thought we had an encryption tag.
 
might have gotten synonymized into
 
7:08 PM
No.
Anyway, the question is about a trivial cipher, so it doesn't matter much.
 
-3
Q: in need a help in array dimensional matrix

PrincessHow i can store dimensional matrix of 1 X 8 in java by using this elements 23 25 27 30 32 40 41 42 in need a help

 
we should have most trivial ciphers (and other common ciphers) as tags, if memory serves
 
@Hosch250 I can check both of those if you would like.
 
Sure.
 
What specifically do you want to see? [Total Questions] / [Active Users]?
 
7:12 PM
Questions per Day/Active Users
Or Questions/Active Users/Day.
Hmm.
Yeah, Questions per Active Users/Day.
Basically, the questions/day stat adjusted to ignore drive-by shooters.
 
@Hosch250 interesting would be to see how many drive-by-users we got .
 
Yeah, that too.
 
as well as drive-by answers, which is most probably extremely low compared to other SE sites
I'd say less than 5 answers counts as drive-by
 
But they have to have not answered for a while, or that will prune out new answerers.
 
@Vogel612 I don't have that information available.
 
7:16 PM
How do you like my logo?
 
The text needs help
 
@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..
 
OK.
@EBrown Unfortunately, I can't change the font or color.
 
why that?
 
Oh wait, I can just make it not show the name.
 
7:18 PM
ohh ... windows ..
 
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.
 
Bashing windows isn't even fun anymore :/
well as long as it's inconsequential as this :)
 
Meh, it has a nice kernel. It's just the programs and UI that's a mess.
 
because a lot of the consequential stuff is ... fixable at the very least, which is good
 
And the UI isn't even half bad, and they can't help most of the programs.
Any feedback on my UI mockup?
 
7:21 PM
It's much more "fun" to rage on java, for some values of java
 
14 hours ago, by Hosch250
user image
@Vogel612 java isn't as bad as JAVA.
 
@Hosch250 Very spartan :)
@Hosch250 oh you probably have no idea
 
Probably not.
 
@Hosch250 i have [QuestionsPerDayPerActiveUser] now.
 
@Vogel612 Yeah, I figure a nice background image and a few ads should liven things up.
 
7:23 PM
did you know that 128 == new Integer(128) returns true, but 129 == new Integer(129) doesn't?
2
 
It's a mostly downward slope.
 
Maybe a small rectangle ad at the bottom underneath the board
@Vogel612 I feel like Captain Needa. Java will forgive me after I'm dead.
@EBrown I thought it would be.
 
I need to get custom graphing on SESE.
 
Where's the link? I don't have it anywhere.
 
7:24 PM
I mean, SESE's link.
Thanks.
 
No problem. I have it memorized lol
 
@EBrown The Programmers thing is messed up.
 
@Hosch250 Which one?
 
It says "Programmers" for the image.
And that overlaps with the tile title.
 
Ah yeah because they changed names.
I need to manually merge them.
SE has no Id field in the API, so I go off the ApiSiteParameter which changed for them, so SESE sees it as a whole different site.
 
7:27 PM
I need to go have lunch. BBL.
 
@EBrown metadataception?
 
@skiwi Something like that.
Currently reorganizing a huge index.
5 million records in that table, which means 5 million records in the index lol
Alright, 4.5 million but still.
 
7:53 PM
0
Q: Linked list in JavaScript

user200400I 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) { ...

0
Q: AT&T Assembly - Basic loop & write

Greg01reI 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 ....

 
8:10 PM
Hmm
1
A: What is the probability of throwing at least k ones when throwing n six-sided dies and m eight-sided dies?

cool.coolcoolcoolNot 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
 
 
1 hour later…
9:18 PM
This post might be better at Code Review(codereview.stackexchange.com) — Luke Melaia 45 secs ago
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 Trevino 51 secs ago
 
Wow, I opened a can of worms
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
 
9:56 PM
XCOM Enemy Unknown with Joyful, Joyful on spotify ... strangely appropriate
 
10:23 PM
Got a storm going on.
I like track 15 especially.
 
10:56 PM
Poisson is almost the default one
Not sure what you did see in your probability class then
 
@JeroenVannevel The Poisson Binomial distribution is not a default one
 
0
Q: Collection to hold maximum number of running Tasks

Mihail ShishkovI 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...

 
11:13 PM
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
 
Guess I was just lucky then
poisson was my entire course
 
11:29 PM
Anyone know the main room for Software Engineering?
Nevermind I found it.
 
11:41 PM
I feel like I won't get an answer.
 
Monkernoon
 
@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.
 
UWA is all TPL
 
@Vogel612 That's curious, does it have to do with the number lf bits used?
 
@EBrown It still has threads.
 
11:54 PM
indirectly. ..
 
And maybe it shouldn't be giving me this exception then:
> The application called an interface that was marshalled for a different thread.
 
@Hosch250 I don't know about that, DBA has a similar discrepancy.
 
They should bloody well know that UI's update on events.
 
@Vogel612 because there's a cache
ints -128 to 127 are cached
or -127 to 128
you get the idea
range of a byte
 
@JeroenVannevel Negative is lower.
 
11:56 PM
@Hosch250 I have seen Software Engineering, Super User, and Database Administrators now all have the same discrepancy.
 
Maybe that's when SE runs the trash compactor?
 
I don't know, looks like whatever "it" was lasted multiple days.
 
@JeroenVannevel I know... still unintuitive
 
eh, I suppose. Not a typical operation you'd do so the performance impact is much more important
 
cuts down designers
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
    LoadBoard();
    LoadPieces(null, Board);
});
 
11:59 PM
@Hosch250 Yeah you have to use the Dispatcher if you want to update UI elements from another thread.
 
Maybe we are doing it wrong in RD.
 
00:00 - 15:0015:00 - 00:00

« first day (1331 days earlier)      last day (2542 days later) »