Sanitizing strings to make them URL and filename safe?

I am trying to come up with a function that does a good job of sanitizing certain strings so that they are safe to use in the URL (like a post slug) and also safe to use as file names. For...

C++ heap sort of vector<string,int>

I can not figure out where I'm having my problem with my heap sort. The program takes a filename from the command line, imports the words into a vector then that vector is turned into a vector...

How to automatically rename files while unzipping from dired-mode on OSX

I would like to automatically rename files (if they already exist in the destination directory) while unzipping archives from dired-mode on OSX (10.6.8 Snow Leopard). Is there a way to feed unzip...

Unzipping a password protected file in Node.js

Is there a library that I can use to unzip a password protected file (Site makes me put a password on the file when downloading it)? There are a ton of libraries to unzip normal files, but none...

VBA: Find whether there is common pattern between the email subject and attachment name

I want to validate that the outgoing email is correctly attached with a correct file. The email subject contains a code. The attachment filename is automatically generated with a code and attached...

How to bulk rename files in PowerShell?

I have a folder with 100+ files, and all of them have a common format, namely one string, followed by 4-digit number specifying year, and then at the end just a single lowercase letter. For...

making values in list of dictionaries lowercase in python

Picture of fileSo, I'm making this program where you take a file and break it down and take out specific parts that you need and add those values to a dictionary and then append that dictionary...

Word Counting Program C++

I'm currently trying to program a word counting program in C++ and am running into difficulties getting it to parse through a string and separate words from one another. In addition to this I am...

removing duplicates from n grams in rows python

This code produces n-grams and the number of counts the n gram appears. I have a csv file with rows and a column containing string of words for every row. This code for example when it searches...

Error executing SQL command against pandas dataframe

I am following the Udacity data Science into course and my solution was exactly the one they provided import pandas import pandasql def select_first_50(filename): # Read in our aadhaar_data...

How to have "dashes" in filenames in ZendFramework 1.12

I have seen a few posts regarding this question but none were answered to the topic on which they were asked. I have a ZendFramework project (v 1.12) and I want to do some changes in the file...

terminate called after throwing an instance of 'std::out_of_range' - Should be easy to resolve

For my introductory C++ class I was tasked with completing this program, which uses file I/O to encode and decrypt text using a cypher. Most of the function definitions were written by me while...

Heroku node deployment doesn't respect file name changes

I changed the filename of one of my routes from authroutes to authRoutes. When I commit the changes and deploy to heroku, the build fails because it is still looking for...

How to upload image immediately after file is selected, rather than force user to click separate "Upload" button?

I have an image upload form where you click "Choose Image" and it brings up the file selection window. You choose an image and then the filename appears on the screen (not the image yet, just the...

What is wrong with my Model and Interface? (Java Spring Boot webapp)

I have an error during running that says (with full directories omitted for brevity: Error creating bean with name 'idea_Service' defined in...

Configuring Sass Lint for BEM

So i'm moving to writing my sass to the BEM convention. I've used the sass-lint configuration generator to create my config and only edited the class-name-format's - convention: to strictbem...

Replacing invalid characters in the filename with dashes using AppleScript

My goal is to create service in Automator using AppleScript or Javascript which replaces all invalid characters of selected filename ()[\\/:"*?<>|]+_ and spaces with dashes (-) and make filename lowercase.

bison parser gives error at the end of input

i am new to flex & bison,i am following a tutorial to help convert a parser written in c to c++.however,after i follow this tutorial,my parser didn't work. reading from file is fine,but reading...

How to pass filenames from "find" to "tr"?

I am trying to learn how a couple of commands works and I want to make a simple script that will change uppercase letters in file names to lowercase. I created that script: find * -exec bash -c \ ...

Bash Scripting Ignore blank lines + comments in a passed through file

#!/bin/bash set -o nounset ############################################################## # ASSIGNMENT DUE NOV m19/t20 # Allow for blank lines in the file # Allow for comments in the file that...

Regex which changes first letter of filename to lowercase in sublime text 3 snippet

I'd like to create following react snippet for stateless component. import React from 'react'; const fileName= (props) => { } export default fileName; so far I have following <snippet> ...

Face Recognition with OpenCv, NDK and Android

I was trying to run this code to take a photo and recognize tho photo owner, at first the user clicks the button Train and takes a picture than enter its name, after that he clicks on Recognize...

Refresh twitter bootstrap form wizards after submit

I need to refresh a form wizard after submit to avoid page reload. I'm using the plugin twitter bootstrap form wizard http://vinceg.github.io/twitter-bootstrap-wizard/ So far I've tried with...

Issue integrating Firebase Cloud Functions

I want to use Firebase Cloud Functions in my APP. So for that I have installed "node-v6.17.1.pkg" from official site. After installing I run "npm install -g firebase-tools" that brought...

"yarn list" lists stuff I haven't installed

I see this on two different machines. When I navigate to the folder that contains my package.json file and execute the command yarn list, it lists a bunch of packages that I haven't installed. If...

How do I count a specific character that is surrounded by random letters

I'm trying to count punctuations that are: apostrophe (') and hyphen (-) using dictionaries. I want to see if I can pull this off using list/dictionary/for loops and boolean expressions. These...

Converting list to dictionary, and tokenizing the key values - possible?

So basically I have a folder of files I'm opening and reading into python. I want to search these files and count the keywords in each file, to make a dataframe like the attached image. I have...

Keras: multi class imbalanced data classification is overfitting

I have a small dataset of ~1000 rows with two categorical columns [Message], [Intent]. I want to create a classification model and make predictions for new, unseen messages. The 29 unique intents...

How to make Linux Docker image filesystems case insensitive?

I have a Docker image for cross compilation from Linux to Windows with Mingw-w64. A common issue is that source code and build scrips do not refer in lowercase to filenames. (windows.h/Windows.h,...

R Shiny error - how to download uploaded file after transformation

I would like to be able to upload a dataset, select a set of columns, transform the selected columns (i.e. apply a function), then download the modified file. I have been trying to do so with the...

Relevant tags