I have forked a greasemonkey script and want it to auto update on version change like the original and have edited the
#updateURL
and
#downloadURL
options to point to the correct files but for whatever reason the script will not update when i push an updated build with an incremented version number.
my meta.js
// ==UserScript==
// #name 4chan X with translator
// #version 1.13.6.1
// #minGMVer 1.14
// #minFFVer 26
// #namespace 4chan-X
// #description Cross-browser userscript for maximum lurking on 4chan.
// #license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE
// #include http://boards.4chan.org/*
// #include https://boards.4chan.org/*
// #include http://sys.4chan.org/*
// #include https://sys.4chan.org/*
// #include http://www.4chan.org/*
// #include https://www.4chan.org/*
// #include http://i.4cdn.org/*
// #include https://i.4cdn.org/*
// #include http://is.4chan.org/*
// #include https://is.4chan.org/*
// #include http://is2.4chan.org/*
// #include https://is2.4chan.org/*
// #include https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// #include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// #include https://www.google.com/recaptcha/api2/frame?*&k=887877714&*
// #include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// #include https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// #exclude http://www.4chan.org/pass
// #exclude https://www.4chan.org/pass
// #exclude http://www.4chan.org/pass?*
// #exclude https://www.4chan.org/pass?*
// #exclude http://www.4chan.org/advertise
// #exclude https://www.4chan.org/advertise
// #exclude http://www.4chan.org/advertise?*
// #exclude https://www.4chan.org/advertise?*
// #exclude http://www.4chan.org/donate
// #exclude https://www.4chan.org/donate
// #exclude http://www.4chan.org/donate?*
// #exclude https://www.4chan.org/donate?*
// #connect 4chan.org
// #connect 4cdn.org
// #connect *
// #grant GM_getValue
// #grant GM_setValue
// #grant GM_deleteValue
// #grant GM_listValues
// #grant GM_addValueChangeListener
// #grant GM_openInTab
// #grant GM_xmlhttpRequest
// #run-at document-start
// #updateURL https://translate.ss13.moe/4chan-X.meta.js
// #downloadURL https://translate.ss13.moe/4chan-X.user.js
// #icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII=
// ==/UserScript==
Two update attributes, i.e. #updateURL and #downloadURL, are not supported in GreaseMonkey 4.0+ which is around the time when this question was posted. If you are facing the same problem just use TamperMonkey instead.
Related
Some examples online is using the function 'sigpending' to query the blocked signals which are pending.
Syntax is int sigpending( sigset_t *set );
but this function is not found in kernel headers, this function is replaced or removed in latest kernels?
Sample code:
#include <signal.h>
#include <stddef.h>
sigset_t base_mask, waiting_mask;
sigemptyset (&base_mask);
sigaddset (&base_mask, SIGINT);
sigaddset (&base_mask, SIGTSTP);
/* Block user interrupts while doing other processing. */
sigprocmask (SIG_SETMASK, &base_mask, NULL);
…
/* After a while, check to see whether any signals are pending. */
sigpending (&waiting_mask);
if (sigismember (&waiting_mask, SIGINT)) {
/* User has tried to kill the process. */
}
else if (sigismember (&waiting_mask, SIGTSTP)) {
/* User has tried to stop the process. */
}
When compiling the code, getting the below error:
error: implicit declaration of function ‘sigpending’; did you mean ‘signal_pending’? [-Werror=implicit-function-declaration]
In the book Operating System Concepts, it designs a kernel module, the module seems to create an additional entry named hello in the /proc file system in Linux, the module code is shown below, then it uses cat /proc/hello command, it says "Each time the /proc/hello file is read, the proc_read() function is called repeatedly until it returns 0", I can't understand why proc_read() is called repeatedly, also I don't know who is the caller of the function proc_read().
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <asm/uaccess.h>
#define BUFFER_SIZE 128
#define PROC_NAME "hello"
ssize_t proc_read(struct file *file, char _user *usr_buf, size_t count, loff_t *pos);
static struct file_operations proc_ops = {
.owner = THIS MODULE,
.read = proc_read,
};
/* This function is called when the module is loaded. */
int proc_init(void)
{
/* creates the /proc/hello entry */
proc_create(PROC_NAME, 0666, NULL, &proc_ops);
return 0;
}
/* This function is called when the module is removed. */
void proc_exit(void)
{
/* removes the /proc/hello entry */
remove_proc_entry(PROC_NAME, NULL);
}
I've created a VS2010 C++ empty solution with this code below:
#include "conmat.h"
#include "resource.h"
#include <iostream>
#include <afxwin.h>
#include <atlimage.h>
void main(){
CImage bmp;
bmp.LoadFromResource(AfxGetInstanceHandle(),RES_BMP);
std::cout << GetLastError() << std::endl;
system("pause");
}
I added a BMP file as a resource. Why is it not working?
here is conmat.rc file, that must contain (in my mind) bitmap picture created in paint
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Русский (Россия) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
RES_BMP BITMAP "in.bmp"
#endif // Русский (Россия) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
Try using GetModuleHandle(NULL) instead of AfxGetInstanceHandle().
I am trying to process many picture's at a time and then make all to equal size
Mat pic = imread ("C:\\Pick");
for (int i=0;i<10;i++)
{
imshow("mainwin" , pick);
resize (pick,re_pic,size(150,100));
}
Pick is a folder which contain 10 different picture's
You can get list of images in directory and then process them.
#include <vector>
#include <stdio.h>
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
//----------------------------------------------------------------------
// Get list of files
// Usage:
// string ImagesDir=tmp+"C:\\Images\\*.jpg";
// vector<string> files=listFilesInDirectory(ImagesDir);
//----------------------------------------------------------------------
vector<string> listFilesInDirectory(string directoryName)
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(directoryName.c_str(), &FindFileData);
vector<string> listFileNames;
listFileNames.push_back(FindFileData.cFileName);
while (FindNextFile(hFind, &FindFileData))
listFileNames.push_back(FindFileData.cFileName);
return listFileNames;
}
...
// somewhere in main
string YourImagesDirectory="C:\\Pick\\";
vector<string> files=listFilesInDirectory(YourImagesDirectory+"*.jpg");
for(int i=0;i<files.size();i++)
{
Mat img=imread(YourImagesDirectory+files[i]);
imshow("mainwin" , img);
...
}
...
I have a UserScript which should remove all images of a certain class on the first mousemove-event.
Being pretty new in writing Greasemonkey-scripts, okay this is my first script, I think there is just something small missing.
// ==UserScript==
// #name aname
// #namespace anamespace
// #description adescription
// #include http://www.google.com/search*
// #include http://www.google.com/webhp*
// #include http://www.google.com/#*
// #include http://www.google.com/
// ==/UserScript==
var removeTags = function () {
var allHTMLTags = window.document.getElementsByTagName("*");
for (i=0; i < allHTMLTags.length; i++) {
if (allHTMLTags[i].className == "l sb-l") {
allHTMLTags[i].style.display='none';
}
}
};
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = removeTags;
Thanks for your help!
Try addEventListener
window.addEventListener('mousemove',removeTags,false);