Tutorialspoint

Clojure example2 agent

(ns clojure.examples.example
   (:gen-class))
(defn Example []
   (def counter (agent 0))
   (println @counter))
(Example)

Foundation Flex Grid Responsive Adjustments

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      
      <title>Foundation Template</title>
      <link rel = "stylesheet" href = "css/foundation.css" />
      
      <script src = "js/vendor/jquery.min.js"></script>
      <script src = "js/foundation.min.js"></script>
   </head>

   <body>
      <h2>Example of Flex Grid</h2>
      
      <div class = "row">
         <div class = "small-6 large-expand columns" style = "background-color:#8BD6EE;">
            First column
         </div>
         
         <div class = "small-6 large-expand columns" style = "background-color:#C0B0F0;">
            Second column
         </div>
         
         <div class = "small-6 large-expand columns" style = "background-color:#8BD6EE;">
            Third column
         </div>
         
         <div class = "small-6 large-expand columns" style = "background-color:#C0B0F0;">
            Forth column
         </div>
         
         <div class = "small-6 large-expand columns" style = "background-color:#8BD6EE;">
            Fifth column
         </div>
         
         <div class = "small-6 large-expand columns" style = "background-color:#C0B0F0;">
            Sixth column
         </div>
      </div>
      
   </body>
</html>

Clojure agent

(ns clojure.examples.example
   (:gen-class))
(defn Example []
   (def counter (agent 0))
   (println counter))
(Example)

Foundation Flex Grid Advanced Sizing

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      
      <title>Foundation Template</title>
      <link rel = "stylesheet" href = "css/foundation.css" />
      
      <script src = "js/vendor/jquery.min.js"></script>
      <script src = "js/foundation.min.js"></script>
   </head>

   <body>
      <h2>Example of Flex Grid</h2>
      
      <div class = "row">
         <div class = "small-5 columns" style = "background-color:#8BD6EE;">Small 5 columns</div>
         <div class = "columns" style = "background-color:#C0B0F0;">Expanded columns</div>
         <div class = "columns" style = "background-color:#8BD6EE;">Expanded columns</div>
      </div>
      <br/>
      
      <h2>Shrink column</h2>
      
      <div class = "row">
         <div class = "shrink columns" style = "background-color:#FF6347;">
            Shrink column
         </div>
         
         <div class = "columns" style = "background-color:#7B68EE;">
            Expanded columns
         </div>
      </div>
   
   </body>
</html>

Clojure agent program

(ns clojure.examples.example
   (:gen-class))
(defn Example []
   (def counter (agent 0))
   (println counter))
(Example)

Foundation Flex Grid Basics

<!DOCTYPE html>
<html>
   <head>
      <title>Foundation Template</title>
      
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
      
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
   </head>

   <body>
      <h2>Example of Flex Grid</h2>
      
      <div class = "row">
         <div class = "small-4 columns" style = "background-color:#8BD6EE;">Small 4</div>
         <div class = "small-4 columns" style = "background-color:#FF6347;">Small 4</div>
         <div class = "small-4 columns" style = "background-color:#8BD6EE;">Small 4</div>
      </div>
      
      <div class = "row">
         <div class = "medium-6 large-9 columns" style = "background-color:#C0B0F0;">
            Medium 6/ Large 9
         </div>
         
         <div class = "medium-6 large-3 columns" style = "background-color:#7B68EE;">
            Medium 6/ Large 3
         </div>
      </div>
   
   </body>
</html>

Assembly Memory Management

asm

section	.text
   global _start         ;must be declared for using gcc
	
_start:	                 ;tell linker entry point

   mov	eax, 45		 ;sys_brk
   xor	ebx, ebx
   int	80h

   add	eax, 16384	 ;number of bytes to be reserved
   mov	ebx, eax
   mov	eax, 45		 ;sys_brk
   int	80h
	
   cmp	eax, 0
   jl	exit	;exit, if error 
   mov	edi, eax	 ;EDI = highest available address
   sub	edi, 4		 ;pointing to the last DWORD  
   mov	ecx, 4096	 ;number of DWORDs allocated
   xor	eax, eax	 ;clear eax
   std			 ;backward
   rep	stosd            ;repete for entire allocated area
   cld			 ;put DF flag to normal state
	
   mov	eax, 4
   mov	ebx, 1
   mov	ecx, msg
   mov	edx, len
   int	80h		 ;print a message

exit:
   mov	eax, 1
   xor	ebx, ebx
   int	80h
	
section	.data
msg    	db	"Allocated 16 kb of memory!", 10
len     equ	$ - msg

Foundation Block Grid

<!DOCTYPE html>
<html>
   <head>
      <title>Foundation Template</title>
      
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
      
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
   </head>

   <body>
      <h2>Block Grids</h2>
      
      <div class = "row small-up-2 medium-up-3 large-up-4">
         <div class = "column">
            <img src = "/foundation/images/foundation-the-grid/birds.jpg" class = "thumbnail" alt = "Block Grids">
         </div>
         
         <div class = "column">
            <img src = "/foundation/images/foundation-the-grid/birds.jpg" class = "thumbnail" alt = "Block Grids">
         </div>
         
         <div class = "column">
            <img src = "/foundation/images/foundation-the-grid/birds.jpg" class = "thumbnail" alt = "Block Grids">
         </div>
         
         <div class = "column">
            <img src = "/foundation/images/foundation-the-grid/birds.jpg" class = "thumbnail" alt = "Block Grids">
         </div>
         
         <div class = "column">
            <img src = "/foundation/images/foundation-the-grid/birds.jpg" class = "thumbnail" alt = "Block Grids">
         </div>
      </div>
   
   </body>
</html>

Foundation Source Ordering

<!DOCTYPE html>
<html>
   <head>
      <title>Foundation Template</title>
      
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
      
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
   </head>

   <body>
      <h2>Source Ordering</h2>
      
      <div class = "row">
         <div class = "small-5 small-push-7 columns" style = "background-color:#8BD6EE;">
            Small push class
         </div>
         
         <div class = "small-7 small-pull-5 columns" style = "background-color:#C0B0F0;">
            small pull class
         </div>
      </div>
      
      <div class = "row">
         <div class = "large-2 large-push-10 columns" style = "background-color:#808000;">
            Large push class
         </div>
         
         <div class = "large-10 large-pull-2 columns" style = "background-color:#FF6347;">
            Large pull class
         </div>
      </div>
      
      <div class = "row">
         <div class = "medium-9 medium-push-3 columns" style = "background-color:#C0B0F0;">
            Medium push class
         </div>
         
         <div class = "medium-3 medium-pull-9 columns" style = "background-color:#8BD6EE;">
            Medium pull class
         </div>
      </div>
   
   </body>
</html>

Assembly Macros

asm

; A macro with two parameters
; Implements the write system call
   %macro write_string 2 
      mov   eax, 4
      mov   ebx, 1
      mov   ecx, %1
      mov   edx, %2
      int   80h
   %endmacro
 
section	.text
   global _start            ;must be declared for using gcc
	
_start:                     ;tell linker entry point
   write_string msg1, len1               
   write_string msg2, len2    
   write_string msg3, len3  
	
   mov eax,1                ;system call number (sys_exit)
   int 0x80                 ;call kernel

section	.data
msg1 db	'Hello, programmers!',0xA,0xD 	
len1 equ $ - msg1			

msg2 db 'Welcome to the world of,', 0xA,0xD 
len2 equ $- msg2 

msg3 db 'Linux assembly programming! '
len3 equ $- msg3

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.