Category: Allgemein

  • Write records to Salesforce

    Below, I provide a simple programme. The programme is written in Python. With Python, a library “salesforce_api” is used. With this library, one is able to insert records, query records and delete records in Salesforce. from salesforce_api import Salesforce client = Salesforce(username=’datamigrationuser@pension4you.nl.pensiond2′, password=’***’, security_token=’***’,is_sandbox=True) hx = client.sobjects.Contact.insert({‘LastName’: ‘Example’, ‘Email’: ‘test@example.com’}) print(hx) hx = client.sobjects.query(“SELECT Id…

  • Check in Python for Email address

    Recently, I discovered a nice trick to check the Email addresses. It uses a check on the setup of Email addresses. They must contain an @ symbol. They must contain a dot etc. It runs as follows: import re hx = ‘jaouad­taheri@hotmail.com’ if not re.match(r”^[A-Za-z0-9.+-]+@[A-Za-z0-9._-]+.[a-zA-Z]$”, hx): print(hx,’ klopt niet Email adres ‘) else: print(‘Email ok**’)

  • Python – a quick selection

    I wrote a Python programme to select rows that contain NULLs. Whenever a null was found, it is written to a separate file. The programme uses data frames. This allows to treat data as matrix. Once it is interpreted as a matrix, one may inspect each row. If the row contains a NULL, it is…

  • Python cgi-bin

    I recently added a cgi-bin programme to my website (see van-maanen.com/cgi-bin/test.py. It allows me to add functionality to the website that cannot be achieved with standard html. Most web servers have the capability to add cgi-bin functionality to its website. I have a apache web server and I had to tweak the web server to…

  • Ping pong between server and client

    I worked with Salesforce in recent period. A nice feature of this application is the possibility to send requests via the http protocol. Doing so, one may add data to this system. How does it work? Generally speaking, one sends a signal to the system, upon which the system reacts. In my case, data are…

  • Salesforce Data structure

    Salesforce is a CRM application that is build upon a set of data. These data may refer to customers, but is is possible to create your own data structures. These data structures have two types of field that are used to create the relation ships. The first type can be seen in object (Boek__c) that…

  • Finding errors in Oracle

    It is possible to trap errors in the loading process. This is handy when we work on a migration project. We simply load a table and trap all possible errors. Let us use a simple table (emp_c) that must be loaded. However, one field is too narrow which loads to errors. These error will be…

  • Oracle HR schema

    Oracle has a use that may act as an example user with a series of tables. This example can be used to get acquainted with oracle SQL or data modelling in general. The script can be found here:

  • Encrypting in Python

    Encrypting in Python can be very easy. Below, a snippet is provided that allows to encrypt data. The code can be found here : However, as the code is simple, it comes at a price: the Vigenere cipher is rather insecure. If the key length is equal to the cipher text length then the cipher is absolutely secure if the key is chosen…

  • Adding data in Azure with the bulk loader

    I am quite impressed with Azure SQL Server. The DBMS is easy to understand as will be shown below. The problem is how to add data from a local file (“uit”) to the Azure SQL Server environment. This is done in two steps. The first step is to create a table from the command line…