How can I see the entire HTTP request that’s being sent by my Python application?

A simple method: enable logging in recent versions of Requests (1.x and higher.) Requests uses the http.client and logging module configuration to control logging verbosity, as described here. Demonstration Code excerpted from the linked documentation: import requests import logging # These two lines enable debugging at httplib level (requests->urllib3->http.client) # You will see the REQUEST, … Read more

How to see which plugins are making Vim slow?

You can use built-in profiling support: after launching vim do :profile start profile.log :profile func * :profile file * ” At this point do slow actions :profile pause :noautocmd qall! (unlike quitting noautocmd is not really required, it just makes vim quit faster). Note: you won’t get information about functions there were deleted before vim … Read more

What are Java command line options to set to allow JVM to be remotely debugged?

Before Java 5.0, use -Xdebug and -Xrunjdwp arguments. These options will still work in later versions, but it will run in interpreted mode instead of JIT, which will be slower. From Java 5.0, it is better to use the -agentlib:jdwp single option: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 Options on -Xrunjdwp or agentlib:jdwp arguments are : transport=dt_socket : means the … Read more

Showing the stack trace from a running Python application

I have module I use for situations like this – where a process will be running for a long time but gets stuck sometimes for unknown and irreproducible reasons. Its a bit hacky, and only works on unix (requires signals): import code, traceback, signal def debug(sig, frame): “””Interrupt running process, and provide a python prompt … Read more

How can I write to the console in PHP?

Or you use the trick from PHP Debug to console. First you need a little PHP helper function function debug_to_console($data) { $output = $data; if (is_array($output)) $output = implode(‘,’, $output); echo “<script>console.log(‘Debug Objects: ” . $output . “‘ );</script>”; } Then you can use it like this: debug_to_console(“Test”); This will create an output like this: … Read more

Eclipse – Unable to install breakpoint due to missing line number attributes

I had the same error message in Eclipse 3.4.1, SUN JVM1.6.0_07 connected to Tomcat 6.0 (running in debug-mode on a different machine, Sun JVM1.6.0_16, the debug connection did work correctly). Window –> Preferences –> Java –> Compiler –> Classfile Generation: “add line number attributes to generated class file” was checked. I did a clean, recompile. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)