In: PHP Programming
30 Aug 2010I have been banging my head for the past few days trying to get the API working for a feature on a website I am working on. It’s a document management application with lots of stuff in it. I am working on a way for users to send their documents directly to the fax machines of their choice.
I came up with a basic class wrapping the API and it looks elegant. The response from the server is pure HTML with weird response code and response description in it, which makes my life a little difficult to parse the request. They should have at least made it XML or much better yet JSON. But I was able to get past that trouble which leads me to the next problem – ‘Posting Binary Data using CURL’
I figured I could put all the documents on a PDF file and send it to the server instead of calling the service per document. The samples on the API documentation is using GET method to post data on the server and it is using text read from a text file which contains allowable data to pass on the querystring.
‘file1=file.txt&data1=encodeddatafromthetextfile’
In: Java Programming
22 Aug 2010I really thought this one does not exist. But apparently this one has been around for ages. With the latest JDK (Java Development Kit) and the ideas that’s all playing in my mind, it leads me to the discovery of what is called ‘LiveConnect’.
To put this into action, i have made a small applet to demonstrate how it works
Code:
private JSObject win;
public void init() {
win=JSObject.getWindow(this);
// get the DOM instance only here and not any where else.
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
}
});
txtCode.setLineWrap(true);
} catch (Exception ex) {
ex.printStackTrace();
}
}
In: Java Programming
4 Aug 2010A month ago, i started my undertaking in the world of Java Programming. When i was still in the early development, i have never encountered this exception ClassNotFoundException. It was because i have never used packages to organize my classes. Turns out, you have to call the main class in its full qualified path like this.
<APPLET id="applet" ARCHIVE="MyApp.jar"
CODE="com.genusproject.app.myapp.class"></APPLET>
where “com.genusproject.app” is the package name where ‘myapp.class’ resides.
Q: What if i have multiple libraries that the app is dependent on? Simple, add it on the archive tag. Separate with comma. Remember if it is located on a folder, you have to also include the folder path. Ex: lib/Mylibrary.jar
<APPLET id="applet" ARCHIVE="MyApp.jar,Mylibrary.jar"
CODE="com.genusproject.app.myapp.class"></APPLET>
The example above is just ‘ONE’ of the many possible reason why your class is not loaded. It might be that the applet is being block by a firewall, or maybe the privacy settings in your browser and other stuff which i have not experienced yet. The solution above applies only to that problem with not calling the full qualified package name of the class.
I am really excited with what is going on at XDA regarding booting Android from Windows mobile (Particularly HTC HD2 device). I have been following the development of this challenging task. It was a few months ago (if i am not mistaken), that porting android to HTC HD2 is a little difficult because of some issue with Snapdragon CPU and the linux boot tool HaRET. Well, apparently this issue has been resolved and a lot of things are working now.
In fact i am using the latest build of Android codenamed “Froyo” on a regular basis without any issue at all. (using the latest kernel from the links i will post below)
One of the features I loved with using jQuery is the event handlers and its implementation. For me it is clear-cut and easy to learn when you put It in action.
1. bind()
The code below registers the element with an ID of ‘selector’ to handle the event ‘click’. We usually call this as ‘listen’. The element is particularly listening for a click event on itself. Once the event has happen or we usually call it ‘triggered’ the code block inside will be executed. To access the element and it properties from inside the block, you can use ‘this’. Remember ‘this’ is not wrapped with all the jQuery functions yet. So if you need to perform jQuery functions again on that element you have to wrap it $(this) . In my example, I am merely accessing the property ID of the element so there is no need for me to use jQuery to perform such effortless task.
Disadvantage:
The bind function works only on existing elements on the DOM tree. If you have remove an element with an event handler registered on it and afterwards recreate it again (at runtime) you will have to rebind or re register the event handler on that particular element again. (of course because this is a newly created element on the DOM tree)
$('#selector').bind('click', function(event) {
//code here. To access the current element
//being targeted use the keyword (this)
alert(this.id); //returns the string ‘selector’
});
In: Uncategorized
23 Apr 2010I have had the opportunity to install a SSL certificate over a production server using Linux/Apache and PHP. It was my first time to install it on a linux machine running apache so initially I have no clue how to do it. Situation like this doesn’t prevent me from not doing it but I usually commit to them to learn. Just as I have anticipated, I have learned a few lessons. One of them is: Do not lose that KEY!!!
When you install a SSL certificate over a server, you have to generate a CSR or Certificate Signing Request. A CSR is an application to obtain the certificate itself. This application is sent to a Certificate Signing Authority where you want to purchase the Digital Identity Certificate or the SSL certificate. I’m sure most of you knows what an SSL already, but to those who don’t:
“SSL (Secure Sockets Layer) is the standard security technology for establishing an encrypted link between a web server and a browser. This link ensures that all data passed between the web server and browsers remain private and integral. SSL is an industry standard and is used by millions of websites in the protection of their online transactions with their customers.”
Read the rest of this entry »
Advantage of loading external “Page Specific CSS and JavaScript”.
Inline, embedding and External.
Inline styling is the most basic type of styling elements in a page. It’s direct and straightforward. Though they provide the highest priority in the cascade, they pose a huge problem with manageability of the codes and they are only specific to the element they are found. While embedding resolves the problem of redundancy in declaration of style, embedding styles on a page still lack the solution of overall code manageability.
Read the rest of this entry »
I was working with a website recently (rossnut.com) thats sells items on the web. One of the core functionality i was working with is the shopping cart. it was an upgrade from ASP 3.0 to ASP.NET 3.5. One of the things i am excited about sharing is Working with SSL and how to aquire a trial SSL certificate for local development.
What is SSL and what role does it play on eCommerce?
SSL (Secure Sockets Layer) is a protocol or mode of communication between devices in a secure manner. By default it uses port 443 as http uses port 80. Secure means all data communication between the server and the client will be encrypted/decrypted so data will be obscured from a hacker sniffing on the network for sensitive information. SSL is never meant to be used on all of your webpages. It is only meant to be used on part of your webpages that requires users to input their sensitive information like credit card information. This way, when a user know that their privacy is not threatened by explaining to them that their sensitive information is encrypted upon submission, a relationship of trust is established between you as a merchant and your users as the customers. Trust is very important in doing eCommerce. Customers may like what you sell on your website but they may be overshadowed by doubt if they do not know who you are or what your reputation is as a seller. Somehow you will need proof to vouch for your integrity. Thats where SSL Certificates comes in.
What is SSL Certificate, how it works and how do you aquire them?
Read the rest of this entry »
In: PHP Programming
26 Mar 2009I think this is very interesting information to post. Earlier this morning a friend of mine was troubleshooting things about loading and reading an XML document from a remote web service. The problem was when he tries to retrieve a nodelist by using an xpath expression, the children of each nodelist is not returning the correct object or data which is expected. Okay, i know that sounds like “Uhhh what?”. To give you a clear idea of what is going on here take a look at those several visualizations below.
Read the rest of this entry »
Well its been a long time. I should punish myself for not writing something that could be in any way helpful to other individuals with enthusiasm on web development particularly web programming. All my write ups are all based on my experiences as i encounter specific problems or if i notice a redundancy in my coding. I do this to share my experiences and how i presented myself with a better solution to these problems that could lessen the code or to create a more “reusable” code(s).
One of the recent projects i was working on was an AJAX based (mostly) interface. When it comes to javascript, i usually use jQuery to do the job. So you might notice the examples later will be on jQuery format. jQuery is a javascript framework that does mostly the tedious javascript coding for you. For example
var elem=document.getElementById("id");
in jQuery we can translate that to
var elem=$('#id');
There are too many reasons why i used jQuery and this is not the article that will elaborate on it . My goal is plainly to inform you that events handling in javascript is very fun when you do it in jQuery. (I’m not implying on other JS framework as boring :p).
So, here it is.. Read the rest of this entry »
Blogsite that talks about web Programming experiences,techniques and ideas for ASP,PHP,ASP.NET,Javascript and a little bit of JAVA and Mobile Development.