w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Get the line-number that throws the error in Tampermonkey?
The way I have my configurations, I see everything. Here is how: TamperMonkey Dashboard |> Settings Tab |> General |> Config mode: |> Select Advanced Debug scripts: |> Checked Logging level: |> Select Error (dealer's choice here, I chose this but you can decide)

Categories : Debugging

Using jQuery in Tampermonkey
EDIT: Since Greasemonkey 2.0 you do not (and cannot) use unsafeWindow.jQuery for getting the host page's instance of jQuery. You just use window.jQuery, and // @grant none (or @grant whatever other special APIs you need for non-jQuery things). Sources: https://github.com/greasemonkey/greasemonkey/issues/1952 http://www.greasespot.net/2014/06/greasemonkey-20-release.html Tampermonkey currently (Feb 2015) seems to work similarly by default settings: http://tampermonkey.net/faq.php#Q404 old outdated answer below: Add a directive // @grant unsafeWindow. Also, if you are getting your jQuery reference from the host window object, you won't need the @require line.

Categories : Jquery

Run function from Tampermonkey button
Not sure if you have found a solution to your problem yet, but after many hours of struggling to get a solution that: is easy enough for a beginner (me) portable between Tampermonkey and Greasemonkey and looks like something I might be able to do.... I got this working: function addBtn() { $("#quest_form").each( function () { $(this).before("<input type='button' value='Auto Grind' id='autoGrind'>"); $('autoGrind').click(autoGrind()); } ); } addBtn(); Just four notes regarding this solution: I custom made it for ME, so it might not work perfectly for you I'm VERY new to JS so if I used bad "grammar", I'm sorry. The .each won't be necessary, I had to add LOTS of buttons (removed the code dealing with their ID's

Categories : Javascript

Hiding content in Chrome settings using Tampermonkey
Update Support for Custom.css has been removed from Chrome in version 32. See this answer. User scripts can't access chrome: scheme. To hide 'Show' button in Chrome password manager, add this CSS code to User StyleSheetsCustom.css file in your profile folder. #password-manager .list-inline-button.custom-appearance { display: none; }

Categories : Javascript

Can latest Tampermonkey / Greasemonkey still not use jQuery AJAX?
jQuery AJAX works fine with Tampermonkey and Greasemonkey, with only one limitation compared to jQuery use in a web page. For example, this cross-origin script works in both Tampermonkey and Greasemonkey: // ==UserScript== // @name _Demonstrate jQuery AJAX from Tampermonkey // @include http://stackoverflow.com/questions/18546180/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work around a design change introduced in GM 1.0. It restores the sandbox. */ $.ajax ( { type: 'GET', url: 'https://api.stackexchange.com/2.1/users/621338?site=stackoverflow&filter=!)2R0ltXnW6.fyPDiHJm', dataType: 'JSON', success: function (apiJson) {

Categories : Jquery

Tampermonkey's GM_xmlhttpRequest not implementing 'context' property?
Update: Tampermonkey now reports that this feature is fixed as of version 3.8.4116 (in beta at the moment). See: The bug report The change log Older/generic workaround: The context property is a relatively new feature of GM_xmlhttpRequest(), in Firefox. I doubt it's been implemented in Tampermonkey yet; see Tampermonkey's docs for GM_xmlhttpRequest(). Meanwhile, the tried-and-true method for this kind of thing is to use a closure. Change your GM_xmlhttpRequest() call to something like: ( function (flair_index, flair_text, encoded_name, profile_url, query_url) { GM_xmlhttpRequest ( { method: 'GET', url: xml_url, // Link to a steam profile with ?xml=1 added accept: 'text/xml', onreadystatechange: function (response) { if (response.

Categories : Javascript

Force Tampermonkey to run/execute script late
The content you want is being loaded by AJAX, so you need to use AJAX-compensation techniques in your script. The easiest way to do that is to use waitForKeyElements(). Something like: // ==UserScript== // @name _YOUR_SCRIPT_NAME // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work around a design change introduced in GM 1.0. It restores the sandbox. */ waitForKeyElements ( "jQUERY SELECTOR TO THE NODE(S) YOU WANT", changeFontColor ); function changeFontColor (jNode) { jNode.css ("color", "red"); }

Categories : Javascript

Tampermonkey script to edit links in source
Well after fiddling a bit I managed to write a script, here's the code if anyone's interested. // ==UserScript== // @name Google Add // @namespace // @description // @include * // ==/UserScript== var srcs = document.links; var links = document.getElementsByTagName("link"); var scripts = document.getElementsByTagName("script"); var imgs = document.getElementsByTagName("img"); var iframes = document.getElementsByTagName("iframe"); for (i = 0; i < links.length; i++ ) { links[i].href = links[i].href+'?google'; } for (i = 0; i < scripts.length; i++ ) { scripts[i].src = scripts[i].src+'?google'; } for (i = 0; i < imgs.length; i++ ) { imgs[i].src = imgs[i].src+'?google'; } for (i=0; i<srcs.length; i++) { srcs[i].href = srcs[i].hr

Categories : Javascript

alert() doesn't show the value in a Tampermonkey script
Your alert alerts 'extern' because you alert it as a string. alert(extern) will alert the good value. And to make the div visible, just: document.getElementById('div2').style.display = 'block';

Categories : Javascript

Removing CSS Borders with javascript in greasemonkey/tampermonkey for facebook
border-right is a style property, not an element attribute, so removeAttribute won't work. Instead try this: document.getElementById("mainContainer").style.borderRight = "none"; (Note that border-right becomes borderRight for JavaScript, and make sure you spell names exactly.) However you might prefer user stylesheets. Browser extensions such as Stylish let you write CSS that is applied automatically, instead of going through script. (You can hide things using display: none, or mute them with opacity: 0.5.)

Categories : Javascript

Fatal error: Uncaught AwsGlacierExceptionGlacierException: AWS Error Code: , Status Code: 400, AWS Request
It seems you may be confused about the difference between vaults and archives. You should make sure to look through the Amazon Glacier Developer Guide to become familiar with the basic concepts of Glacier. You must first create a vault in order to upload archives to it. A vault in Glacier is similar to a bucket in S3. You should also check out these links which provide code samples for doing uploads with Glacier: Uploading Archives to Amazon Glacier from PHP blog post on the AWS PHP Developer Blog "Amazon Glacier SDK php" post on SO

Categories : PHP

MySQL Cluster ERROR 1296 (HY000): Got error 157 'Unknown error code' from NDBCLUSTER
Error 157 is actually 'could not connect to storage engine' and the fact that MySQL fails to report that error correctly is a bug: http://bugs.mysql.com/bug.php?id=44817 The case described in that bug mentions that you get the error when you try to query a table in NDB when the cluster is still down. So I'm just guessing, but I would conclude that your cluster is not started. Either you missed starting one of the nodes, or else something went wrong starting one of the nodes.

Categories : Mysql

Proguard error preventing APK from building with "returned error with error code 1"
In order to fix this, Change: java -jar $PROGUARD_HOME/lib/proguard.jar "$@" To: java -jar "$PROGUARD_HOME/lib/proguard.jar" "$@" in this file <Android SDK Location Here>/sdk/tools/proguard/bin/proguard.sh Credit here

Categories : Android

CURL Error while making request: SSL connect error (error code: 35)
I tried this on several different machines: curl -v https://www.example.com/ On some machines I got the SSL error 35, and on some it worked with no error message. From this I suspected that there was some difference in the curl version being used, or else the related packages for SSL certs. So I tried updating some packages on the server I needed. It turned out that updating the Network Security Services (NSS) package fixed the problem. yum update nss

Categories : PHP

The following code is working in eclipse but when i convert into maven project this code giving error
i check your pom.xml and code this problem will comes only the mismatch the version json-lib-0.9 and json-lib-2.4 or other version of library so you remove all library and try the following way and one more things you have to remove from json-lib from apche-tomacat lib also and then you try this following code and used the json-lib 2.4 version. String user1 = "{'Main':[{'h1':[ {'userId':'userId123'} ],'body':[{'data': [{'userId':'one'}]}] }]}"; JSONObject jsonObj = (JSONObject) JSONSerializer.toJSON(user1); JSONArray snefoCareEnvelopeMain = (jsonObj.getJSONArray("Main")); //main object JSONObject Main = snefoCareEnvelopeMain.getJSONObject(0); // this for reading h1 data JSONArray headerarray = (Main.getJSONArray("h1")); JSONObject

Categories : Java

Exception handling within loop. Why does this code give a not all code paths return a value error?
You are not returning anything after your while loop. Not sure what this method is used for, but I would suggest Int32.TryParse() instead of this implementation.

Categories : C#

Code Sign error: code signing is required for product type 'Application' in SDK 'iOS 6.1'
If you're trying to test the app on your device, check everything in that box to code sign with your developer identity. If you're submitting for distribution, then check everything to sign with your distribution profile. If that doesn't do the trick, go into your organizer (Shift + Command + 2), click "provisioning profiles" from the pane in the top left, and make sure that your provisioning profile is in there, and that it says "valid profile" to the right of it. Let me know if you have any questions in the process.

Categories : IOS

tSQLt - How to do a unit test on code in an error Catch block of code
To do this I would suggest creating a wrapper class around RAISERROR say Utils.GenerateError(@error, @serverity, @state) which in turn calls RAISERROR. That way you can simply use EXEX tSQLt.SpyProcedure 'Utils.GenerateError' to mock out the code that actually raises the error. Note since you are now no longer actually going to throw an error, it would be pointless to call ExpectException in your test. You could check that the correct parameters were passed to the your spy procedure instead. Testing the Utils.GenerateError would be a pretty trivial exercise as well.

Categories : Unit Testing

Error Code: 1289. The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; to have it working
It's by design. SHOW PROCEDURE CODE Syntax This statement is a MySQL extension that is available only for servers that have been built with debugging support. It displays a representation of the internal implementation of the named stored procedure. As the error message explicitly says if you want to be able to use this feature you need to build your MySql with --with-debug option.

Categories : Mysql

Resolving Perls "$?" return code: Why is it different from Hana sql error code ??
$? is usually a multiple of 256. See perldoc -f system (though this applies to assignment of $? after backticks and wait as well). The exit (and POSIX::_exit) functions expect input on the range 0 to 255 -- this is an operating system convention, not a limitation of Perl. If you pass an argument outside that range, Perl or the operating system will treat it as if you called exit($arg % 256). So I think what is happening is that hana sql makes the system call to exit with the sql error code. This error code is typically greater than 255, so the exit code that gets propogated back to the operating system is hana error code % 256. When Perl receives this error code and assigns a value to $?, it multiplies that value by 256 (as described in perldoc -f system), so the relationship between t

Categories : Perl

i have tried this code many times. But it always force closes. Can anyone find out the error in the code
Ill bet you are getting a NetworkOnMainThreadException. All networking operations must be done on a non-UI thread. I would recommend looking up the AsyncTask class in the android documentaion: http://developer.android.com/reference/android/os/AsyncTask.html. You will probably find that you need to move the body of your submit() function into the doInBackground() function of an asyncTask.

Categories : Android

python help can't figure out why with one piece of code error (code academy)
This is an issue commonly experienced by new programmers; the computer does not behave how one would expect it to, but rather how it is told to. The equality comparison is not distributed across all or terms, but rather is only performed on only the first. You must provide it in all terms yourself: if s == a or s == c or s == e: Python also has an alternate syntax for this (although operation is not quite the same), based on containment checking: if s in (a, c, e): In this case we have only two operands for in, and distribution across the tuple elements is not required.

Categories : Python

error occured when fortran code called c code
Different Fortran compilers generate calls differently. Many add underscores to routine names to avoid name conflicts with C-code. Its very hard to say whether or not you should exactly follow the example of an unnamed reference book. In the past, to mix Fortran and C, you have to understand some of the compiler internals. Here the Fortran compiler appears to have added an underscore to the start of the name. You could probably fix the problem by adding that in your C++ code. But that won't be portable and in principle could change with compiler versions. There is a better way: the Fortran ISO_C_Binding. This is part of the Fortran language standard and therefore standard and portable. Examples are given in the gfortran manual in the Chapter "Mixed-Language Programming" and in

Categories : C++

How to fix error "clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)"?
It looks like you only compiled main.cpp but not pattern.cpp. When it came time to link the executable together, functions defined in pattern.cpp won't be found. The undefined reference indicates your main.cpp is using pattern(int, int) somewhere. You can see why this becomes a problem if pattern.cpp is never compiled in. Try compiling with: clang++ -Wall -pedantic main.cpp pattern.cpp -o main

Categories : C++

VS2008 error expected constant expression on declaring array, but no error for this code in GCC
The parameter const int size does not mean that size is compile-time constant. It simply means that in someFun, you cannot change the value of size. However, the value of size could be changed between different calls of someFun. Arrays in C/C++ need to have a size that is known at compile-time.

Categories : C++

Error in La.svd(x, nu, nv) : error code 1 from Lapack routine 'dgesdd' when using stability function in ClustOfVar
I am having exactly the same problem. The only thing that fixed it for me was changing the value of B (reducing it to 20) but I don't think it is right so I hope someone can give us a solution. My worry from searching the web is that there is a bug in the Lapack package which seems unfixable (this error is a common occurrence with various functions).

Categories : R

Fatal error: Uncaught AwsOpsWorksExceptionValidationException: AWS Error Code: ValidationException when running deploy command through php sdk
I'm not as familiar with the PHP syntax, but here's a Ruby code snippet that works. Do you need the first array? opsworks.create_deployment(:stack_id => app[:stack_id], :app_id => app_id, :instance_ids => instance_ids, :command => {:name => 'deploy'})

Categories : PHP

PHP error.. the same code used to work a month before and now its showing an error.. copy(): Filename cannot be empty [file]
I can guess, php version has updated on server. b/c $HTTP_POST_FILES is deprecated.(PHP 4 >= 4.1.0, PHP 5) http://php.net/manual/en/reserved.variables.files.php. so this is not there. 4.1.0 Introduced $_FILES that deprecated $HTTP_POST_FILES.

Categories : PHP

Error : android.database.sqlite.SQLiteException; near "student_name" ; syntax error (code 1) ; while compiling : CR
Your CREATE statement is missing a comma after TEXT PRIMARY KEY db.execSQL("CREATE TABLE IF NOT EXISTS " + DATABASE_TABLE + " ( " + KEY_ID + " TEXT PRIMARY KEY , " + KEY_NAME + " TEXT NOT NULL , " + KEY_ROLLNO + " TEXT NOT NULL );" );

Categories : Android

Voip app IOS getting error Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn’t be completed. Connection refused
If you read his tutorial he mentions this. I'm sure it's your issue. Before you run the app, you need a server with which to test it. You can use a handy little utility every Mac already has called netcat that, among other things, allows you to easily create simple text-based servers.

Categories : IOS

AWS data pipeline job failing but there is no error message or error code
Here are couple of things you could try Go to "https://console.aws.amazon.com/elasticmapreduce/home", find the corresponding cluster that got started (based on timestamp), click on "Debug", you should find logs about each step. Or start an EMR cluster from AWS Console, login into the Master node, run the Pig script to check if its working.

Categories : Amazon

Android app error: net.wimpi.modbus.ModbusSlaveException: Error Code = 2
I'm using liblary for modbus in C#(NModbus) and SlaveException means thean your slave device return error: http://www.simplymodbus.ca/exceptions.htm Error code number 2 means that: The data address received in the query is not an allowable address for the slave. More specifically, the combination of reference number and transfer length is invalid. For a controller with 100 registers, a request with offset 96 and length 4 would succeed, a request with offset 96 and length 5 will generate exception 02. http://www.kepware.com/Support_Center/SupportDocuments/KTAN90006_Modbus_Exception_Codes.pdf

Categories : Java

Why does this code keep giving this error? Syntax error: Bad for loop variable
Your code compiles correctly. This is the proof : http://codepad.org/hryZ2dEm I have also added the return type and the return instruction in the main function to make your code conform to the standard. Try to use the small changes I have inserted. Let me know if you still have a problem.

Categories : C

sqlite returned: error code =1, msg = near "port": syntax error, HELP Please
Change this: db.execSQL("CREATE TABLE if not exists ftpAccounts(id INTEGER PRIMARY KEY AUTOINCREMENT," + "name" + " TEXT ," + "username" + " TEXT," + "password" + " TEXT)" + "port" + " TEXT)" + "host" + " TEXT)"); To this: db.execSQL("CREATE TABLE if not exists ftpAccounts(" + colId + "INTEGER PRIMARY KEY AUTOINCREMENT," + colName + " TEXT ," + colUserName + " TEXT," + colPassword + " TEXT," + colPort + " TEXT," + colHost + " TEXT)"); You had a few extra parenthesis instead of commas. Completely forgot you wanted to use variables for the names of the columns.

Categories : Android

File Copier keeps failing(caught the error, no error code)
You have used two forward slashes in the path (//): ("C://Users//Gannon//Desktop//Java//workspace//ModPack Installer//test.txt"); Use a single forward slash or use two backward slashes because you need to escape those (\). I hope this helps.

Categories : Java

Audio device error encountered. - Error Code: 0x4
This type of error generally occurs when your speech device is damaged. Have you seen http://social.msdn.microsoft.com/Forums/vstudio/en-US/9075023b-8bc4-4632-a573-77470b403a48/i-get-an-audioexception-0x2 ???

Categories : C#

Cannot fix Android Proguard Returned with error code 1 error
update your progaurd to the latest version 4.10 from this link http://sourceforge.net/projects/proguard/files/proguard/4.10/ unzip the file and replace the content in your android sdk directory (progaud folder in tools directory) [path to android sdk] Androidandroid-sdk oolsproguard then try again, you might need to restart eclipse.

Categories : Android

Twitter message posting issue ( Request failed with error: Error Domain=HTTP Code=410 "The operation couldn’t be completed. in ios app
It's not clear if you are using the iOS Twitter functionality, or another framework (but the oAuth makes me think it's another framework). The Twitter V1 API has been deprecated and retired. You should now use the 1.1 version: https://dev.twitter.com/blog/api-v1-is-retired This means the URI should have 1.1 in it, as opposed to just "1". https://dev.twitter.com/docs/api/1.1 I would try updating the framework you are using, or perhaps switching to the built in Twitter functionality, which streamlines the authentication process if the user has a Twitter account on their phone.

Categories : IOS

persistentstorecoordinator sqlite error code:522 'not an error'
So it looks like the following solved my specific issue, although some people will advise against changing the journaling mode on your sqlite database: // Change journal mode from WAL to MEMORY NSDictionary *pragmaOptions = [NSDictionary dictionaryWithObject:@"MEMORY" forKey:@"journal_mode"]; NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, pragmaOptions, NSSQLitePragmasOption, nil];

Categories : Iphone

How to get the error code when there is error in powershell?
$LASTEXITCODE is strictly for command line programs to return their status. Cmdlets that are built into PS, such as Remove-item return their errors in up to 3 ways. For warnings, they write messages (or other .NET objects) to the "warning stream". In PSv3 there is a straightforward way to redirect that stream to a file: cmdlet blah blah blah 3>warning.out. The second is via the error stream. That stream can be redirected as well ... 2>error.out, or more typically errors are caught with try/catch or trap, or written to a variable with the -ErrorVariable parameter (see help about_commonparameters). The third way is for errors to be "thrown". Unless caught (try/catch or trap), a thrown error will cause the script to terminate. Thrown errors generally are subclasses of the .NET class sys

Categories : Powershell



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.