« first day (1903 days earlier)   

12:00 AM
RELOAD! There are 5456 unanswered questions (89.9382% answered)
12:32 AM
Q: A simple library using Flask and SQLAlchemy

TristoThis is the main.py script that does most of the work of Adding movies (Movie objects) as well as modifying and removing from flask import Flask, render_template, request, flash, url_for, redirect import sqlite3 from datetime import date from sqlalchemy import create_engine from sqlalchemy.orm i...

12:48 AM
Q: R Function to Generate Predictions from Ratings and Save Results

user2355903I am trying to generate predictions using the function below in combination with sapply. My actual datasets are very large, I am attempting to make 1.5 million predictions with this function and it is currently taking about 10 seconds per prediction which is... prohibitive to say the least. mean...

1:21 AM
Q: function to copy a file using sendfile

H. JangI've just found there is sendfile(). In man page of sendfile(), it says "sendfile() is more efficient than the combination of read(2) and write(2)." So, I wrote a function to copy a file using sendfile(). Is really my code more efficient than the combination of read(2), write(2)? Here is the c...

1:54 AM
Q: Demonstration of Pentagonal Number

austingae Have the function PentagonalNumber(num) read num which will be a positive integer and determine how many dots exist in a pentagonal shape around a center dot on the Nth iteration. For example, in the image below you can see that on the first iteration there is only a single dot, on the...

2:05 AM
show seems to be what you want, but in order to really assess that, I'd have to see more of the code. If your code is working, but you're looking for ways to make it neater/more RESTful, you could try a question on Code Review Stack Exchange. — thesecretmaster 24 secs ago
1 hour later…
3:05 AM
possible answer invalidation by user2355903 on question by user2355903: codereview.stackexchange.com/posts/199718/revisions
1 hour later…
4:14 AM
4:59 AM
Q: Recreated REG.exe Query functionality in C++

user36278I decided to try an recreate Microsoft's REG.exe query functionality. I thought that it would be a great way to test myself and help to get a better grasp of Microsoft API's as well as better my programming skills. I know it is not the best code. But if you could please provide constructive crit...

1 hour later…
6:11 AM
@Vogel612 Wrote an answer, ish. Hope it ain't too ranty.
6:24 AM
Good Monking.
possible answer invalidation by PythonNewb on question by PythonNewb: codereview.stackexchange.com/posts/199641/revisions
6:50 AM
possible answer invalidation by PythonNewb on question by PythonNewb: codereview.stackexchange.com/posts/199641/revisions
@Duga rolled back.
@Duga both of them actually :)
@Duga not sure about this one. Someone with experience in R take a look?
7:14 AM
Q: Shorter union SQL

