This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Recently I had to work with Google AJAX API data which returns in JSON. For my purposes, the data needed to be in XML. | |
# While there is a CPAN module called XML2JSON which is designed to do that, for some reason it chokes on my input. | |
# Instead, I adopted a much more simple technique from the Google::Data::JSON module as follows. | |
use JSON::Any; | |
use XML::Simple; | |
my $convertor = JSON::Any->new(); | |
my $data = $convertor->decode($json); | |
my $xml = XMLout($data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' The problem with PostgreSQL is lack of documentation for Windows interfaces. Visual Basic uses | |
' the ADO library to connect to the PostgreSQL ODBC driver, which in turns connects to the server. | |
' | |
' This example covers a unique requirement - the network has over 300 individual desktop machines, | |
' all of which must be able to access the planned PostgreSQL server via Access, VBA or VB6. | |
' However, they do not want to go and setup a data source name (DSN) on each machine separately | |
' (installing ODBC is easier via the Windows deployment tools). Unfortunately, the ODBC driver has | |
' absolutely zero documentation as to how to setup an ADO connection WITHOUT a DSN. After some prolonged | |
' tries and failures, we both were finally able to come up with a solution which I am posting here for | |
' others to benefit from. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* One of the questions that recently came up is how to remove vowels from Hebrew characters in Unicode | |
* (or any other similar language). A quick look at Hebrew Unicode chart shows that the vowels are all | |
* located between 0x0591 (1425) and 0x05C7 (1479). With this and Javascript's charCodeAt function, it | |
* is trivial to strip them out with Javascript as follows | |
* | |
* Live demo is available here: | |
* https://jsfiddle.net/js0ge7gn/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Here is the software that is needed for the conversion to take place: | |
# 1. DjVuLibre . | |
# 2. LibTiff . | |
# | |
# NOTE: The ddjvu utility has an option to convert specific layers. One common mistake is to convert only the mask layer | |
# or the foreground layer . Technically speaking, the mask layer is the one that should have the actual text but in | |
# practice I have seen that the the DjVu encoder occasionally puts portions of the text in the background layer. Thus, | |
# if you only take the foreground or mask layers, you will lose those bits in the background. If your specific files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.itextpdf.text.pdf.*; | |
import com.itextpdf.text.pdf.parser.PdfImageObject; | |
import java.io.FileOutputStream; | |
/** | |
* This remove the interpolation flag in images in a given PDF file using iText 5. | |
* Requires: iText 5 | |
* | |
* For more info, see: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script flattens transparencies in PDF files. To use, run the following: | |
# 2007_11_09-flatten_pdf.sh [input.pdf] [output.pdf] | |
# | |
# You will need xpdf-tools and ps2pdf to be installed | |
# | |
pdftops -origpagesizes -level3 $1 temp.ps | |
ps2pdf -dPDFX temp.ps $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A post at TechDigits [https://web.archive.org/web/20050311025802/http://techdigits.blogspot.com/2004/12/ups-package-tracking-with-rss.html] | |
* about tracking UPS packages via RSS and web services got me thinking if the same is possible via Javascript and | |
* the XmlHttpRequest object (in IE and Mozilla). Since Google's Gmail and Google Suggest started using that object, | |
* it has become more popular. So after some thinking, I put together the following quick and dirty code snippet | |
* | |
* I don't know how useful this can be since the security information is exposed, but it is a nice hack. | |
*/ | |
req = new XMLHttpRequest(); | |
var strXML = '<?xml version='1.0'?>' + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To compile and run: | |
* | |
* javac -classpath MultiplyPDF.java | |
* java -classpath iText-2.0.8.jar MultiplyPDF | |
* | |
*/ | |
import com.lowagie.text.Document; | |
import com.lowagie.text.DocumentException; | |
import com.lowagie.text.PageSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This script is used to load and unload external SD cards in Palm Pilot | |
# devices that are made available to the OS as a USB drive by CardExport II | |
# program, made by www.softick.com. | |
# | |
# Please make sure that /mnt/usbdrive directory exists and that you have | |
# the usb-storage support in your kernel. You must be root to run this. | |
# | |
# Usage: cardexport {start|stop} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' | |
' Based on column by Walter Mossberg <mossberg@wsj.com>. Check out his | |
' page at http://pctech.wsj.com | |
' | |
Dim strName | |
Dim WshShell | |
Dim strOldTitle | |
Dim strNewTitle | |
Dim intTemp |
NewerOlder