Categories
Teaching course

JavaScript: convert String to Hex code

Below function takes parameter as string and provide result in the form of Hex code. function hexEncoderFun(str) { var result = ”; for (var i=0; i<str.length; i++) { result += str.charCodeAt(i).toString(16); } return result; }

Categories
Teaching course

Part- 2 Illustrator Scripting Creating folder using Javascript

Below is the code that will create a folder using javascript in illustrator script. Suppose there is dir variable selected by user. (as shown here) For MAC OS path= dir.fsName;new Folder(path+”/White”).create(); For WINDOWS OS path= dir.fsName;new Folder(path+”\\White”).create(); For different operating system in full path above is the code to create folder correctly. see the difference […]

Categories
Teaching course

Media Queries for standard devices

@media only screen and (min-device-width : 320px) and (max-device-width : 480px) { } /* Smartphones (landscape) ———– */ @media only screen and (min-width : 321px) { } /* Smartphones (portrait) ———– */ @media only screen and (max-width : 320px) { } /* iPads (portrait and landscape) ———– */ @media only screen and (min-device-width : 768px) […]

Categories
Teaching course

Computer Architecture and Assembly Language [ Irvine32.inc ]

Assembly Language Program taking user input and displaying on screen. section .bss ;data num1 resb 5 num2 resb 5 section .data msg db ‘ Elementary Arithmetic’, 0xa ;string to be printed len equ $ – msg ;length of the string breakLine db ” “, 0xa lenBreakLine equ $ – breakLine msg2 db “Enter 2 numbers, […]

Categories
Teaching course Tips and Guides

LMC – Little Man Computer Program – List largest

Here is  a program that reads three values as input and output these numbers in order from largest to smallest. INP STA 91 INP STA 92 INP STA 93 LDA 92 SUB 91 BRP STEP2 LDA 92 STA 99   LDA 91   STA 92 LDA 99 STA 91 STEP2 LDA 93 SUB 92 BRP […]

Categories
Teaching course

caspio Programing

Here is some code snippet to replace <br> to <p> tag in CKEDITOR Below code will convert the normal textarea to ckeditor and will replace the breakline tag to paragraph tag on pressing enter. <script type=”text/javascript” src=”https://c0abg481.caspio.com/scripts/CKEditor/ckeditor.js” ></script><script type=”text/javascript”> CKEDITOR.editorConfig = function( config ) { config.toolbarGroups = [ { name: ‘document’, groups: [ ‘mode’, ‘document’, […]