sobota, sierpnia 12, 2006

IBM też coś ma dla Ciebie, poważnie












IBM, na bazie produktu - serwera aplikacji Java - zakupionej firmy Gluecode proponuje nowy produkt typy "entry" do w miarę bezboleśnego wejścia w świat J2EE. Jest to IBM WebSphere Application Server Community Edition V1.0.1.2 oparty o otwarty projekt Apache Geronimo (Tomcat). Dzięki temu dostajemy gotowca, w pełni zintergrowanego serwera Tomcat z innymi produktami: Log4J, Axis, JAAS wraz z pełnymi narzędziami konfiguracyjnymi. Dobra robota...

Jak SAP z MS

Projekt Mendocino zmienił nazwę na Duet i jest to wspólne przedsięwzięcie między MS i SAP skierowane ku information workers w celu ułatwienia im dostępu z pakietów biurowych MS Office do systemów SAP. "...The product is available from SAP, as of June 28, 2006. Please contact your account executive for more information..."

piątek, sierpnia 11, 2006

IBM da ci dużo (i jeszcze więcej)

IBM napisał konektor (framework) umożliwiający współpracę między aplikacjami napisanymi w Javie (JSP lub czyste servlety)i uruchamianymi w środowisku Websphere Application Server Community Edition a aplikacjami w PHP (<http://www.alphaworks.ibm.com/tech/phpintwasce/download>)
Jak to działa:

Update: August 1, 2006
Updates to the documentation and samples enable easy access to the forum for questions and comments.
What is PHP Integration Kit for WebSphere Application Server, Community Edition?
PHP Integration Kit for WebSphere® Application Server (WAS), Community Edition (CE), allows users to integrate PHP-based scripting into their Java™ 2 Enterprise Edition (J2EE) applications. Integrating these technologies gives programmers the advantages of both PHP and Java, providing greater flexibility in deploying dynamic applications, building Web front ends, and creating development projects.
The PHP Integration Kit provides a sample Web application that can contain Java resources (JSPs and servlets, as with any J2EE Web application) as well as PHP scripts. The sample application is preconfigured to forward each PHP request to a separate PHP run-time environment, which then executes the requested PHP script. Users can then manage the combined Java/PHP application as a single unit within WAS CE: Users can deploy and undeploy the application using the WAS CE administration console and can apply security constraints to both Java and PHP resources using the J2EE security model.
This technology runs on Windows® and Linux® (see Requirements section for details).
How does it work?
The PHP Integration Kit provides a Web application containing a servlet filter that communicates with a PHP run-time environment using the FastCGI interface. Users download and install a PHP run-time environment and any prerequisites, such as MySQL, for their platform, as explained in the PHP Integration Kit's documentation. The user can then package the PHP application and modules using the kit's Web module template, which is preconfigured with the necessary deployment descriptors to invoke the PHP run-time environment and to forward PHP requests to that run-time environment.

Wklejono z <http://www.alphaworks.ibm.com/tech/phpintwasce>

Innym projektem jest klient do WS - narzędzie do testowania usług internetowych IBM Generic Web Services Client Tool
A generic client written in PHP and capable of secure and non-secure calls for use in testing Web services. Date Posted: May 23, 2006
What is IBM Generic Web Services Client Tool?
This tool is designed for testing existing Web services from a Linux®/Apache/MySQL/PHP (LAMP) environment, as well as from WAMP (the corresponding Windows® environment). When given a Web Service Definition Language (WSDL) specification, this tool is capable of secure and non-secure calls when using PHP SOAP (Simple Object Access Protocol) extension, and simple non-secure calls when using NuSOAP.
The interaction consists of a selection of a WSDL and a method within that service, formatted input insertion (as dictated by the WSDL), execution of the method call, and raw (or formatted) display of results.
How does it work?
IBM Generic Web Services Client Tool is a PHP program that runs on an Apache server. It is meant for testing Web services as well as the capabilities of a PHP client. The tool provides both direct and indirect (low-level) calls, using either the PHP5 SOAP extension or the NuSOAP package.
The tool allows the user to select a WSDL. The WSDL is parsed and all available methods are presented for selection. Once a method is selected, a method-specific form is displayed and the user may fill it with the desired values and then execute a method call in several client modes (SOAP or NuSOAP call, direct or low-level call, etc.). The tool presents the call results and other related information.

Świetny portal - http://www-128.ibm.com/developerworks/websphere/downloads/

Można ściągnąć i uruchomić WAS Community Edition http://www-128.ibm.com/developerworks/downloads/ws/wasce/?S_TACT=105AGX10&S_CMP=WESDL

Wihajstry na tapecie

Moda na wihajstry
Coraz więcej firm internetowych (Opera, Yahoo, Google - http://desktop.google.com, Microsoft) wpuszcza internautów w przysłowiowe maliny dając im do ręki wihajstry tzw. Widgets. Wihajstry to potencjalnie bomba zegarowa (koń trojański) umożliwiający wpuszczenie do komputera skryptu w JS, który ma dostęp do wszystkich zasobów lokalnych komputera oraz z definicji również do Internetu. Tym nie mniej pomysł jest ciekawy i podobny do maszyny wirtualnej Javy JVM z Appletem czy też instalacji "grubego" klienta (np. VFP) tylko, że mniej bezpieczny bo niczym nie kontrolowany.

Co może Ci dać Yahoo? Serio...

2006-08-11; 06:45
Na portalu Yahoo dla deweloperów (http://developer.yahoo.com/python/python-rest.html) znajduje się informacje dla twórców nie tylko PHP ale również i Pythona.
Dla fanów JavaScript też jest tam swój kącik http://developer.yahoo.com/javascript/, jak również informacja o wihajstrach (widgets).
Usługi internetowe są zbudowane na wkompilowanej w ten język bibliotece urllib/urllib2. Obsługa autentykacji jest możliwa. Przykład:

import urllib
url = 'http://api.search.yahoo.com/ ContentAnalysisService/V1/termExtraction'
appid = 'YahooDemo'
context = '''
Italian sculptors and painters of the renaissance favored
the Virgin Mary for inspiration
'''
query = 'madonna'
params = urllib.urlencode({
'appid': appid,
'context': context,
'query': query
})
data = urllib.urlopen(url, params).read()

Jeżeli tego mało to można skorzystać z alternatywnej biblioteki (instalowanej oddzielnie)httplib2 (http://bitworking.org/projects/httplib2/).
Opis usług internetowych dla języka Python można znaleźć tu http://diveintopython.org/http_web_services/index.html.
Jest też informacja o tym jak parsować w Pythonie struktury JSON i XML.

czwartek, sierpnia 10, 2006

Page 2 - Datasets in Microsoft.Net

Page 2 - Datasets in Microsoft.Net: "Using C#.Net


string strConn,
strSQL;
strConn = 'Provider=SQLOLEDB;Data Source=(local)\NetSDK;'
+
'Initial
Catalog=Northwind;Trusted_Connection=Yes;';
strSQL = 'SELECT CustomerID,
CompanyName, ContactName, Phone '
+
'FROM
Customers';
OleDbDataAdapter da = new OleDbDataAdapter(strSQL,
strConn);
DataSet ds = new DataSet();
da.Fill(ds,
'Customers');"

HOWTO:AJAX workaround - ITtoolbox Wiki

HOWTO:AJAX workaround - ITtoolbox Wiki:
"function processStateChange(){
statusDiv = document.getElementById('status');
if (req.readyState == 0){ statusDiv.innerHTML = 'UNINITIALIZED'; }
if (req.readyState == 1){ statusDiv.innerHTML = 'LOADING'; }
if (req.readyState == 2){ statusDiv.innerHTML = 'LOADED'; }
if (req.readyState == 3){ statusDiv.innerHTML = 'INTERACTIVE'; }
if (req.readyState == 4){ statusDiv.innerHTML = ' '; }
if (req.readyState == 4){
if (req.status == 200){
response = req.responseText;
destinationDiv = document.getElementById(dest);
destinationDiv.innerHTML = response;
} else {
statusDiv.innerHTML = 'Error: Status '+req.status;
}
}
}
function loadHTML(url, destination){
dest = destination;
if (window.XMLHttpRequest){
req = new XMLHttpRequest();
req.onreadystatechange = processStateChange;
req.open('GET', url, true);
req.send(null);
} else if (window.ActiveXObject) {
req = new ActiveXObject('Microsoft.XMLHTTP');
if (req) {
req.onreadystatechange = processStateChange;
req.open('GET', url, true);
req.send();
}
}
} ... "

The SPS Weblog - Hosting a .NET ActiveX Control in Visual FoxPro

The SPS Weblog - Hosting a .NET ActiveX Control in Visual FoxPro

Calvin Hsia's WebLog : Create a .Net UserControl that calls a web service that acts as an ActiveX control to use in Excel, VB6, Foxpro

Calvin Hsia's WebLog : Create a .Net UserControl that calls a web service that acts as an ActiveX control to use in Excel, VB6, Foxpro: "Create a .Net UserControl that calls a web service that acts as an ActiveX control to use in Excel, VB6, Foxpro"

Mixed up on Internet Explorer - Rick Strahl's WebLog

Mixed up on Internet Explorer - Rick Strahl's WebLog - ciekawe uwagi nt, IE gorzkie slowa ale prawda jest taka, ze wbudowana w OS przegladarka IE jest naprawde potrzebna.

VFP i BLOB-y

Rick Strahl's WebLog
Bob Lucas posted a nice Visual FoxPro 9.0 tip on the Message Board earlier today in respect to how you can get Image values in and out of a SQL Server database and I thought I’d repost this here with a little more information. VFP 9 makes it a lot easier to work with Image/Blob data types than previous versions because it has native support for a binary datatype.

One of the issues in previous versions of VFP has always been talking to SQL Server image\binary data. FoxPro wants to convert any binary data into a General field when it returns it and sending data in has to be done with binary field types. In the past I had some nasty workarounds for this which involved creating a temporary cursor and modifying the general field physically on disk to turn it into a regular binary memo to read the data. I also did this to write the data although writing is actually easier.

Let’s start with VFP 9 because it’s easiest. The sample below uses a wwSQL class which is just a thin wrapper around SQL Passthrough (or a CursorAdapter if the ADO version is used). But you can replace it easily enough with SQLStringConnect and SQLEXEC calls.

CLEAR
DO WCONNECT

oSQL = CREATEOBJECT("wwSQL")
? oSQL.Connect("driver={Sql Server};database=WebStore2;server=.")

*** Create a string with some binary data
lcValue = "TEST ÿ[1]
- String"
? lcValue

*** Convert into a binary value – this works for VFP 8 as well
pcBin = CREATEBINARY(lcValue)

*** Or in 9.0 only:
*lcBin = CAST(lcValue as Blob)
? pcBin

CURSORSETPROP("MapBinary",.F.,0) && MapBinary not required
? oSql.ExecuteNonQuery("update wws_customers set [image] = ?lcBin where pk = 1")

? "Records: " + TRANSFORM(oSQL.nAffectedRecords)
? "Error: " + oSql.cErrorMsg


CURSORSETPROP("MapBinary",.T.,0)
? oSql.execute("select * from wws_customers")

browse
? Image
? CAST(Image as M)

RETURN

This works directly passing the data through the system as blob, which is great since this was a lot more of a pain in previous versions of VFP.

Actually the Update/Insert code above works just fine in VFP 8 (and probably earlier) if you remove the CursorSetProp call. CreateBinary creates a binary string and VFP detects the binary string and properly updates the Image field in the database even in 8.0.

However, reading binary data in 8.0 is another story. The only way I managed to do this, was to use this nasty code:

FUNCTION ReadBinaryField
LPARAMETERS lcField,lcTable,lcWhereClause
LOCAL lcTFileName, lcFileName, lcAlias, lcResult,llField, lnResult

IF EMPTY(lcWhereClause)
lnResult = this.Execute("select " + lcField + " from " + lcTable)
ELSE
lnResult = this.Execute("select " + lcField + " from " + lcTable + " where " + lcWhereClause)
ENDIF

IF lnResult < 1
RETURN ""
ENDIF

lcTFileName = SYS(2023) + "\" + SYS(2015) + ".dbf"
lcFileName = DBF()
lcAlias = ALIAS()

*** Copy out the data - cursor deletes automatically
COPY TO (lcTFileName)

*** Close the cursor
SELECT (lcAlias)
USE

* Change the flag in the general field
llFile = fopen(lcTFilename,12)
fseek(llFile,43)
fwrite(llFile,'M')
fclose(llFile)

*** Reopen the copied file
USE (lcTFileName) ALIAS __TImage EXCL

*** Retrieve the binary field value
lcResult = EVAL("__Timage." + lcField)

*** Close and Erase the temp file
USE
ERASE (FORCEEXT(lcTfileName,"*")

IF !EMPTY(lcAlias)
SELECT (lcAlias)
ENDIF

RETURN lcResult

So you can imagine it’s nice to be able to pull image data directly as part of a SQL Statement rather than going through all of this rigamarole. I hadn’t tried this but I think the CursorAdapter with an ADO data source also may have been able to pull the data out in VFP 8.

VFP9's support for a binary data type is the main reason this is much easier in 9.0 - a lot of features have been adjusted to take advantage of the new binary type including better support for some ActiveX controls that feed binary data back from their methods.

Now if they only could have done the same thing and have provided us with a Unicode type...

Co daje Yahoo deweloperom?

W artykule Build powerful Web applications via the Yahoo! Developer Network jest informacja o solidnym frameworku do tworzenia aplikacji internetowych udostepnianego na zasadach licencji BSD przez znana firme Yahoo (http://developer.yahoo.com/). Szczególnie interesująco wygląda sprawa GUI - (http://developer.yahoo.com/yui/index.html) oraz wzorców projektowych (http://developer.yahoo.com/yui/index.html). Dodatkowo można tworzyć tzw. wihajstry (widgest) - wtyczki do przeglądarki internetowej.