ytyng.com

Latest Articles

Page 14
Django
2015-10-15 10:10 (10 years ago)
Paging Django Model Instances Queried with Complex Filters Using Paginator

class Content(models.Model): content_name = models.CharField(...) group_id = models.PositiveIntegerField(...) volume_number = models.PositiveIntegerField(...) ... Assuming we have a typical Django model class, we want to search for its instances using a complex SQL query in a single shot. The results should be displayed on a web page, but since many rows are expected, we want to display a paginator.

Linux
2015-09-08 11:56 (10 years ago)
Install MySQL 5.6 on Ubuntu Linux 14.10

cd /tmp/ wget "http://dev.mysql.com/get/mysql-apt-config_0.3.5-1ubuntu14.10_all.deb" sudo dpkg -i mysql-apt-config_0.3.5-1ubuntu14.10_all.deb # Server -> MySQL 5.6 -> Apply sudo apt-get update sudo apt-cache policy mysql-server sudo apt-get install mysql-server (Reconfigure: sudo dpkg-reconfigure mysql-apt-config )

Django
2015-09-03 11:48 (10 years ago)
Create a Full-Text Index in Migration Files with Django 1.7

This is a method to create a full-text index in MySQL using the DB migration feature in Django 1.7 and above.

mac
2015-09-02 12:56 (10 years ago)
Experiencing the US Keyboard Layout on a Mac with a JIS Keyboard

When using a Mac with a JIS keyboard that I bought a long time ago, I can't help but notice the US keyboard enthusiasts around me. They often say, "For development, it's got to be a US keyboard!" Even when I try to explain, "Well, the Kana key and the Control key placement are better," I still feel a bit hurt inside. I'm sure you've experienced something similar.

Raspberry-Pi
2015-08-16 15:19 (10 years ago)
Operating a 128x64 OLED LCD Display with Raspberry Pi

An impulse purchase from Amazon: a 128x64 OLED LCD display

iOS
2015-08-11 07:05 (10 years ago)
When Using CarouFredSel on iOS, the Touch Transition Stopped Working Unexpectedly

```html When using CarouFredSel on iOS, I noticed that transitioning by touch had somehow stopped working.

Python
2015-08-11 02:06 (10 years ago)
Running Firefox with Selenium on Headless Linux for Automated Operations in Python

This is a method to launch Selenium from Python on a headless Linux system.

iOS
2015-08-07 01:49 (10 years ago)
Getting Inconsistent Duplicate Symbol Linker Errors

When building an iOS app in Xcode, you may encounter the following error:

Django
2015-07-07 05:38 (10 years ago)
How to Replace Strings in Django TemplateView

```html Here are two methods to output an HTML template as it is using Django's TemplateView class, but replacing strings in the output result at once.

iOS
2015-06-30 00:30 (10 years ago)
Steps for Verifying iOS In-App Purchase Receipts

Processing on iOS Devices In SKPaymentTransactionObserver's

Python
2015-06-17 11:08 (10 years ago)
What to Do When You Can't Import `requests` (_ssl) in Python 3 on a Mac

Traceback (most recent call last): File "/Applications/Develop/PyCharm.app/helpers/pycharm/django_test_manage.py", line 51, in <module> django.setup() ... File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/importlib/__init__.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 2254, in _gcd_import File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked File "<frozen importlib._bootstrap>", line 1129, in _exec File "<frozen importlib._bootstrap>", line 1471, in exec_module File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed ... File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ssl.py", line 97, in <module> import _ssl # if we can't import it, let the error propagate ImportError: dlopen(/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_ssl.so, 2): Symbol not found: _SSLv2_method Referenced from: /usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_ssl.so Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib in /usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_ssl.so I started getting this error.

Linux
2015-06-11 06:28 (10 years ago)
Avoid using TLS 1.2 for certain websites that freeze during HTTPS connections with Curl, Python, and PHP

As I wrote in this article http://b.ytyng.com/a-61/, when you make an HTTPS connection with OpenSSL 1.0.1f and attempt to connect using TLS1.2 by issuing a hello, certain sites may freeze in response.

Linux
2015-06-11 05:50 (10 years ago)
Cannot Connect to a Specific Web Service Using HTTPS (TLS 1.2) - Freezes

When attempting to communicate using TLS1.2 with a specific web server and OpenSSL versions 1.0.1a to 1.0.1f, OpenSSL may freeze.

iOS
2015-06-08 01:21 (10 years ago)
Tips for Making UIWebView Look More Native

Disabling Long Press Menus CSS

Django
2015-05-29 11:31 (10 years ago)
Create a Simple Login URL with Django

url(r'^login/', 'django.contrib.auth.views.login', name='login', kwargs={'template_name': 'admin/login.html', 'extra_context': {'next': '/'}}), Write this link in the template as follows,

Linux
2015-05-13 01:35 (10 years ago)
Remove Trailing Slash from Variable in Bash

Removing the trailing / from $1

Django
2015-05-10 07:19 (10 years ago)
Using reStructuredText with Mezzanine

There is a system called Mezzanine for building a CMS on Python + Django. By default, blog entries are written using a WYSIWYG HTML editor, but I wanted to write them using reStructured Text (reST, rst), so I did some research.

Python
2015-03-02 10:46 (11 years ago)
Disable Links in docutils' rst Writer (docutils.writers.html4css1)

Couldn't find the configuration item, so I'll use a monkey patch.