Site Sponsors:
New Project: SQLMate 
Well, here we code again ...

One might have noted that I am somewhat obsessed with SQLite at the moment ... and for good reason: From Android to Big Data, we are using SQLite on every 'conceivable.

So when it came time for me to mass-generate a few hundred tables & DAO's recently, I decided to write yet another source code generator.

See the related link (below) for a tad more information.


Cheers,

-Rn


[ view entry ] ( 909 views )   |  permalink  |  related link
Must-Have Developer GUI for SQLite? 
Downloaded version 1.2.2 of sqliteman (for sqlite3) on Ubuntu 14.05 LTS yesterday via the software center. Written in Qt, versions for Microsoft Windows & elsewhere are also available.

Decidedly for those who know SQL rather well, we found that sqliteman (official screen shot) is a must-have tool for those in-the-know. -Admins and software developers are the targeted audience.

For the novice, sqliteman would be perfect for those who have just learned the SQL basics of views, select statements, as well as table creation. One should also be aware of the shorter list of abbreviated data types.

Ultimately, I found that sqliteman's ability to allow us to keep a running list of select-and-run statement to be very addictive.

Surely the perfect tool for the SQLite and / or Python3 enthusiast - Keep up the good work!

[ view entry ] ( 914 views )   |  permalink  |  related link
German Notation & Problematic File Names 
For years I have been popularizing the idea of using "German Notation." Formerly known as "Nazi Notation," far from conjuring-up the image of unpleasantness, I use the term whimsically; When one hears it, my hope is that we think more of "Sergent Schultz" (I know nothing!:) or "Colonel Klink" - rather than Adolph Hitler?


Ironically, in as much as standards like PEP-8 remind many software developers of the more dark-size of what being a "Nazi" was all about, the idea is that there can be far better ways to name things like variables and member functions?

Indeed, rather than blindly following the edicts of any dictator - benevolent or not - when using such a typeless language as Python, perhaps one might like to use Hungarian Notation? --Surely prefixing simple characters like a lower-case 's' for string, 'i' for integer ... or merely dropping vowels & double consonants ... can create far more succinctly-informative mnemonics?

Oh well - rather than memorize any type of rigidly defined view over how people should all be writing code the same way, by way of introducing a nice way to use keywords and built-ins as variable names, note our scattering of a simple "z" prefix around in the following code:

import os

count = 0
zRoot = "/"
print("Parsing", zRoot)
for zPath, zDirs, zFiles in os.walk(zRoot):
for zFile in zFiles:
file = os.path.join(zPath, zFile)
nodes = os.path.split(file)
for node in nodes:
if is_good_node_name(node) is False:
count += 1
print(file)
break


print("Found", count, "potential problems.")


Honoring the freedom to do what - IMHO - makes for a far better single-word mnemonic experience, allow me to complete the above example by presenting the balance of the code:

bad_chars = bytearray(":?*<>|\\/\"", "utf8")


def is_clascii(str_data):
for ss, ch in enumerate(str_data):
code = ord(ch)
if code < 32:
return False
if code > 126:
return False
return True


def is_good_node_name(str_data):
global bad_chars
str_data2 = bytearray(str_data, "utf8")
for ss, ch in enumerate(str_data2):
for ref in bad_chars:
if ref == ch:
return False
return is_clascii(str_data)


Designed to rummage around zRoot so as to find zFile that might create a problem for your cross-platform file-transferal activities (Linux? Windows? OS/X? AIX?,) my hope is that you will find the above Ptyhon3 example to be of use in planning escape attempts for our comrades in-arms in a 'Stalag near you!


Enjoy the Journey.

-Rn


[ view entry ] ( 754 views )   |  permalink  |  related link

<<First <Back | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Next> Last>>