programming

HqEclipse

You can install the plugin using the Eclipse Update Manager:

Help > Install new Software
Work with: http://hge.javaforge.com/hgeclipse
[ Add... ]
[ OK ]
check HqEclipse
[ Next > ]
[ Next > ]
check "I accept the terms of the license agreement"
[ Finish ]

confirm Security Warnings dialog with [ OK ]

Restart your Eclipse

https://j2m.googlecode.com/hg/
https://hgeclipse-demo.googlecode.com/hg/

http://code.google.com/p/hgeclipse-demo/

SmartGWT

# install gwt
wget http://smartgwt.googlecode.com/files/smartgwt-2.0.zip -P /tmp
unzip /tmp/smartgwt-2.0.zip -d /usr/share/
 
 
 
 
# create default GWT Project
File > New > Web Application Project
 
Project name:
Smart
 
Package:
smart
 
[ Finish ]
 
 
# add smartGWT
 
Smart > smart > Smart.gwt.xml add to module section:
<inherits name='com.smartgwt.SmartGwt'/>
 
Smart > war > Smart.html add to head section BEVORE first script section
<script>var isomorphicDir = "smart/sc/"</script>
 
# add smartgwt libs
Project > Properties
Java Build Path > Libraries
Add External Jar
/usr

Create GWT-Ext project under NetBeans

copy "js" dir from gwt-ext archive int project web folder
 
Main.gwt.xml
add
        <inherits name="com.gwtext.GwtExt"/>
 
 
welcomeGWT.html
add
        <link rel="stylesheet" type="text/css" href="js/ext/resources/css/ext-all.css" />
        <link id="theme" rel="stylesheet" type="text/css" href="js/ext/resources/css/xtheme-silverCherry.css"/>
        <script type="text/javascript" src="js/ext/adapter/yui/yui-utilities.js"></script>
        <script type="text/javascript" src="js/ext/adapter/yui/ext-yui-adapter.js"></script>
        <script type="text/javascript" src="js/ext/ext-al

MagentoConnector - Connecting to Magento API with Java using SOAP

Hello everybody!
 
I am currently writing a Magento Connector for Java. The goal is to create a free wrapper / library to manage 
Magento informations from a Java application. The latest version (source code) can be downloaded from 
http://code.google.com/p/magja/ If someone is interested in co-development, please contact my over my homepage,
http://www.panticz.de/contact 
 
Greeting
 
Pawel
 
 
How to start:
1. create Magento API role and user
http://www.panticz.de/Create-Magento-SOAP-account
 
2.

Java2Snom

