Tech Sharing Blog

Computer knowledge, news, product, SEO, earn money online sharing place

Advertisement

Posts Tagged ‘ Programming ’

Useful Coldfusion Resources

By on November 24, 2011

This list is intended for developers new to ColdFusion, or to developers already using CF but looking for additional resources or information.

Adobe ColdFusion Resources

 

ColdFusion Documentation

 

Essential Resources

 

ColdFusion IDEs

 

Open Source CFML Engines

 

MVC Frameworks

 

ORM and Dependency Injection Frameworks

Popularity: 1% [?]

This TEDTalk was given by Thomas Suarez at TEDxManhattanBeach. Thomas is in the 6th grade at a middle school in the South Bay, and he’s made several apps for the App Store and established his own company,CarrotCorp.

 

Besides his fantastic presentation skills, Thomas is an amazing testament to how the younger generation is shaping the world of technology. What a smart kid. Steve Jobs would be very proud.

 

And we’re downloading his app, Bustin Jieber, as we speak. It looks fun.

Popularity: 1% [?]

Pausing scheduled tasks in CF8

By on January 14, 2011


This is a pretty good function for CF8 administrator where you can pause your schedule task whenever you like to. Not like the previous version of Coldfusion where the administrator only can only edit or delete the scheduled task.


With this function exists, you can pause it wihtout editing anything like what you did last time by changing the url to something else or change to date to expire the scheduled task.




Running schedule task Pausing scheduled tasks in CF8

Currently on running schedule task display



Pause schedule task Pausing scheduled tasks in CF8

Currently pause scheduled task display



Cfmx schedule task Pausing scheduled tasks in CF8

CFMX 6.1 scheduled task display without the pause and resume button




Popularity: 1% [?]

Last whole week working with a project which involve the integration with 3th party API through the HTTPS secure channel using coldfusion CFHTTP. I come across with the following error message:


I/O Exception: peer not authenticated

coldfusioncerterror Import the server or CA certification in coldfusion server


Try to Google it for some time and find out that I need to import the 3th party certificate into my Coldfusion server by using some keytool certificate import tools. Trying few times but still can’t get it work until I found a blog which showing a very effective way and free tools for import the certificate.


These instructions are for Windows based machines but the concepts and tools should work on Mac or Unix based platforms.


1. Install tools

Download and install Portecle JVM certificate manager

(portecle-1.5.zip) You do not need the source (src) version

https://sourceforge.net/projects/portecle

The easiest way to install Portecle is to unzip the contents of the zip file to a directory such as C:\Program Files\portecle-1.5\ Then find the file “Portecle.jar”, right click it and send it to your desktop as a shortcut. You can then use this shortcut to launch Portecle. (optionally you can also change the name of the shortcut and change the icon to use the portecle.ico file for the icon)


2. Extract the certificate

The easy way to get the certificate is ask from the issuer, but if you unable to do so, you may have another alternative solution which you open the https page in your browser and double click on the lock logo at bottom left of the browser (the lock appear just beside the url addrss for Google Chrome)


Double click on the lock –> click the certificate information button –> go to details –> click the copy to file button –> Follow the wizard and select the base-64 encoded X.509 (.cer) format –> save the file


3. Install Certificate to Java Virtual Machine and/or ColdFusion server

Start Portecele.

On the [File] menu, select [Open Keystore File] navigate to and locate the keystore you are interested in.

For many java installations this will be located in your “jre\lib\security” directory and might be named “cacerts”

For the ColdFusion 8 default developer install the path will be “c:\coldfusion8\runtime\jre\lib\security\cacerts”

You will have to enter the password for the keystore. The default password is “changeit”


Now you are ready to import the key.

From the [Tools] menu select [Import Trusted Certificate]

Navigate to and locate the certificate you saved and click [Import]

You will need to reenter the keystore password.

You can change the alias if you desire but I would recommend leaving it as the default

Note: You may also be prompted to “trust” the certificate.


Click on the save button at the top of the portecle


4.       Restart you Java Virtual Machine/coldfusion application server.

For ColdFusion not installed on top of JRun you just need to restart the ColdFusion service. If you are running on top of JRun you also need to restart JRun.


Up to now, you already successfully import your partner certificate to your coldfusion/java server.


Please feel free to leave your suggestion if any. Click here for more information regarding Protecle

Popularity: 2% [?]


Google for long time regarding how to hide the HTTP header for IIS in order to mask the server identity and finally found out this tools call URLScan.
Basically URLScan is an ISAPI filter that allows Web site administrators to restrict the kind of HTTP requests that the server will process. By blocking specific HTTP requests, the URLScan filter prevents potentially harmful requests from reaching the server and causing damage.
Actually most of the features that provided by URLScan are included in IIS but not the Remove Server Header features as microsfot find out that this is not an important issue that that’s no real security benefit of include in IIS. But that’s some marketing purposes why microsoft not encourage web master to hide the identity.

