recentpopularlog in
« earlier   later »
python - parsing XML file gets UnicodeEncodeError (ElementTree) / ValueError (lxml) - Stack Overflow |
You are using the decoded unicode value. Use r.raw raw response data instead:
<code class="language-python">r = requests.get(url, params=payload, stream=True)
r.raw.decode_content = True

which will read the data from the response directly; do note the stream=True option to .get().

Setting the r.raw.decode_content = True flag ensures that the raw socket will give you the decompressed content even if the response is gzip or deflate compressed.

You don't have to stream the response; for smaller XML documents it is fine to use the response.content attribute, which is the un-decoded response body:
<code class="language-python">r = requests.get(url, params=payload)
xml = etree.fromstring(r.content)</code>

XML parsers always expect bytes as input as the XML format itself dictates how the parser is to decode those bytes to Unicode text.
xml  requests  elementtree  lxml  python  webdevel  errormessage  solution 
july 2018
How does plastic get in the ocean? 5 questions we need to answer to fix plastic pollution - Vox |
In other words, making environmentalism a social norm is one of the best ways to get people to be more aware of their behavior. Using the plastic straw ban as an example, he explained, “if everybody else in the restaurant is using them, and the context condones their use (e.g. straws on tables or put into drinks when served), then this increases the likelihood that an individual will act in accordance.”
oceans  pollution  plastic  pacificgarbagepatch  recycling  society  change 
july 2018
linux - How to install `build-essential` in `Cygwin`? - Stack Overflow |
Build-essential is a collection of packages. So you'll have to select the packages manually, which I believe are the following:

- make
- automake
- gcc
- gcc-c++
windows  cygwin  devel  build  toolchain  gcc  cplusplus  maybesolution  likedebian 
june 2018
Manual:Timezone - MediaWiki |
<code class="language-php">#Set Default Timezone
$wgLocaltimezone = "Asia/Jakarta";
date_default_timezone_set( $wgLocaltimezone );</code>
mediawiki  configsetting  dateandtime  localtime  timezone  solution 
june 2018
MediaWiki FAQ - Meta |
How do I purge cached pages?

1. You can use ?action=purge on individual pages to update their cache dates.
2. There is a global $wgCacheEpoch variable which can be set in LocalSettings.php to invalidate all prior cache entries (see DefaultSettings.php)
3. If you want to purge all pages in the parser cache, truncate objectcache table from the wiki database. You may use this command:

<code class="language-sql">TRUNCATE TABLE objectcache;</code>

Hint: If this fails, you might be using a prefix for your database tables!
mediawiki  configsetting  config  webmaster  sysadmin  reference 
june 2018
Python import statement semantics - Stack Overflow
<code class="language-python">import lxml.html as LH
doc = LH.parse('http://somesite')
lxml.html is a module. When you import lxml, the html module is not imported into the lxml namespace. This is a developer's decision. Some packages automatically import some modules, some don't. In this case, you have to do it yourself with import lxml.html.

import lxml.html as LH imports the html module and binds it to the name LH in the current module's namespace. So you can access the parse function with LH.parse.

python  lxml  imports  syntax  annoyance  solution 
june 2018
The War on Developer Productivity (And How I Intend to Win It) -
Chat is a greedy mode of communication.

* It doesn’t care if you are deep in flow.
* It begs you to incessantly clear its notification badges.
* It buries important conversations among idle chatter when you snooze it.
* It must be used with restraint or it becomes toxic.
workplace  productivity  chatapps  slack  distraction  chat  collaboration  communication 
june 2018
Opinion | The Best Book for 2018 Is 25 Years Old - The New York Times
It has become fashionable for writers to talk about the transformative power of empathy in fiction. But that potential is realized only when empathy is deployed in conjunction with an understanding of power and how it functions.

Jess continually marks the ways oppressive systems are most damaging — the way they force those who are oppressed to hate themselves and identify with their oppressor. And to navigate them, you are often asked to kill off any feeling or natural part of yourself to survive.
opression  activism  gender  passing 
june 2018
How To Secure Memcached by Reducing Exposure | DigitalOcean
Modify '/etc/sysconfig/memcached':
# ...
OPTIONS="-l -U 0"

Test with:
<code class="language-bash">sudo netstat -plunt</code>
webdevel  sysadmin  memcached  security  hardening  solution 
june 2018
216 Web Safe Colors List - by |
mutedgreen: rgba(0,255,156,0.3), Hex: #00FF9C
mutedred: rgba(255,51,46,0.3), Hex: #FF332E
mutedturquoise: rgba(20,174,204, 0.3), Hex: #14AECC
mutedcerulean: rgba(61,138,153, 0.3), Hex: #3D8A99
mutedmagenta: rgba(204,20,97,0.3), Hex: #CC1461
mutedmustard: rgba(232,172,12,0.3), Hex: #E8AC0C
webdevel  webdesign  colors  colorscheme  palette  solution 
june 2018
Mailing List Archive: Re: MediaWiki 1.28.0 Extension LDAPAuthentication does not work |
There is a new permission available that governs the right to create accounts when logging in with an external user account. It's called "autocreateaccount" [0]. You have to add to your config something like:
<code class="language-php">$wgGroupPermissions['*']['autocreateaccount'] = true;</code>

Or maybe this is enough:
<code class="language-php">$wgGroupPermissions['user']['autocreateaccount'] = true;</code>

See also
mediawiki  ldap  authentication  config  configfile  solution 
june 2018
"You have made too many recent login attempts" on Project:Support desk |
Just restart your web server (or your php server instance if you're using PHP-FPM), it will reset it.
mediawiki  sysadmin  errormessage  lockout  security  solution 
june 2018
maintenance/update.php - Error: your composer.lock file is not up to date. on Skin talk:Chameleon |
Ran into this issue where 'maintenance/update.php' wouldn't stop griping about 'composer.lock' being out of date.

No amount of 'composer update --no-dev' would make this go away. This turned out to work (allowing the LDAP extension to make necessary schema changes):
Run update.php with parameter --skip-external-dependencies
mediawiki  1.30  errormessage  solution 
june 2018
certificate - How do I solve ldap_start_tls() "Unable to start TLS: Connect error" in PHP? - Stack Overflow |
To get a better idea of what's going on, you can enable debug logging by:
<code class="language-php">ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);</code>
mediawiki  php  debugging  errormessage 
june 2018
« earlier      later »
per page:    204080120160

Copy this bookmark:

to read