Tech Sharing

Tech Sharing

Advertisement

Posts Tagged ‘ Programming ’

For years now, Linux has earned a reputation as a popular platform among IT enthusiasts. It’s attracted everyone from system administrators to experimenting students. Yet, not enough is said about Linux power as a programming platform. Here are five reasons why this open source operating system should be at the top of your list when choosing a development environment.

 


1. It’s Free

No need to fork out a small fortune to buy software or wonder whether your copy is licensed. Linux is free and this makes it practical for budding novices and seasoned gurus alike. 

The fact that it’s free also takes away the pressure to ‘make it work’. When you purchase software, you have a sense of obligation to make sure your investment was not in vain. A free OS gives you the freedom to tap into your programming creativity since you have much less to lose. 

 

2. Easy to Install

An average computer user has never installed an operating system. Some users may not even understand the concept of an OS and would see it as too technical a subject. 

As a programmer though, installation of the OS and applications is a fairly basic skill. You already have the foundation knowledge required to search for an appropriate Linux distro, download the ISO, burn it onto a USB drive, and follow the screen prompts. Installing Linux isn’t much different from installing Windows.

 

3. Tinker at Will

If you’re going to develop your programming skills, you’ll want to take advantage of any chance to put your technical knowledge to the test. Access to source code is one area Linux has a major advantage over proprietary systems such as Windows. From the kernel to the graphical interface, nearly all parts of the Linux OS can be tweaked.

Whereas very few people will attain the ability to understand every aspect of Linux, the freedom to experiment is one of the best ways to learn. Understanding the source code also gives you the background knowledge necessary to build great applications.

 

4. Supports Major Programming Languages

Ruby, Python, Perl, PHP, HTML, CSS, Javascript, Java, C and C++ are just some of the major languages supported by Linux. There are a few disappointments such as Visual Basic which only works on Windows. For the most part though, any language that is not purpose built for a specific OS will work on Linux.

In instances where the language isn’t installed by default, you can obtain the packages from the distro’s repositories.

 

5. Linux Knowledge is a Desirable Skill

Every organization values multi-skilled personnel since this reduces the overall number of persons they need to hire. Whether it’s a programmer knowing how to work with a 1000 ft cat 6 spool or one who has no problem overseeing an enterprise server, extra skills curry favor with potential employers.

If you are looking for a programming job and are keen to have a leg up on other applicants, understanding how Linux works will be an added advantage.

Even if you are already using another development environment, it doesn’t hurt to find out whether Linux is a better fit for your programming needs. You’ll grow your technical skills and save a considerable amount of cash in the long-term. The investment does pay off.

 

 

 

microsoft-powerapps-preview-for-mobile-business-apps-available-now

Microsoft today launched PowerApps, a new service that allows business users to easily create a basic mobile or Web-based app without requiring codes.

Available in preview from today, the idea behind it is to take more business apps to mobile, instead of being tied to the PC as they have been traditionally.

Users can access data from cloud services like Office 365, Salesforce, Dropbox or other on-premises systems through PowerApps and use that information to create their app.

For example, if you export a file from Salesforce tracking employees performance, you could create an app to follow that, instead of exporting and analyzing a file every week.

PowerApps also comes with sample apps and templates, so users don’t have to come up with an a design or layout from scratch.

The apps are designed on a PC and can then be accessed on-the-fly through the PowerApps app for iOS, Android and Windows Phone. Apps can be shared with other people through a URL link and they can collaborate on the project as well.

Microsoft’s Corporate Vice President of app platform Bill Staples said in a statement today that the aim of PowerApps is to bridge the innovation gap in the business apps sector.

And while Microsoft may not be the first to come up with this idea, it’s already at an advantage as one of the most recognizable business brands in the world and as first choice for many in-office software around the globe.

The company has not released pricing information while the service is still in preview.

1. You become the computer repair guy.

Can you fix my computer
Truth: Most of the time you just Google the problem.

2. You suddenly forget how to code because… Stack Overflow is down.

3. When you change one line of code.

When you change one line of code
Advertisement

4. When you try to solve a bug.

Fixed a bug but more bugs come out

5. End user have no idea how to use your software.

end user

6. Critical issue… cannot reproduce.

Can't reproduct bug

7. JavaScript.

8. When your manager thought more developer means faster development.

When manager thought more developer means faster

9. More tasks on Friday afternoon.

More tasks on Friday afternoon

10. Hey can you please add a button before it goes live?

When client wants to change requirements at last minute