How to hide the IIS identity:

  1. download the URL scan
  2. Install the URL scan in your server.
  3. go to the URLScan config file at C:\WINDOWS\system32\inetsrv\urlscan\UrlScan.ini
  4. Change RemoveServerHeader=1 (by default is 0)
  5. Save the file
  6. Restart your IIS
  7. Check on your header (http://www.rexswain.com/httpview.html)
For more detail on the URLScan and the features, you may easily get a lot of information by Google on URLScan



Popularity: 1% [?]

HTML table word wrap

By on September 21, 2009

I created a table to display a link which consist of a long verification code plus some variable to pass to the web site. There is no any space within the long url and query string. This is not the problem, the problem is on my table, because of the link is in one long string without any space, so when it display on the screen, the table is expanded.


I come across few solution, some people suggest that using the javascript to split the string in to 2 or more row when it excess the string lenght limit. I don’t think this is the best solution, and finally get the solution of control the table using the CSS.


WORD-BREAK:BREAK-ALL;

Syntax:

<table style=”word-wrap: break-word;” width=100>
     <tr>
          <td>long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_string</td>
    </tr>
</table>

Popularity: 1% [?]

Get the array lenght in Coldfusion

By on September 4, 2009

When dealing with array, we cannot run away for looping. Because only with looping, you can cut short your hard coded script to read the value from array. And also you no need to worry about the dynamic of array.


Arraylen is the function that determines the number of elements in an array.


The syntax is ArrayLen(array)


Code

<!— Assigning value into 3D array —>

<cfset ResultsArray[1][1][1] = ‘a’>
<cfset ResultsArray[1][1][2] = ‘b’>

<cfset ResultsArray[1][2][1] = ’3′>
<cfset ResultsArray[1][2][2] = ’4′>

<cfset ResultsArray[2][1][1] = ‘z’>
<cfset ResultsArray[2][1][2] = ‘x’>

<cfset ResultsArray[2][2][1] = ‘m’>
<cfset ResultsArray[2][2][2] = ‘p’>

<cfset ResultsArray[3][1][1] = ‘ww’>
<cfset ResultsArray[3][1][2] = ‘xx’>

<cfset ResultsArray[3][2][1] = ’22′>
<cfset ResultsArray[3][2][2] = ‘cc’>


<!— Read the array lenght for 1st D, 2nd D, and 3th D —>
<cfoutput>
#ArrayLen(ResultsArray)#<br> <!— Get the lehgth of 1st D —>
#ArrayLen(ResultsArray[1])#<br><!— Get the lehgth of 2nd D —>
#ArrayLen(ResultsArray[1][1])#<br><!— Get the lehgth of 3th D —>
</cfoutput>



Popularity: 1% [?]

There is always the good way to prevent and verify the using enter data, especially for each text box or text area.


The following is script use the event object to check on the key code that the user enter, return false to prevent user to enter.


Disabled space to be enter in javascript

onKeypress=”if (event.keyCode == 32) event.returnValue = false;”


Sample:


Only allow number and . to be enter in javascript

onkeypress=”if (event.keyCode < 47 || event.keyCode /> 57) event.returnValue = false;”


Sample:

Popularity: 1% [?]

database symbol Convert varchar into math calculationI try to google, call, msn my friend to find out the solution when I stay back in my office until late night yesterday. But still no luck after few hours of trying.


Thinking of gave up when back to office this morning, but one of my friend suddently send me the solution via MSN. That’s the best present I received by today. I’m not sure how many people will looking for this kind of solution, but any way, will post here to share with all and you may take it if you need it.


Basically the idea is that you put all your select, update or delete statment into the variable and use the execute command to execute the whole variable.

My problem:

I have a formula store in a table which is A+B*C+D. My A = 1, B=2, C=3, D=4.


I managed to replace all my variable with the integer using cursor (This maybe not a good solution, but this is not the main discussion in this post)


The finally answer I get is 1+2*3+4. But the bad thing is in the varchar datatype. I only manage to disply 1+2*3+4 but not the answer of 11.


The solution as below:


Declare @MathFomula Varchar(100)

Set @MathFormula = ’1+2*3+4′

Exec(‘SELECT ‘ + @MathFormula  + ‘ AS Result’


Output: 11


* Remember that * and / will calculate at first before + and -


execute math in sql Convert varchar into math calculation


Popularity: 3% [?]

Normally to get the number of row for a particular table, where we will do is as the following query:


select count(*) from Table_name


Yes, you may get your result very fast if your table is very small, but if your table is more then 100k rows, then you may face some delay on that. What the above query do is actually it run the full table scan to get the row count. The scaning can be Logically or Physically. Logically mean that the SQL server only scan from the catch memory, whereas physically scan mean that it really scan through your table.


Actually there is anther alternative way to get the total row count for a table. You can ultilize the sysindexes system table for this purpose.


There is ROWS column in the sysindexes table. This column contains the total row count for each table in your database. So, you can use the following select statement instead of above one:


SELECT rows
FROM sysindexes
WHERE id = OBJECT_ID(‘table_name’) AND indid < 2


There are physical read and logical read operations. A logical read occurs if the page is currently in the cache. If the page is not currently in the cache, a physical read is performed to read the page into the cache. To see how many logical or physical read operations were made, you can use SET STATISTICS IO ON command.


The example:

SET STATISTICS IO ON

GO

SELECT count(*) FROM tbTest

GO

SELECT rows FROM sysindexes WHERE id = OBJECT_ID(‘tbTest’) AND indid < 2

GO

SET STATISTICS IO OFF

GO





Result:

———–

10000


(1 row(s) affected)


Table ‘tbTest’. Scan count 1, logical reads 32, physical reads 0, read-ahead reads 0.

rows

———–

10000


(1 row(s) affected)


Table ‘sysindexes’. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.






Popularity: 1% [?]

SEO Powered by Platinum SEO from Techblissonline