Skip to content

Commit 42d016b

Browse files
committed
Merge branch 'master' of github.com:anitshrestha/practise
2 parents a234d3a + 5b9a40f commit 42d016b

10 files changed

+212
-2
lines changed

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
*.svn/*.*
23+
24+
# Logs and databases #
25+
######################
26+
*.log
27+
*.sql
28+
*.sqlite
29+
30+
# OS generated files #
31+
######################
32+
.DS_Store
33+
.DS_Store?
34+
._*
35+
.Spotlight-V100
36+
.Trashes
37+
Icon?
38+
ehthumbs.db
39+
Thumbs.db

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
practise
2+
========
3+
4+
this repo contains the things that i have practise.

basic_crud_singleton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Basic_CRUD {
88
function __construct() {
99
//to test if singleon pattern ahs been implemented or not.
1010
//DB::get()->handle();
11-
DB::get();
11+
DB::geat();
1212
}
1313

1414
function insert_CRUD($post_variables = "") {

dom_traversing_I.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
b, span, p, html body {
6+
padding: .5em;
7+
border: 1px solid;
8+
}
9+
b { color:blue; }
10+
strong { color:red; }
11+
</style>
12+
<script src="http://code.jquery.com/jquery-latest.js"></script>
13+
</head>
14+
<body>
15+
<div>
16+
<p>
17+
<span>
18+
<b>My parents are: </b>
19+
</span>
20+
21+
</p>
22+
</div>
23+
<script>
24+
var parentEls = $("b").parents()
25+
.map(function () {
26+
return this.tagName;
27+
})
28+
.get().join(", ");
29+
$("b").append("<strong>" + parentEls + "</strong>");
30+
31+
</script>
32+
33+
</body>
34+
</html>

dom_traversing_II.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
6+
p, div, span {margin:2px; padding:1px; }
7+
div { border:2px white solid; }
8+
span { cursor:pointer; font-size:12px; }
9+
.selected { color:blue; }
10+
b { color:red; display:block; font-size:14px; }
11+
</style>
12+
<script src="http://code.jquery.com/jquery-latest.js"></script>
13+
</head>
14+
<body>
15+
<p>
16+
<div>
17+
<div><span>Hello</span></div>
18+
<span>Hello Again</span>
19+
20+
</div>
21+
<div>
22+
<span>And Hello Again</span>
23+
</div>
24+
</p>
25+
26+
<b>Click Hellos to toggle their parents.</b>
27+
<script>
28+
function showParents() {
29+
$("div").css("border-color", "white");
30+
31+
var len = $("span.selected")
32+
.parents("div")
33+
.css("border", "2px red solid")
34+
.length;
35+
//alert(len);
36+
$("b").text("Unique div parents: " + len);
37+
}
38+
$("span").click(function () {
39+
$(this).toggleClass("selected");
40+
showParents();
41+
});</script>
42+
43+
</body>
44+
</html>

dom_traversing_III.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
ul { float:left; margin:5px; font-size:16px; font-weight:bold; }
6+
p { color:blue; margin:10px 20px; font-size:16px; padding:5px;
7+
font-weight:bolder; }
8+
.hilite { background:yellow; }
9+
.hilite_sib { background:red; }
10+
</style>
11+
<script src="http://code.jquery.com/jquery-latest.js"></script>
12+
<script language="javascript">
13+
function showParents() {
14+
$("div").css("border-color", "white");
15+
16+
var len = $("span.selected")
17+
.parents("div")
18+
.css("border", "2px red solid")
19+
.length;
20+
//alert(len);
21+
$("b").text("Unique div parents: " + len);
22+
}
23+
$(function () {
24+
//alert('daa');
25+
$(".test").click(function () {
26+
//$(this).toggleClass("selected");
27+
var len = $(this).siblings()
28+
.addClass("hilite_sib")
29+
.removeClass('hilite').length;
30+
$(this).addClass("hilite").removeClass('hilite_sib');
31+
$("b").text(len +" "+ $(this).text());
32+
//showParents();
33+
var parentEls = $(this).parents()
34+
.map(function () {
35+
return this.tagName;
36+
})
37+
.get().join(", ");
38+
var parentEls_arr = parentEls.split(',');
39+
parentEls_arr[1].each( function (){
40+
41+
});
42+
43+
//alert(parentEls);
44+
45+
});
46+
});
47+
</script>
48+
</head>
49+
<body>
50+
<div class="ul_list">
51+
<ul>
52+
<li class='test'>One</a></li>
53+
<li class='test'>Two</li>
54+
<li class="test">Three</li>
55+
<li class='test'>Four</li>
56+
</ul>
57+
58+
<ul>
59+
<li class='test'>Five</li>
60+
<li class='test'>Six</li>
61+
<li class='test'>Seven</li>
62+
63+
</ul>
64+
</div>
65+
<p>This Siblings: <b></b></p>
66+
<script>
67+
68+
</script>
69+
70+
</body>
71+
</html>

factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function getArrayElements(){
195195
}
196196

197197
catch(Exception $e){
198-
echo $e->getMessage();
198+
throw $e->getMessage();
199199
exit();
200200
}
201201
//Read more at http://www.devshed.com/c/a/PHP/The-Basics-of-Using-the-Factory-Pattern-in-PHP-5/3/#LFWVuMjAfLiLkE7w.99

nbproject/private/private.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
index.file=index.php
2+
url=http://localhost/oop/

nbproject/project.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include.path=${php.global.include.path}
2+
php.version=PHP_53
3+
source.encoding=UTF-8
4+
src.dir=.
5+
tags.asp=false
6+
tags.short=true
7+
web.root=.

nbproject/project.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://www.netbeans.org/ns/project/1">
3+
<type>org.netbeans.modules.php.project</type>
4+
<configuration>
5+
<data xmlns="http://www.netbeans.org/ns/php-project/1">
6+
<name>oop</name>
7+
</data>
8+
</configuration>
9+
</project>

0 commit comments

Comments
 (0)