Tuesday, January 29, 2013

Pop- up Window with Dim Background (OnFocus)



Close




You can put anything here :)

Try this by copying the codes below.





+--- This code must place inside the head tags

<script src="http://code.jquery.com/jquery-latest.js"></script>

<script type="text/javascript">

//This is the function that closes the pop-up
function endBlackout(){
$(".blackout").css("display", "none");
$(".msgbox").css("display", "none");
}

//This is the function that starts the pop-up
function strtBlackout(){
$(".msgbox").css("display", "block");
$(".blackout").css("display", "block");
}

//Sets the buttons to trigger the blackout on clicks
$(document).ready(function(){
$("#btn1").click(strtBlackout); // open if btn is pressed
$(".blackout").click(endBlackout); // close if click outside of popup
$(".closeBox").click(endBlackout); // close if close btn clicked

// Automatically trigger the pop-up after 10 seconds
setTimeout( strtBlackout, 10000);
});
</script>

<style type="text/css">

.blackout {
background-color:#000;
opacity:.7;
filter:alpha(opacity=70);
height:100%;
width:100%;
position:fixed;
top:0;
left:0;
z-index:100;
display:none;
cursor:pointer;
}
.msgbox {
background-color:#ccc;
border:1px solid #ccc;
color:#000;
width:30%;
height:30%;
position:fixed;
top:20%;
left:15%;
border-radius:20px;
padding:10px;
z-index:101;
display:none;
margin-left: 20%;
}
.closeBox {
background-color:#CC0000;
color:#FFFFFF;
padding:8px;
float:right;
border-radius:3px;
cursor:pointer;
text-transform:uppercase;

}
</style>


+--- This must place inside the body tags

<input id="btn1" name="submit" type="submit" value="Demo here" />
<div class="blackout">
</div>
<div class="msgbox">
<div class="closeBox">
Close</div>
<br /><br /><br /><br />
<center>
<form action="#" method="post">You can put anything here :)<br />
<label><a href="#">CLICK HERE</a> to add me on FB.</label>
</form>
</center>
</div>

Friday, January 25, 2013

Assembly Code Using 10h for Graphical Display (American Flag)


'just copy the code and paste it on your notepad or command prompt editor (must be inside the directory wherein tasm and tlink IDE located then type this command --->  edit <filename>.asm ) . You can modify it because I think the number of stars on the flag was wrong.

+----------------SAMPLE OUTPUT----------------+

+------------------------------------------------------+


.model small
.stack 100h
.data
        newl db,0ah,0dh,"$"
        line1 db " * * * * * * * * $"
        color1 db "                                       $"
        line2 db " * * * * * * * * $"
        color2 db "                                       $"
        line3 db " * * * * * * * * $"
        color3 db "                                       $"
        line4 db " * * * * * * * * $"
        color4 db "                                       $"
        line5 db " * * * * * * * * $"
        color5 db "                                       $"
        line6 db " * * * * * * * * $"
        color6 db "                                       $"
        line7 db " * * * * * * * * $"
        color7 db "                                       $"
        line8 db " * * * * * * * * $"
        color8 db "                                       $"
        stripes1 db "                                                                        $"
        stripes2 db "                                                                        $"
       

.code
        mov ax,@data
        mov ds,ax

mov ah,9

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line1
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color1
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line2
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color2
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line3
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color3
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line4
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color4
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line5
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color5
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line6
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color6
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line7
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color7
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line8
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color8
int 21h
mov dx,offset newl
int 21h

mov cx,8

meme:
push cx
mov bl,11110000b
mov cx,57
int 10h
mov dx,offset stripes1
int 21h
mov dx,offset newl
int 21h
mov bl,41h
mov cx,57
int 10h
mov dx,offset stripes2
int 21h
mov dx,offset newl
int 21h
pop cx
dec cx
cmp cx,0
je exit
loop meme

exit:
mov ax,4c00h
int 21h
end

ID Generator Using Random (Rnd) in Vb6


'To be placed on the command button

Private Sub GenerateID_Click()
Text2.Text = GenerateCode() '<--- Call by Function
End Sub

'Function code that will do the random pick of numbers to be generated.

Public Function GenerateCode()
    strInputString = "123456789012345678901234567890"
 
    intLength = Len(strInputString)
 
    intNameLength = 5
 
    Randomize
 
    strName = ""
 
    For intStep = 1 To intNameLength
        intRnd = Int((intLength * Rnd) + 1)
 
        strName = strName & Mid(strInputString, intRnd, 1)
    Next
 
    GenerateCode = strName
End Function