11. CSS in a nutshell.

CSS

12. This code looks like crap, let me refactor it.

Code refactoring

13. When you try to fix something else’s code.

When you try to fix something elses code

Congratulations, it’s now your problem!

14. Everyone thought you are a hacker.

Everyone thought you are a hacker

15. When you read other people’s code.

Reading other people's code

16. When you are given 2 days instead of 3. Because you don’t have leadership skills.

When you have 2 days instead of 3.

17. This sums up programming.

Sums up programming

Using web service is one of the good solution when you try to consume 3th party or integrate your system with other system without knowing how their internal logic.

When you try to call the web service for the first time, CF actually will chace the web service by using the web service description (WSDL) that response from the target server to create a java proxy/stub based on that, than it will be reused for the following call from CF to the same web service again.

CF doing that is actually try to improve the performance for the web service calling, but it come with some disadvantage when the target web service being changed by adding a new require parameter or return an extra parameter, your script will trigger an error message, this is because your CF have no knowledge about the new changing make on the target site. It will continue to use the older cached proxy/stub.

To resolved this problem, you may need to manually refresh the cache that created by the CF in the early call to inform CF to refresh it’s cache of that proxy stub.

There are more than 1 way that you can doing that, the following are the sample 4 difference way to achieve the same result:

I. ColdFusion Administrator

CF-Admin-Web-Services-Refresh

 

II. Programatically:

In ColdFusion 8, you have two options:

i. Cfinvoke’s refreshWSDL attribute:

<cfinvoke webservice="#wsdl#" method="method" returnvariable="rv"<br />refreshWSDL="yes"><br />	<cfinvokeargument name="arg" value="1"/><br /></cfinvoke>

 

ii. Cfobject’s arguments structure

<br /><cfscript><br />    wsargs = structnew();<br />    wsargs.refreshwsdl="yes";<br />    somevar = createobject("webservice","http://[server]/webserviceurl]",wsargs);<br />    ...<br /></cfscript><br />

In ColdFusion 7, however, you can use the following solution:

<cfset wsAddress = "http://your.web/service/url.cfc?wsdl"><br /><!--- CF7 ---><br /><cfset createObject("java", "coldfusion.server.ServiceFactory").<br />XmlRpcService.refreshWebService(wsAddress) />

 

 

Merging Two Structs in ColdFusion

By on November 26, 2012

The following script showing how to merge 2 ColdFusion structure into one. The following sample showing 2 difference structure which each has two keys

tech.david-cheong.com

<!--- Struct1 have 2 key: FirstName and Last time --->
<cfset struct1={firstname="Adam" ,lastname="Presley" }>

<!--- Struct 2 have 2 key: FirstName and age --->
<cfset struct2={ firstname="Michael" ,age="33" }>

<!--- Using a nifty ColdFusion method we can mash the two together in a single line of code. --->

<cfset structAppend(struct1, struct2) /> <!--- <cfset struct1.putAll(struct2) /> --->

<cfdump var="#struct1#">

tech.david-cheong.com
Notice the commented out version. That is the underlying method to do the same thing as StructAppend.

tech.david-cheong.com

The structure result after merge


There are always more than single methods to accomplish the same job in programming language. To loop through the letters from A to Z in ColdFusion there are also more than one way, but I personally found out the following 2 methods are simpler and strain forward.

 

Hardcode the A to Z into a list and just loop over it

<cfloop

index=”strLetter”

list=”A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z”

delimiters=”,”>

 

<cfdump var=”#strLetter#”>

 

</cfloop>

 

 

The other way to loop through the letters is using the ASCII value from A to Z. We first convert the A and Z to ASCII, than just use the number to loop through the rest and convert it back to char to get back our result.

 

<cfloop

index=”intLetter”

from=”#Asc( ‘A’ )#”

to=”#Asc( ‘Z’ )#”

step=”1″>

 

<!— Get character of the given ascii value. —>

<cfset strLetter = Chr( intLetter ) />

 

<cfdump var=”#strLetter#”>

 

</cfloop>

 

Please feel free to share the way you usually use or you may found out any other better way to do the job.

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

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.

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.




Currently on running schedule task display



Currently pause scheduled task display



CFMX 6.1 scheduled task display without the pause and resume button




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


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 Filesportecle-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 “jrelibsecurity” directory and might be named “cacerts”

For the ColdFusion 8 default developer install the path will be “c:coldfusion8runtimejrelibsecuritycacerts”

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