AllenBooTungThis is how I union a query. All of the tables are in same structure. $prefix = "dev_"; $tables = [$prefix."pp", $prefix."pe", $prefix."chem", $prefix."fiber", $prefix."plastic", $prefix."qc", $prefix."cac", $prefix."electron"]; $getSQL = ''; foreach ($tables as $key => $table) { if (!$getSQL...

Q: Long running task on ASP.NET Core

CagurtayI want to add a background task to my web server that listens to some locations on network, triggers when a specific file created/modified, parses it then pushes it to database. My idea is to create a new thread for this task and work in there to prevent it from messing with the web server but I...

Q: Disable print dialog using client side code

Angelo Fernandez Is it possible that I can disable print dialog using client side code such as: Either jQuery Javascript PHP Framework Library (CodeIgniter)

Q: Generating permutation of the string in c++

Kriti SahuThis is the code which generates possible permutation using bit masking. I am having problem in understanding how is it executing after this condition when i = 2 , bit = 4 , mask = 7. #include <iostream> #include <string> using namespace std; void recurse(string s, int mask = 0,string out = ""...

@Vogel612 It definitely looks invalidating. But user also claims to have posted a new question in a comment under the answer that's no longer there, so I'm not sure what's going on.
self-deleted 4 hours ago
I'd roll it back, leave the relevant comment and expect a follow-up question.
1 hour later…
8:25 AM
8:50 AM
Q: Is there a better way to write this for each loop down? Stream?

Maciazprivate Map<Tour,Integer> getTourMap(List<Tour> tours) { ExecutionParameter param = new ExecutionParameter(); for (Tour tour : tours){ param.setTourId(tour.getId()); ExecutionResult result = (ExecutionResult) execute("TOURS", param); map.put(tour, result.getTou...

I've voted to close this as 'too broad'. This question looks like it should be posted at Code Review since you appear to have a working solution but want suggestions for improvement. — timclutton 59 secs ago
1 hour later…
10:02 AM
According to this changeset it has been fixed in the 5.9 branch already. — Torben L. 41 secs ago
Another thing - for a comprehensive code review, you could try Code Review SE. — Boris the Spider 35 secs ago
10:31 AM
Q: Implement metaclass for Maximumlikelihood estimator

mcocdawcFor the purpose of defining a lot of Maximum Likelihood estimators, I think I need a metaclass. At the moment I have to copy/paste a lot of code for every new class definition and just substitute the corresponding scipy.stats functions. from scipy.stats import fisk, t from statsmodels.base.mode...

10:48 AM
Q: Coding minecraft mods in linux

user175385I was making my minecraft mod in Linux Ubuntu. And while doing this in the terminal: ./decompile.sh and an error appeared: https://pastebin.com/kkGur1ZD Anyone halp me? On the beginning, I saw this: !! Please install either wine or astyle for source cleanup !! # found ff, ff patches, srgs, n...

@CaptainObvious Blatantly off-topic.
11:04 AM
Q: Showing correct response in Postman but wrong response in Swift Alamofire for Email Verifcation

AnshuIf already registered email id My response is like that ** { "signup": false, "user": true, "userId": "88" } **If New email id { "signup": false, "user": false, "userId": null } **Parameter * let params: Parameters = [ "email" : candiateFileds.email] **He...

@CaptainObvious Broken, crap, or both.
Is GenericLikelihoodModel of your own doing or is it from a third-party library? — Mathias Ettinger 26 mins ago
> A ? B
> yes
11:25 AM
@202_accepted I've been thinking. Why do you want the 5VDC from the 24VDC? We usually pull directly from mains in industrial applications, so over here that's 230VAC to 24VDC and 230VAC to 5VDC.
11:36 AM
Q: how to validate command line usage message using python?

user175396how to validate command line usage message using python?

@Mast We would as well, but it's far more work to route the 480V source, and we have to add this component to a funky spot.
@202_accepted Ah, right. Space constraints, we meet again.
That and a 6-inch firewall separating the 480V source from the 24V area I need it in lol
(Which is about 15cm)
11:44 AM
Well, if you want a really good one, get a Vicor chassis-mounted converter. But they're expensive and overkill.
At least it won't fail you in a hundred years, so there's that.
This is "supposed" to be temporary so we can monitor some of the TTL, but we all know how that goes.
Most smaller ones can only deliver up to 2A. Of-course, you could simply get 2...
But that's not really recommended on those smart thingies.
I'll probably build one in that case
That's probably what I'd do too, if I knew for sure nobody else would touch it.
They won't, everyone else gave up and handed the problem to me lol
11:52 AM
You know how to calculate your own buck, right?
Yeah, I think I have all the parts on-hand as well
Q: Euler Project 14 Longest Collatz Sequence

johnashuI have been working through the weuler project and I have created the following code for number 14. It takes a good minute to process. Can I make it faster? class Collatz: def __init__(self): self.c = 1 def if_even(self, n): return int(n / 2) def if_odd(self, n):...

Another option, half the price of the Vicor.
Again @dasfafs, this is not codereview.stackexchange.com. To learn in the programming world, you first have to learn to read, and better understand what you read. — Jorge Fuentes González 55 secs ago
12:00 PM
@202_accepted This could work too.
why not post this on the CodeReview part of the platform? — Stultuske 57 secs ago
Meanwhile on SO:
All illegal next week.
Hi and welcome to Stack Overflow :). You might find help here: codereview.stackexchange.com. — CodeF0x 36 secs ago
It's probably not, since I'm asking about optimization of already-working code. I would have posted it to Code Review, but the odds of getting something useful there versus here were slim... Anyway, I'm basically doing a few transformations on a very large dataset (100,000,000 records), one-hot encoding categorical predictors, and then doing some aggregation and math (e.g. the average value for x over a given time interval) for many columns. I think the issue comes from the sheer amount of layers of computation added. This takes 3.5 hrs to sv to disk — blacksite 19 secs ago
@Mast Should I put a fuse before or after the conversion?
I'm thinking before
Definitely before.
And make it a fast one.
12:09 PM
Greetings, Programs.
Q: HTML Canvas drawing parallelogram

ApricotI am new to Javascript and Canvas of HTML5. I have to complete a project where I have to draw a parallelogram with three mouse clicks. Click 1: Starts the first line of the parallelogram. Click 2: Ends of the first line. Click 3: When the user drags the mouse up or down from the second click ...

700mA should be sufficient, and definitely a fast for sure
@Mast oh wow that's. ... the SO mods going to have a lot to do ...
@Vogel612 Considering such discussions are relatively common, yes.
Although the solution is relatively easy: nuke thread.
Everything is LQ anyway.
@CodeF0x With this lack of context, it's absolutely not welcome on Code Review. Please take a look at the guide to Code Review for SO users. — Mast 34 secs ago
12:14 PM
yeap. it's still a ton of work most likely
something something flag numbers
@Mast It's funny because our regulations talk about how I need a fuse, it should be no more than a specific percent larger than my load, talks about how fast it must blow for different wattages, but doesn't cover replaceability or where it must go...lol
Where I work, fuse means something else. :-)
Well, I guess technically it has a "form" of where to place it, as I only need to fuse the load and a voltage converter is defined as a "load-assisting device".
The Far Ultraviolet Spectroscopic Explorer (FUSE) is a space-based telescope operated by the Johns Hopkins University Applied Physics Laboratory. FUSE was launched on a Delta II rocket on 24 June 1999, as a part of NASA's Origins program. FUSE detected light in the far ultraviolet portion of the electromagnetic spectrum, between 90.5-119.5 nanometres, which is mostly unobservable by other telescopes. Its primary mission was to characterize universal deuterium in an effort to learn about the stellar processing times of deuterium left over from the Big Bang. FUSE resides in a low Earth orbi...
How is space, Don?
12:22 PM
Mostly empty.
Bummer. We're not colonized on Mars yet?
@202_accepted Unfortunately, no. Not that I would be going - I get claustrophobic and motion sickness.
@202_accepted Fairly easy though. A fuse allows every cable behind it to be of lesser thickness than before it.
@Donald.McLean I hear the internet speed over there isn't too great either.
@Mast For sure. I was planning on dropping one in, was just deciding how and reading the regs didn't help.
@Donald.McLean Bummer. I just bought a bunch of land on Mars
Q: Task running in background needs to be kept alive in C# and general things to do or avoid

LearnerIntent: Keep many 'Thingy's running in the background. The thingys subscribe to certain specific events, so they need to be kept alive (I think). Currently my code looks like this, roughly: internal sealed class Thingy { private readonly CancellationTokenSource cancellationTokenSource; ...

12:41 PM
@CaptainObvious Off-topic ATM, trying to convince OP to materialize some code to bring it on-topic.
@202_accepted Homebuilt is a violation anyway.
Unless you plan to write a CE statement and do some isolation tests on it.
@Mast Not according to the regulations I have. It's "discouraged", but if it meets certain specifications and tests it's acceptable.
@202_accepted Doesn't matter.
The moment they find water on Mars, the Dutch will colonize everything around it.
It's my land!
@202_accepted That's part of the unless a sentence later, yes.
@202_accepted Go sue us at the Martian Judge district.
12:44 PM
@Mast I am the Martian Judge district. ;)
Couple of years ago people got swindled by people selling plots on the Moon.
I own half of the moon already
@202_accepted You could even put a traditional fuse in front of it and a polyfuse right behind it.
1:18 PM
Q: Optimising SQL Query

Thomas AyoubLet's assume I've 3 tables on my database: BusinessObject and CustomEvent, and EventType. BusinessObject having a lot of columns, CustomEvent having the following: Id EventTypeId DateEvent CommentEvent UserId BusinessObjectId I want to get all the BusinessObject having two CustomEvent with Eve...

Q: Object Oriented Game Programming Board Class decision

to_dateI am writing an object oriented game for fun where players from two teams fight. I need to implement move function for players on a maze. Maze sohuld have location information with some features like height or type(hill, water etc.). So in order to implement location I have two ideas. First is th...

Q: Get a users nested group memberships w/o AD cmdlets

AdamarSo we have this customer that has a hybrid AD environment. They still have all their data on traditional network shares. But they are also moving all their users to AzureAD. Since the customer doesn't have the Azure AD Domain Services subscription, we needed to find another way to find out the g...

@CaptainObvious Still a little bit pseudo-, but far better than before. Thoughts?
Might be better to redirect that design question to softwareengineering.SE
1:35 PM
Q: Generic Producer-Consumer in C++11

AlexI wrote the following simple 1 producer - 1 consumer problem, in attempt to learn some C++11 threading / generics. #include <iostream> #include <mutex> #include <condition_variable> #include <deque> #include <thread> struct data { int x, y; std::string s; data() : s("test") { ...

@202_accepted Meh, IMO it's still off.
@Donald.McLean Astronomers and their techs (and plenty other agencies) have been known to create acronyms just for the sake of it. It's a sport.
For example:
ANTARES is the name of a neutrino detector residing 2.5 km under the Mediterranean Sea off the coast of Toulon, France. It is designed to be used as a directional neutrino telescope to locate and observe neutrino flux from cosmic origins in the direction of the Southern Hemisphere of the Earth, a complement to the South Pole neutrino detector IceCube that detects neutrinos from both hemispheres. The name comes from Astronomy with a Neutrino Telescope and Abyss environmental RESearch project; the acronym is also the name of the prominent star Antares. Other neutrino telescopes designed for use...
@PStarczewski You're welcome, but I think it's all moot anyway. Your question would actually be better suited on codereview.stackexchange.comArcher 21 secs ago
The Cosmic Evolution Survey (COSMOS) is a Hubble Space Telescope (HST) Treasury Project to survey a two square degree equatorial field with the Advanced Camera for Surveys (ACS). The largest survey ever undertaken by HST, the project incorporates commitments from observatories around the world, such as the Very Large Array radio observatory, the European Space Agency's XMM-Newton satellite, and Japan's eight meter Subaru telescope. At the moment, more than 150 astronomers around the world actively contribute to the project. The project's primary goal is to study the relationship between large scale...
IMAGE (Imager for Magnetopause-to-Aurora Global Exploration) is a NASA Medium Explorers mission that studied the global response of the Earth's magnetosphere to changes in the solar wind. It was launched 25 March 2000 by a Delta II rocket from Vandenberg AFB on a two-year mission. Almost six years later, it unexpectedly ceased operations in December 2005 during its extended mission and was declared lost. The spacecraft was part of NASA's Sun-Earth Connections Program, and during its run had over 400 research articles published in peer-reviewed journals using its data. It had special cameras that...
The Multi-Element Radio Linked Interferometer Network (MERLIN) is an interferometer array of radio telescopes spread across England. The array is run from Jodrell Bank Observatory in Cheshire by the University of Manchester on behalf of Science and Technology Facilities Council (STFC) as a National Facility.The array consists of up to seven radio telescopes and includes the Lovell Telescope, Mark II, Cambridge, Defford, Knockin, Darnhall and Pickmere (previously known as Tabley). The longest baseline is therefore 217 km and MERLIN can operate at frequencies between 151 MHz and 24 GHz. At a wavelength...
Of-course, there's also PAMELA, RAMBO, SOFIA, STEREO, MARVEL, and lots others.
1:52 PM
This sounds like a question better suited for code review. — Quentin 46 secs ago
@Duga Retracted already.
You should try in another stack exchange site like code reviewThomas Sablik 58 secs ago
It feels like you have working code. If you are seeking refinement advice, perhaps migrate to CodeReview. — mickmackusa 51 secs ago

« first day (1903 days earlier)