Laur's blog
  • Home
  • About
  • Support my work
Sign in Subscribe
Drawing QR-Code on Browser in Javascript
browser

Drawing QR-Code on Browser in Javascript

In my quest to make the pages of one site a bit more mobile-friendly, I've got the idea to provide a QR-Code for an unique identifier generated for users. This is part of a wizard and the end-product is: QR Code in JavaScript To reach this outcome, I&
May 2, 2014 1 min read
Copy Text to Clipboard in HTML Page using JavaScript
clipboard

Copy Text to Clipboard in HTML Page using JavaScript

I've got a problem on one of my sites: I have a unique identifier displayed on one page, which I need to make it easy After looking online, I've found three approaches using only JS. Clipboard.js Clipboard.js is a new (September 2015) approach which
May 1, 2014 1 min read
Send POST to server via python-requests
data

Send POST to server via python-requests

The other day I've had a question asked: How do you send a form data to a server and get the reply? My solution involves python-requests: __author__ = 'Laur IVAN' import requests proxies = { 'http': 'http://.../', 'https': 'http://.../' } payload = { '
Apr 15, 2014 1 min read
Loading XSDs into Oracle through Python
clob

Loading XSDs into Oracle through Python

Following the previous incursions in Oracle and their own documentation, we decided it was useful to attach schemas to the inserted data, just because only XML with schemas attached can be indexed. When you have some million entries, indexing seems like a good idea (once you decide what to index)
Apr 2, 2014 2 min read
Use Oracle's RegisterSchema with Large Schemas (from Python)
fragment

Use Oracle's RegisterSchema with Large Schemas (from Python)

An important note when loading XSDs in Oracle is that DBMSXMLSCHEMA.registerSchema() requires the actual content of the _xsd is loaded in a string. A side effect is that strings in Oracle have limits and schemas can exceed those limits. Therefore, such strings must be fragmented. In this case, we
Apr 1, 2014 1 min read
Drop an Oracle-Loaded XSD in Python
cx_oracle

Drop an Oracle-Loaded XSD in Python

A loaded schema can be dropped if: * No other schema depends on it * No data using the schema is loaded I think you may force unloading schemas even if there is data loaded but I haven't tried that. The code to drop a schema is: dbms_xmlschema.deleteSchema(
Mar 31, 2014 1 min read
Loading Dependent XSDs in Oracle through Python
cx_oracle

Loading Dependent XSDs in Oracle through Python

One essential feature is that schemas can refer to other schemas. Oracle supports it via the schemaURL parameter. In other words, the url of the referred schema must be the same as the schemaURL parameter used to register the referred schema. One consequence of this feature is the necessity to
Mar 31, 2014 1 min read
Create and send an appointment request correctly in Outlook
meeting

Create and send an appointment request correctly in Outlook

