I am new to quant. finance and trying to calculate trend, momentum, correlation and volatility. Below are the functions I have created
import pandas as pd
def roll_correlation(first_df, second_df, rolling_period):
"""
Rolling correlation
"""
return first_df.rolling(rolling_perio...
I created wordpress template and i want to add this css code only in to inside of this template only.for the security concern should i escape?. can anyone help me to solve this?. here is the code i used.
<?php
$style = "<style type='text/css'> .post-related {position: relative; width: 21.3...
"does it seem like I'm doing any of this correctly" SO isn't really a code review site. People are happy to help if you ask a good question. As for your error. You can't select a cell on a sheet that isn't active. So if you add the line Sheets("raw list of dates off").Activate before trying to Select the cell that error should go away. — Bee_Riii35 secs ago
My code in Julia, almost identical as the Python code (see below), runs in 4.6 s while the Python version runs in 2.4 s. Obviously there is a lot or room for improvement.
function Problem12()
#=
The sequence of triangle numbers is generated by adding the natural
numbers. So the 7th t...
I am completely new to JavaScript and I will be grateful for your comments on my Electron app (electron is a JS framework allowing to create of desktop apps).
I needed to create an application that stores a small database and allows me to do simple operations on the data. I just include a small f...
Recently I was assigned a URL shortener design problem while interviewing with a well known organization. Here is the exact problem statement:
Build a simple URL shortener service that will accept a URL as an argument over a REST API and return a shortened URL as a result.
The URL and shortene...
@user If you skip that requirement, you could also do something similar to that other question that I linked to. Although with the number of properties you have, that might be a bunch.... but that can of course be fixed by more encapsulation.
This might be me being thick but I cannot work out how your results are expected. You said I need to output an array of objects where only the best prices are kept. - how do you define "best prices"? Also for working code Code Review(codereview.stackexchange.com) is often better — Jamiec35 secs ago
I wrote the below as a solution to:
Problem
Find the highest product of three numbers in a list
Constraints
Is the input a list of integers?
Yes
Can we get negative inputs?
Yes
Can there be duplicate entries in the input?
Yes
Will there always be at least three integers?
No
Can we as...
I am working with C#, Dapper, EF Core and Postgres.
I defined an endpoint for a paginated search, where the filters and orderBy column are dynamic. The endpoint accepts a PaginationOptions instance:
public class PaginationOptions
{
public int Page { get; set; }
public int ItemsPerPage { g...
This is a fairly ill-fitting question for code review, since you seem to be primarily interested in a review of the API of your library. The code of that library is not included in the question and therefore not reviewable. While I can understand the desire to create a nice and idiomatic API, Code Review really wants to be much more than just API review... — Vogel612just now
I completed the following question but it seems a lot of space complexity.
Do you think is there a way to complete it with graph search or so ?
Thanks for the comments?
Suppose we have some input data describing a graph of relationships between parents and children over multiple generations. The ...
Say we have two operations that make http requests.
public async Task<(bool success, OperationOneResult result)> OperationOneAsync()
{
try
{
var response = await _httpClient.GetAsync("urlOne");
if (response.IsSuccessStatusCode)
{
var result = await resp...
If you can, could you create a runnable code snippet for a minimal, reproducible code example? The code you provided is too lengthy. Also, your question might be more suitable for codereview.stackexchange.com. — PIG20840 secs ago
If you have some specific issue, we can help with that, but if you just want someone to review your code, please post it over at Code Review instead. — Magnus Eriksson52 secs ago
This post in the CV querue with 2 CNW votes is tagged with angular.jsdjango and ngninx but the only "code" is the nginx configuration... should it be closed for AoC (since there isn't really code to review (unless the OP wants configration reviewed))?
I've put together an example single file upload script that attempts to cover all the things PHP could check for prior to allowing a successful file upload. Is there anything else maybe now available in PHP 7.4+ I could use to make this more secure? For example, I use filter_input below even thou...
@Peilonrayz okay that answers part of my questions, though in your statement "we have the code" - is that "we" as in reviewers? if so, "we" have no code other than the nginx configuration...
@Peilonrayz so at this point I'm wondering: does the nginx configuration count as "code", to the extent that a reviewer could use that for a review? given "Is code included directly in my question? It is fine to post supplementary code on a third-party site, but the most important parts of the code must be embedded directly in the question."
A question asks to have a Samba configuration file reviewed. Do we consider a configuration file to be code? It's certainly not a Turing-complete language. Is Turing completeness a defining criterion?
Note that we can address many of our usual concerns, such as security, correctness in unexpect...
I don't participate there myself, but Code Review is a thing that exists, if what you're looking for is advice and feedback on working code. — Charles Duffy5 secs ago
def bla(m,n):
return[b for a in range(1,m + 1) if a % 3 == 0 for b in range(1,n + 1) if b % 2 == 0]
print(bla(9,10)) --> [3,9,2,4,6,8,10]
hey im stuck how can I get both a and b outputs and not only the b output?
Coming from a Java/Scala background with a strong focus on OOP+FP, I recently started working with Excel+VBA to implement a front-end for a SaaS. It was like stepping way back in time, over two decades, in software engineering trying to understand how to use and exploit VBA.
In the ensuing 3 mont...
I've built the below Merkle Tree. It queries the bitcoin blockchain and builds a merkle tree out of the transactions. I want to add a proof of inclusion that can recurse through the classes and I'm just stuck, is there a cleaner way to build the merkle tree and then recurse through it?
I've start...
AFAIK, There aren't any fixes. All objects of a class type have access to each others stuff. You would need to establish code review to make sure that you access everything via getter and setters. Or you can make each object a unique type, then they wont have access. — NathanOliver27 secs ago
This nice hack should allow you to split a tuple into N-element tuples, thereby effectively splitting a tuple into pairs, triples, ... For example, this allows you to split an input parameter pack, into N-element tuples. Your thoughts?
template <std::size_t N>
constexpr auto split(auto&& t) noexc...
I have made a thread art generator that creates thread patterns from images. Mine is a bit different as it outputs an embroidery file (It embroiders quite nice, though the settings need a lot of tweaking and the output file needs resizing) The code is quite inefficient, but that's python for you....
@SimonForsberg Nah, the bug is in my room. 8 of the bloody things D:< Manage to kill off 5, now the other 3 seem to have got the idea to leave me alone
@SimonForsberg I remember Flowers for Algernon was a good one, though it depends on your tastes
@user There's only two of us actually working on the code right now, and my partner's afraid we'll scare away new members if they see that complicated Kotlin code (I disagree that it's that complicated, but Java is somewhat more regular than Kotlin, and we'd have to teach it to most new members)
@user I did not know that was a short story. I'm willing to give it a shot. (I have read a lot of IMO bad short stories as well btw)
(Although I'm not sure "The Egg" by Clarice Lispector can be considered a short story, it's more of a rant, but that one is the absolute worst I've ever read)
But ironically, "The Egg" by Dino Buzzatti is my absolute favorite of the ones I've read.
I have written a cryptographic hashing class named Ccksum::DigestHasher that allows the caller to select a hashing algorithm by name via OpenSSL's EVP interface. This class is the bread and butter of my Ccksum programming project. Here is the code so far (I combined the header and source files fo...