find

find({}) returns an empty array mongoose

依然范特西╮ 提交于 2021-02-11 06:56:10
问题 Here is my code in model.js file: const mongoose = require("mongoose"); const con = require("./connection"); con(); const schoolNotices = mongoose.model("schoolNotices", { title:{ type: String }, date:{ type:String }, details:{ type:String } }); module.exports = schoolNotices; And I have imported this code into students.js file router.route("/notices") .get((req,res)=>{ schoolNotices.find({},(err,docs)=>{ if(err){ return console.log(err) } res.render("studentNotices",{title:"Notices",data

Copying Data From Word Document Using Excel VBA

白昼怎懂夜的黑 提交于 2021-02-10 18:40:59
问题 I have an excel file that that has a filename of a word document. I want to use excel vba to open the word document, then search for a specific phrase, copy the characters following that phrase, and paste it back into the original excel file. I have attempted several ways to implement this design, with little success. Below is my most recent attempt. My main issue is that the program usually just stops when it hits my with statement. Why does that happen, and how do I fix things so that the

Clearcase finding a specific file on any branch

谁说胖子不能爱 提交于 2021-02-08 07:54:47
问题 Our clearcase installation has multiple branches covering many years of development. I'm trying to search for a specific file (or part file name) and it could be on a branch that has never been merged back to the integration or MAIN branch. Branch structure can be main/branch1 and also main/integration/branch2 Any thing i've seen on cleartool find needs a view but i've not be able to get a catch all config spec. Any suggestions. Thanks 回答1: The cleartool find command does not depend always on

Clearcase finding a specific file on any branch

試著忘記壹切 提交于 2021-02-08 07:54:38
问题 Our clearcase installation has multiple branches covering many years of development. I'm trying to search for a specific file (or part file name) and it could be on a branch that has never been merged back to the integration or MAIN branch. Branch structure can be main/branch1 and also main/integration/branch2 Any thing i've seen on cleartool find needs a view but i've not be able to get a catch all config spec. Any suggestions. Thanks 回答1: The cleartool find command does not depend always on

Regex Find Spaces between single qoutes and replace with underscore

老子叫甜甜 提交于 2021-02-07 14:28:29
问题 I have a database table that I have exported. I need to replace the image file name with a space and would like to use notepad++ and regex to do so. I have: 'data/green tea powder.jpg' 'data/prod_img/lumina herbal shampoo.JPG' 'data/ALL GREEN HERBS.jpeg' 'data/prod_img/PSORIASIS KIT (640x530) (2).jpg' and need to make them look like this: 'data/green_tea_powder.jpg' 'data/prod_img/lumina_herbal_shampoo.JPG' 'data/ALL_GREEN_HERBS.jpeg' 'data/prod_img/PSORIASIS_KIT_(640x530)_(2).jpg' I just

Search image for color. Return X, Y

帅比萌擦擦* 提交于 2021-02-07 10:01:59
问题 I've been looking all over for a way to find a specific color in a image (screen capture), and return the the position of of the color (x,y). I've had some tries, but not managed to do a proper search. The result should be the first pixel found with that color. I tought maybe PIL will be to any help. So I tried something like this, problem now is that it returns EVERY position, found with that color: Fixed: def FindColor(r,g,b): image = ImageGrab.grab() for x in range(1, 400): for y in range

Run shell script for every file in directory

◇◆丶佛笑我妖孽 提交于 2021-02-07 07:14:57
问题 I have a bunch of files in a directory all named YYYY_MM_DD -rw-r--r-- 1 root root 480K Apr 21 13:17 2012_04_05 -rw-r--r-- 1 root root 483K Apr 21 13:17 2012_04_06 -rw-r--r-- 1 root root 484K Apr 21 13:17 2012_04_07 -rw-r--r-- 1 root root 480K Apr 21 13:17 2012_04_08 -rw-r--r-- 1 root root 344K Apr 21 13:17 2012_04_09 -rw-r--r-- 1 root root 66K Apr 21 13:17 2012_04_10 -rw-r--r-- 1 root root 461K Apr 21 13:17 2012_04_11 -rw-r--r-- 1 root root 475K Apr 21 15:09 2012_04_17 -rw-r--r-- 1 root root

Run shell script for every file in directory

ぐ巨炮叔叔 提交于 2021-02-07 07:14:05
问题 I have a bunch of files in a directory all named YYYY_MM_DD -rw-r--r-- 1 root root 480K Apr 21 13:17 2012_04_05 -rw-r--r-- 1 root root 483K Apr 21 13:17 2012_04_06 -rw-r--r-- 1 root root 484K Apr 21 13:17 2012_04_07 -rw-r--r-- 1 root root 480K Apr 21 13:17 2012_04_08 -rw-r--r-- 1 root root 344K Apr 21 13:17 2012_04_09 -rw-r--r-- 1 root root 66K Apr 21 13:17 2012_04_10 -rw-r--r-- 1 root root 461K Apr 21 13:17 2012_04_11 -rw-r--r-- 1 root root 475K Apr 21 15:09 2012_04_17 -rw-r--r-- 1 root root

'find' using regex with variables

半城伤御伤魂 提交于 2021-02-07 04:17:04
问题 Please, help me with the following: Let it be three files: file-aaa.sh file-bbb.sh file-xxx.sh In a bash script I have variables $a=aaa $b=bbb Now, I want to execute something like: find . -name "file-[$a|$b].sh" and expect to get two files in output. What am I doing wrong? 回答1: You can use this find: find . -name "file-$a.sh" -o -name "file-$b.sh" To combine it into one using -regex option: On OSX: find -E . -regex ".*file-($a|$b)\.txt" On Linux: find . -regextype posix-extended -regex ".

'find' using regex with variables

情到浓时终转凉″ 提交于 2021-02-07 04:16:23
问题 Please, help me with the following: Let it be three files: file-aaa.sh file-bbb.sh file-xxx.sh In a bash script I have variables $a=aaa $b=bbb Now, I want to execute something like: find . -name "file-[$a|$b].sh" and expect to get two files in output. What am I doing wrong? 回答1: You can use this find: find . -name "file-$a.sh" -o -name "file-$b.sh" To combine it into one using -regex option: On OSX: find -E . -regex ".*file-($a|$b)\.txt" On Linux: find . -regextype posix-extended -regex ".