This code unzips the downloaded subtitle file(s) and maps them to their corresponding video file. Concretely, after pairing video files with their corresponding subtitle files, it links them by renaming the subtitle file to the same file name as that of its corresponding video file.
#!/usr/bin/en...
I need to identify the different markdown files I have so I can create a unique url structure for them. I can already identify "notes" files, and want to create a second type called "projects".
My gatsby-node.js file looks like this right now
const path = require('path');
const { createFilePath }...
I have a method checkUser() error that can generate errors in about 100 different ways as it calls many systems etc, Each time an error occurs, I want to log the error. Should I log the error at the top level, requiring only one log call, or should i log each error where it occurs? When I log the...
dict = {}
tag = ""
with open('/storage/emulated/0/Download/sequence.fasta.txt','r') as sequence:
seq = sequence.readlines()
for line in seq:
if line.startswith(">"):
tag = line.replace("\n", "")
else:
seq = "".join(seq[1:])
dict[tag] = s...
Hey I'm trying to show a row of values from Google Sheet when the user input a specific code number. But the web app shows the letter 'U' 'n' 'a' from the word 'Unavailable' that returned from the .gs code to each of the table column. Is there anything i did wrongly? Your response would be very a...
I've created a bit of a script that allows me to use data stored in a Google Sheet to generate a set of Google Slides (based on a pre-formatted template slide).
PreviousTarget and CurrentTarget in the script below reference cells that are formatted as Date cells within Google Sheets. The format ...
Submitting for expert review. Refer YouTube video
Paste this code in excel VBE Chart(Sheet) object.
Code works fine. I was wondering if we can avoid deletion and addition of lines with every mouse move. I tried adding lines on chart activate event and then allign those lines using module level va...
@Duga More or less by request of the author of the only answer.
shrug
@CaptainObvious OT
@CaptainObvious OT
I’m voting to close this question because it is of to low quality. — Willeke ♦Jun 17 at 4:12
Talk about vague close reasons.
Getting banned for low-quality contributions is a thing, so it makes sense when relating to the offence. But I thought we weren't supposed to use it as a close reason. Things like that really make you think about the how and why of user interactions.
I need to extract all member accesses to expression parameter (and make sure, that they are not nested). For instance, for expression: a => a.A + a.B I need to receive list {"A", "B"}. For expression a => a.B.C exception should be thrown, as we have nested member access.
I wrote the following cla...
I'm new to Javascript and Web Dev in general, so they'll likely be some conventions that I'm not aware of.
I'm at an odds of whether to use Javascript's functional features more. In my opinion it's easier to read Java-like imperative code than the concise functional features that I see JS program...
@SᴀᴍOnᴇᴌᴀ random.choices is, AFAIK, not that unbiased. So a quicksort that should have only have a depth of ~20 that exceeds 1000 seems a bit fishy. But it's a scale problem which is on-topic. The user can just use sys.setrecursionlimit(1_000_000_000) and it'll work fine.
I have a dataframe like so:
id variable value
1 x 5
1 y 5
2 x 7
2 y 7
Now for every row, I want to add a calculated row. This is what I am doing as of now:
a = 2
b = 5
c = 1
d = 3
df2 = pd.DataFrame(columns = ["id", "variable", "value"])
for ind...
I have a large image and I want to extract and process tiles (subregions of it, of size 256x256) in batches of given size (usually a power of 2, but 3 in this example).
For this example, I want to have batches of size 3 and number of tiles per cols is 3 and number of tiles per rows is 5.
Is it P...
Is it possible to filter useractions on rollbacks-only? On https://codereview.stackexchange.com/users/<uid>/<uname??tab=activity&sort=revisions, to only return everything "rolled back to a previous revision"?
Problem
For given list of words check if all the words can be arrange to form a chain. Any word can be linked to the next if the last char matches with the first character of the another Word. For eg . [hello, org, games, salvin] is valid chain.
Code
import java.util.*;
import java.util.stream....
Does it do what it is supposed to do? If no, then edit the question and specify the exact problem you need help with. If yes, then delete this question and post on on codereview.stackexchange.com. General code review questions are off-topic here. — sticky bit40 secs ago
Does encodeForLDAP method is currently recommended for prevent LDAP Injection?
Here is its implementaion:
public String encodeForLDAP(String input, boolean encodeWildcards) {
if( input == null ) {
return null;
}
// TODO: replace with LDAP c...
For many people discussion of content management systems raises unpleasant specters of the early 2000s. But while CMS platforms may not feel like the shiniest new tech on the block, they still have a lot to offer, and they’ve evolved in ways that might surprise you. Let’s talk about Drupal, a 20 year old open source project that still manages to be on the leading edge of the CMS world.
As I understand the question is off-topic here as the code is working but it could be on-topic in Code Review. — Rubén16 secs ago
Usually this is solved with code review, which is a good practice anyway. There are many unacceptable types of code (disabling tests, malicious code, slow code) that you'd want to catch with a code review, and this is just one of them. — bk220432 secs ago
I'm not sure if I'm even approaching this correctly (still very much learning), but this is what I'm attempting to accomplish:
My script gets an array from a column (tab names of the sheet) and then calls another function to copy those tabs (this part works fine). What I'm attempting to add is a...
I'm working on an app in Angular 8+.
I decided to use a simple rxjs store for some simple state management.
https://georgebyte.com/state-management-in-angular-with-observable-store-services/
I have read an article here about how getters and setters could make my code cleaner and easier:
https://d...
I have a query that outputs a list of products along some other fields from other tables. That query works fine...
Now, I'm attempting to retrieve the available stock for each product in that list. I'm not sure if I'm doing it correctly and/or the most performant way. Here's what I've got so far ...
I have a signal where I would like to implement a peak detection algorithm where it only collects peaks that follow exponential decay behaviour and stop at a certain height. Here is an example of a signal that I am dealing with
I would like the detection to implement similar to the question in t...
@CaptainObvious I didn't study Elec. Eng. but my friends did and they told me about a professor who acted out "under-damped" and "over-damped" in a dramatic way
I have an Excel spreadsheet where users can batch-enter records and load them into an external system (via HTTP).
This is what the VBA in the spreadsheet does:
A custom function concatenates the columns that contain parameters into the Concatenated Variables column.
Loops through each row in t...
Our testing suite is configured using a type of hierarchical config file similar to .ini or .toml files. Each 'block' is a test that is run on our cluster. I'm working on adding unique ids to each test that will help map results to tests over time. A small example of a config file would be:
[Test...
I have a macro that works through my Raw_Data spreadsheet, compares two rows from column B, ensureing the values match, then if they do, does a simple subtraction from column c and puts that value in column j. Here's what the raw data looks like...
The number of rows for any particular country v...
@SᴀᴍOnᴇᴌᴀ Oh, no. I was saying some SO moderators use "Voting to close as off-topic because it should be posted on Code Review" as a close/migrate reason.
I needed a tool to monitor VM's running on my server in relatively real-time (similar to top or the many variants out there). The main things I need to keep track of are:
All VM's listed via virsh list --all;
Id Name State
--------------------------------------...
I'm posting my code for a LeetCode problem copied here. If you have time and would like to review, please do so. Thank you!
Problem
Given a positive integer n, return the number of all possible
attendance records with length n, which will be regarded as
rewardable. The answer may be very large, ...
This is a beginner's class. I just need help verifying if this code is correct, or edit the parts that need fixing.
n = int(input("Enter a number"))
sum = 0
for i in range(1,n+1):
sum = sum + i
print("The sum is:", sum)
This is an implementation of a 2D peak finder from MIT's Intro to Algos.
I'm a C beginner and I would really like some feedback on coding style, documentation and any other general C bad practices I might have committed.
I would also like to know if I correctly freed the memory of the recursive c...
So, I am playing with Unity/C#. I am very new to this, so feel free to point out my many mistakes below. I have a few resources: apples, oranges, lemons etc. I am collecting them fine in a dictionary. Then I wanted to write a method to display the collected resources in various UI text boxes with...
Since your code works, but you just want to make it better, you might want to try asking on Code Review Stack Exchange, which is more appropriate for these sort of questions. It's very easy to sign up, and you'll probably get better responses there. — userjust now
I'm studying and practicing in Python and this is my Rock-Paper-Scissors game I've done from scratch.
I'm saw in the tasks for beginners writing this game. In all the examples, I saw dozens of lines of code with if-elif-else statements.
I decided to write the shortest program for this game.
I'...
I'm new on sh and I would like to get feedbacks on how to improve this code.
The propose is simple:
I want to open the Jenkins JOB related to a service based on its possible aliases.
So if I map a service with its aliases
READ_JOB="rj readjob read-job"
I want to open it by calling the script
open...
I solved this problem statement on dear old codeforces.
The Problem Statement wants users to replace occurrences of '10' in the given string with either '1' or '0' until there is no occurrence of '10' left and the string formed is the lexicographically smallest string from the set of all valid an...
IIRC that's common in C#. Or I used to limit to 120 it when I did C# at least. But I've moved away since it doesn't play ball when you have two windows open side by side
I created an algorithm to create lists of anagrams
The input is ["eat", "tea", "tan", "ate", "nat", "bat"]
Then, the output should be:
[["eat","tea","ate"],["tan","nat"],["bat"]]
Each array is words that are anagram.
My solution is:
function group(input) {
let result = [];
if(input.length...
That being said, I guess you used `nano´ to work on the file and immediately test it on the server, right? Have you tried sshfs+PyCharm to work on the remote file with your local editor?
@DerKommissar That's a lot of unnecessary sudo. Apart from the installation, you don't need sudo for sshfs on Linux. Unless you don't own the mountpoint, of course.
You're on Stack Overflow and you've found a question that seems to be about improving code. You are trying to be helpful, and you put a comment in the question:
You should try asking on CodeReview.SE instead. —YourName 2 minutes ago
… and suddenly, out of nowhere CodeReview.SE users swoop i...
nah just joking... just no formal CS education... ive learned python and javascript/node through lots of trial and error lol... so my end results usually look like a catastrophe to actual software devs... but thats ok! good to know you guys are around
Also, research "Test Driven Development" and "Extreme programming" processes. Do your CNC machines need to pass any federal reviews or inspections? You may have to document your development process and retain any artifacts generated in the process (such as design reviews or code reviews). I also recommend researching coding standards and guidelines. Developing code is easy. Developing robust and correct software is more difficult. — Thomas Matthews20 secs ago
I am using Visual Studio Enterprise 2019 with nuget angularjs 1.79 package. The typescript is 3.8. I am attempting to compile the following typescript (.ts) code:
$startDate.on('changeDate', function (ev: any) {
modal.find('#edit-event-end-date').datepicker('setStartDate', moment["ignoreZone"...
I am trying to accomplish the above where I have to find the the largest connected component on the grid with same value. Allowed movements are in 4 directions horizontally or vertically only.
Here is the code that I attempted, however, I am not able to get the right breaking condition in the rec...
I think I'm done so I'll write it up now. But IDK if string.Formatter is that great here, it's made some of the stuff easier to work with tho. But I don't think there's enough to justify it with your code.
I have small question. I dont know much about JavaScript (jquery) or AJAX and I dont know, if I'm doing it safe from XSS Attacks, SQL injection and that stuff. I think the php with mysql would be written right. The code works. I will add it bellow. Thank you very much for you help.
This is php wi...