The other day I've received an attachment win an appointment as an attachment. This is not really the way to get people to come to your meeting. So, I'm listing the correct way here for future reference: 1. Open Outlook (if you don't already
Mar 28, 2014 1 min read
UPSERT (update or insert) in Oracle with Python
cx_oracle

UPSERT (update or insert) in Oracle with Python

One of the things I had to do is to build a script to upload data (e.g. the content of a list of files) into a database with a single table. My table has 3 columns: 1. ID - a 20-character string identifier with PK properties (unique) 2. ARTICLE-
Mar 24, 2014 2 min read
Wooden language - part 1
buzz

Wooden language - part 1

The other day I've stumbled over this gem: I think this article represents a paradigm shift in a dynamic marketplace. As a whole, I see where the author is coming from, but I don't really agree with his findings. I'm trying to think of
Mar 21, 2014 1 min read
Install NumPy in a Virtual Environment on Windows
binary

Install NumPy in a Virtual Environment on Windows

Someone told me they use a custom python install named Anaconda on windows because it contains a set of math packages which are difficult to install. In fairness, they're right because any python module with native dependencies is a mess to install from sources (e.g. because you
Mar 13, 2014 2 min read
Memory dump: Work with XMLField in Oracle (part 4)
oracle

Memory dump: Work with XMLField in Oracle (part 4)

Table of Contents 1. Part 1 - Prerequisites 2. Part 2 - Create a table and perform a SELECT 3. Part 3 - User Python to insert data 4. Part 4 - references References for the series * Using XQuery with Oracle XML DB * XMLTYPE * Oracle XML DB Developer's
Mar 7, 2014 1 min read
Memory dump: Work with XMLField in Oracle (part 3)
cx_oracle

Memory dump: Work with XMLField in Oracle (part 3)

TL;DR: Here I present how to insert data with python in the table created at the previous step. Table of Contents 1. Part 1 - Prerequisites 2. Part 2 - Create a table and perform a SELECT 3. Part 3 - User Python to insert data 4. Part 4
Mar 6, 2014 3 min read
Memory dump: Work with XMLField in Oracle (part 2)
oracle

Memory dump: Work with XMLField in Oracle (part 2)

TL;DR: Here I present a SQL example from creating the table to performing a SELECT. Table of Contents 1. Part 1 - Prerequisites 2. Part 2 - Create a table and perform a SELECT 3. Part 3 - User Python to insert data 4. Part 4 - references Table
Mar 5, 2014 2 min read
Memory dump: Work with XMLField in Oracle (part 1)
oracle

Memory dump: Work with XMLField in Oracle (part 1)

TL;DR: Here I present an introduction of the problem and some prerequisites to check if you have XMLFIELD available. Table of Contents 1. Part 1 - Prerequisites 2. Part 2 - Create a table and perform a SELECT 3. Part 3 - User Python to insert data 4. Part
Mar 4, 2014 2 min read
Use bfgminer as a service on Ubuntu (upstart)
bfgminer

Use bfgminer as a service on Ubuntu (upstart)

I've move my tiny miner from my mac to a linux (ubuntu) server. When I tried to run bfgminer as a normal use, I've found that it would not detect my miner, which was attached and nicely recognised by the system. Only after running it as
Mar 1, 2014 1 min read
Use a GraphView in a Fragment
android

Use a GraphView in a Fragment

From what I've seen, most tutorials relative to GraphView use direct Actions. I wanted to use a Fragment instead. Here are the steps I did (using the Android Studio): Create a Layout Fragment First, create a fragment (create a new Layout Resource File), based on a LinearLayout. I
Feb 22, 2014 2 min read
Easy django applications with cookiecutter
app

Easy django applications with cookiecutter

Now I'm trying to create a bunch of django applications and I've got tired of creating everything from scratch. So, here are the steps I'm using to easy create a new django app: * Create a new virtual environment. This is vital. It allows you
Feb 20, 2014 1 min read
Make pyflakes/pylint ignore unused imports
django

Make pyflakes/pylint ignore unused imports

Sometimes, you need to add an import without explicitly using it, just to have stuff defined. In such cases, both pyflakes and pylint generate messages, which can be annoying. For example django-appconf has a class-based configuration like so: # -*- coding: utf-8 -*- """ django appconf configuration
Feb 12, 2014 1 min read
Decent image loader widget in django
bootstrap

Decent image loader widget in django

I'm working on a website where I need to be able to load an image. The default widget is abysmal; it has a url to the current image, a checkbox and a file loader input element. Even styled, it looks pretty bad. So, I've taken upon
Jan 25, 2014 3 min read
Connect PyCharm to SQLite on Windows
connect

Connect PyCharm to SQLite on Windows

To connect to a SQLite database on PyCharm you have two options: 1. Manual connection and 2. Automatic connection. Manual connection Use the following steps to perform the manual connection: 1. Open the Database tab in PyCharm (usually on the right hand side) 2. Right-click and select the New >
Jan 25, 2014 1 min read
Install lxml on windows (on a virtualenv)
dependency

Install lxml on windows (on a virtualenv)

Lxml is a nice python library for XML processing. ETree is really quick, which makes things interesting if you have a large amount of XML files (or a bigger one) to process. Installation on linux/mac is painless (OK, you need homebrew on mac to make int painless, but you
Jan 22, 2014 2 min read
Excel - Check if item exists in another column
compare

Excel - Check if item exists in another column

The other day I had to create a "diff" between two lists in excel. More exactly, I had to verify which emails were missing between two lists of emails. Solutions I could find two solutions to this problem, which are listed below. For both, I'll assume
Jan 20, 2014 1 min read
Speed-up easy-thumbnails on S3
django

Speed-up easy-thumbnails on S3

I was developing a small app as a playground and confidence builder, choosing django, heroku and S3 as resources. One of the packages used is easy-thumbnails. Behaviour I chose to use the easy-thumbnails app with S3, a possibility granted by the storages framework. At a glance, everything works OK; thumbnails
Jan 19, 2014 1 min read
Create a survey with SurveyMonkey
survey

Create a survey with SurveyMonkey

Once in a while, you need to collect opinions of other people in a nice way. One of the options is to create a survey on Survey Monkey. Here are the steps I did to create (and manage) a survey Log in This is the first step. You'll
Jan 9, 2014 2 min read
← Newer Posts Page 23 of 26 Older Posts →
Laur's blog © 2026
  • Sign up
Powered by Ghost