public String getSnomSetting(String phoneIp, String field) {
    String value = "";
 
    try {
        URL url = new URL("http://" + phoneIp + "/settings.htm");
        BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
 
        String inputLine;
        while ((inputLine = in.readLine()) != null) {
            if (inputLine.indexOf(field) == 0) {
                value = inputLine.substring(inputLine.indexOf(":") + 1).trim();
            }
        }
 
        in.close();
    } catch (Exception e) {
        System.out.println("[!] getSnomSetting:" + 

/etc/init.d/fiXorg.sh

#!/bin/sh
 
if [ $(date +%H) -gt 18 ]; then
	echo "activate Xorg ATI" 
	ln -sf /etc/X11/xorg.conf.ati  /etc/X11/xorg.conf
else
        echo "activate Xorg NVIDIA"
	ln -sf /etc/X11/xorg.conf.nvidia  /etc/X11/xorg.conf
fi
 
exit 0
 
 
# chmod +x /etc/init.d/fiXorg.sh
# update-rc.d fiXorg.sh defaults 20

syncStore.sh

#!/bin/bash
 
SERVER=YOUR_STORE.COM
MAIL=YOU@YOUR_DOMAIN.COM
 
 
function create_item_description() {
	# set java classpath
	export CLASSPATH=/media/programme/java/classpath/RitterDefault_lin.jar:/media/programme/java/classpath/ojdbc14.jar
 
	# export descriptions from db
	for i in 2 3 7; do
		java LagerlisteCreator -q "Webshop" "${SERVER}_${i}" > /tmp/${SERVER}_${i}.out
 
		if [ ! $?

Asterisk auto-dial out with Java (asterisk-java)

# configure manager
/etc/asterisk/manager.conf
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0 
 
[manager]
secret=pa55w0rd
permit=0.0.0.0/0.0.0.0
read=system,call,log,verbose,agent,command,user
write=system,call,log,verbose,agent,command,user
 
# create extension
/etc/asterisk/extensions.conf
[directdial]
exten => 1,1,Dial(CAPI/ISDN1/${customernum}/b)
 
# reload asterisk
/etc/init.d/asterisk restart
 
# download java class
wget http://maven.reucon.com/public-snapshot/org/asteriskjava/asterisk-java/1.0.0-SNAPSHOT/asterisk-java-1.0.0-20090303.204542-422.jar
 
# HelloMa

Asterisk

asterisk console
asterisk -r

set output to verbose
core set verbose 10

CLI commands
core show channels
capi show channels
capi info
reload
sip show peers

end / destroy channel
core show channels
soft hangup SIP/XXXXXX

MOH
wget http://downloads.digium.com/pub/telephony/sounds/asterisk-moh-freeplay-wav.tar.gz -P /tmp
tar xzf /tmp/asterisk-moh-freeplay-wav.tar.gz -C /tmp
cp /tmp/fpm-sunshine.wav /var/lib/asterisk/moh/
# extensions.conf
exten => 6000,1,Answer

extractEbook.sh

#!/bin/bash
 
# install
# apt-get install pdftk
 
FILE=$1
PAGES=$2
OUT=$3
 
COVER=/media/lagerliste/vorlagen/ebook/cover.pdf
 
# check if file already exists
if [ -f ${OUT} ]; then
	echo "${OUT} already exists"
	exit 0
fi
 
# get pages
pdftk A=${COVER} B="${FILE}" cat A1 B${PAGES} output /tmp/pdftk.out.pdf
 
# reduce image resolution
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile="${OUT}" -f /tmp/pdftk.out.pdf
 
# view
if [ -n ${DISPLAY} ]; then
	evince "${OUT}"
fi
 
 
# USAGE
# ./mkEbook.sh s02_s201.pdf 1-3  ../ebook/l83_1.1_antike.pdf

Cascading Style Sheets

# transparent image on mouse over (IE too!)
<style type="text/css">
<!--
.content a:hover img {
	filter:alpha(opacity=75); 
	opacity: 0.75;
}
-->
</style>
 
# LINKS
http://www.mandarindesign.com/opacity.html
 
 
 
#content p {
font-family:Palatino,Georgia,'Times New Roman',serif;
font-size:16px;
line-height:1.5em;
margin:0;
padding:0 0 10px;
}

Compile error on Intrepid

/home/pako/xserver-xorg-video-ati-6.6.3# fakeroot ./debian/rules binary
 
mkdir stampdir
>stampdir/stampdir
if [ ! -e stampdir/patches ]; then \
		mkdir stampdir/patches; \
		ln -s stampdir/patches .pc; \
		echo 2 >stampdir/patches/.version; \
	fi; \
	if [ ! -e stampdir/log ]; then \
		mkdir stampdir/log; \
	fi; \
	if [ ! -e patches ]; then \
		ln -s debian/patches patches; \
	fi; \
	>stampdir/prepare
if ! [ `which quilt` ]; then \
		echo "Couldn't find quilt.

Install Drupal SMTP authentication support module

# install SMTP Authentication Support
http://drupal.org/project/smtp
 
download
# old # http://ftp.drupal.org/files/projects/smtp-6.x-1.x-dev.tar.gz
http://ftp.drupal.org/files/projects/smtp-6.x-1.0-beta4.tar.gz
extract
copy smtp /var/www/sites/all/modules
 
# install PHPMailer
http://phpmailer.worxware.com/
 
download
http://downloads.sourceforge.net/phpmailer/phpMailer_v2.3.tar.gz
extract
rename phpMailer_v2.3 to phpmailer (LOWERCASE!)
copy phpMailer/ /sites/all/modules/smtp/
 
 
# Configure
# Enable the SMTP Authentication Support module 
Administer > Site building > Modules

convertToUtf.php

<?php
function convertToUtf($string) {
	$string = str_replace("ü", "ü", $string);
	$string = str_replace("Ü", "Ü", $string);
	$string = str_replace("ö", "ö", $string);
	$string = str_replace("Ö", "Ö", $string);
	$string = str_replace("ä", "ä", $string);
	$string = str_replace("Ä", "Ä", $string);
	$string = str_replace("ß", "ß", $string);
 
	return $string;
}
?>

Create GWT MySQLConn project under Netbeans

# HowTo
1. install Netbeans: http://www.panticz.de/install_netbeans
1.1 install http://www.panticz.de/install-GWT4NB
2. install GWT: http://www.panticz.de/install_gwt
3. install MySQL driver: http://www.panticz.de/install_mysql_driver
4.

OpenOffice Macros with Basic

Create new Macro
Extras > Makros > Makros verwalten > Makro...
Meine Makros > Standard > Neu
 
# open a external application
Sub Main
selectedRow = ThisComponent.CurrentSelection.getRangeAddress.StartRow
itemId = ThisComponent.CurrentController.ActiveSheet.getCellByPosition(0, selectedRow).getString()
 
oSysExecuteService = createUnoService("com.sun.star.system.SystemShellExecute")
oSysExecuteService.execute("/media/programme/starter/scripts/Lager.sh", "item_id=" & itemId, 0)
 
rem MsgBox itemId, 0
rem ThisComponent.CurrentSelection.getString()
End Sub
 
 
 
 
# print file name in 

syncHome.sh

#!/bin/bash
 
USER=pako
TARGET=192.168.1.224
tar zcf - /home/${USER} | ssh root@${TARGET} "cd /home/; tar zpxvf -; chown ${USER}.${USER} -R ${USER}"

Do you like this page? Then support it. Please click the AD below and visit the sponsor. Thank you!

Syndicate content