Exemplo n.º 1
0
function handle_post()
{
    if ($_GET["name"] && $_GET["userid"]) {
        $userName = strtolower(str_replace(' ', '_', $_GET["name"]));
        $filePath = generatePath(strtolower($_GET["userid"]), $userName);
        $json = file_get_contents('php://input');
        writeJson($filePath, $json);
    } else {
        echo generateError("Error while generating / saving");
    }
}
Exemplo n.º 2
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Web", "MySQL"]);
?>

<table>
<tbody>
<tr>
<td><a href="intro.php?<?php 
echo "session={$session}";
?>
">Introduction to MySQL</a></td>
</tr>
<tr>
<td><a href="databasedesign.php?<?php 
echo "session={$session}";
?>
">Database Design with MySQL</a></td>
</tr>
<tr>
<td><a href="SQLTable.php?<?php 
echo "session={$session}";
?>
">Creating and Altering Tables with SQL</a></td>
</tr>
<tr>
<td><a href="SQLSelect.php?<?php 
echo "session={$session}";
?>
">Getting What You Want with select</a></td>
Exemplo n.º 3
0
<?php

include '../head.php';
generatePath(["Home", "Linux", "Some Small Tips for Linux"]);
?>

<h2>Some Small Tips for Linux</h2>

<h3>Ubuntu</h3>
<ul>
<li>When the time is missing in the top bar
<pre>$ pkill -f indicator-datetime-service</pre></li>
<li>Install Sogou method:
<pre>
sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get update
sudo apt-get install fcitx
sudo apt-get install sogoupinyin
fcitx-config-gtk
</pre>
In the window, select show all languages, find <code>Chinese</code>,
and add Sogou input method into the list. Logout and login.
</li>
<li>Change the wallpaper in commandline:
<pre>
gsettings set org.gnome.desktop.background picture-uri file:///path/to/image.jpg
</pre>
</li>
<li>
Change the desktop to the content of some text file:
<pre>
Exemplo n.º 4
0
<?php

include_once '/var/www/html/head.php';
include_once '/var/www/html/dbconnect.php';
generatePath(array("Home", "Blogs"));
?>

<?php 
// If "auth" is passed in url, print the list of the specific author
// else, print the list of authors
if (!isset($_GET["auth"])) {
    ?>

<table>
<tbody>
<?php 
    $users = get_allusers($link);
    foreach ($users as $user) {
        $userid = get_userid($link, $user);
        echo "<tr><td><a href=\"index.php?session={$session}&auth={$userid}\">{$user}</a></td></tr>";
    }
    ?>
</tbody>
</table>

<?php 
} elseif (!isset($_GET["blog"])) {
    ?>

<table>
<tbody>
Exemplo n.º 5
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Linux"]);
?>

<table>
<tbody>
<tr>
<td><a href="apache2.php?<?php 
echo "session={$session}";
?>
">Web Server: Apache2</a></td>
</tr>
<tr>
<td><a href="linuxcmd.php?<?php 
echo "session={$session}";
?>
">Linux Command Collection</a></td>
</tr>
<tr>
<td><a href="tips.php?<?php 
echo "session={$session}";
?>
">Small Tips for Linux</a></td>
</tr>
<tr>
<td><a href="vim.html?<?php 
echo "session={$session}";
?>
">Vim Reference Card</a></td>
Exemplo n.º 6
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Web", "MySQL", "Getting What You Want with select"]);
?>

<h1>Getting What You Want with select</h1>

<h2> Basic Select </h2>

<p> When it comes time to take the information from your database and lay it
out on your Web pages, you'll need to limit the information returned from your
tables and join tables together to get the proper information. So you'll start
with your data- base, the superset of information, and return a smaller set. In
the <code> select </code> statement you'll choose columns from one or more
tables to assemble a result set. This result has columns and rows and thus can
be effectively thought of as a table (or a two-dimensional array, if your mind
works that way). This table doesn't actually exist in the database, but it
helps to think about it this way.  </p>

<p>
The basic <code> select </code> statement requires you to indicate the table
you are selecting from and the column names you require. If you wish to select
all the columns from a given table, you can substitute an asterisk <code> (*)
</code> for the field names.
</p>
<xmp>
select column_1, column_2, column_3 from table_name;
</xmp>
or
<xmp>
Exemplo n.º 7
0
<?php

include_once '/var/www/html/head.php';
generatePath(array("Home"));
?>

<table width="100%">
<tbody>
<tr>
<td><b>Tutorials</b></td>
<td><b>Web</b></td>
</tr>
<tr>
<td><a href="Penetration/anonymous.php?<?php 
echo "session={$session}";
?>
">Anonymous</a></td>
<td><a href="Web/html.php?<?php 
echo "session={$session}";
?>
">HTML - Hyper Text Markup Language</a></td>
</tr>
<tr>
<td><a href="Reverse/assault-cube-hacking.php?<?php 
echo "session={$session}";
?>
">Hack AssaultCube</a></td>
<td><a href="Web/css.php?<?php 
echo "session={$session}";
?>
">CSS - External Style Sheet</a></td>
Exemplo n.º 8
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Linux", "Web Server: Apache2"]);
?>

<h2>Apache2</h2>

Apache2 is a most popular web server on the Linux platform.
Once launched, it runs as a daemon underground.

<h3> Installation</h3>
Apache2 can be directly installed from command line by <xmp> sudo apt-get install apache2 </xmp>
Wait a while and apache2 is installed automatically.

<h3>Launch</h3>
The arguments apache2 requires to be started is so complex that usually we do not launch apache2 directly from the command line by typing
<font face="Courier">apache2</font>.
In fact, we usually use <font face="Courier">apache2ctl</font> to launch apache2 instead.
Simply type <xmp>sudo apache2ctl start</xmp> in the command line.
Here the <font face="Courier">start</font> is one of the subcommands of apache2ctl.
Another frequently used subcommand of apache2ctl is <font face="Courier">restart</font>.
<br>
Input <font face="Courier">http://localhost</font> in the address bar of web browser.
You will see the web page offered by apache2.

<h3>Configuration</h3>
By default the web page rendered by apache2 lies in the directory <font face="Courier">/var/www</font>.
That is, the default root of the web server is <font face="Courier">/var/www</font>,
which means when you type <font face="Courier">http://localhost/</font> in your own computer,
or <font face="Courier">http://192.168.0.1</font> in another computer (here we assume that your IP address is 192.168.0.1),
Exemplo n.º 9
0
<?php

include '../head.php';
generatePath(["Home", "Links"]);
?>
<table class="list">
<tbody>
<tr>
<td align="center"><b>Type</b></td><td><b>URL</b></td>
</tr>
<?php 
function produceURLItem($type, $url)
{
    echo '<tr>';
    echo '<td align="center">', $type, '</td>';
    echo '<td><a href="', $url, '" target="_blank">', $url, '</a></td>';
    echo '</tr>';
}
$urls = array("Book Download" => array("http://bookzz.org/", "ftp://ftp.bupt.edu.cn/pub/Documents/", "https://murdercube.com/files/", "https://www.powersat.org/Documents/Books/", "http://q3k.org/gentoomen/Game%20Development/Programming/", "https://q3k.org/gentoomen/Programming/Python/"), "Book Online" => array("http://www.irt.org/", "http://www.loc.gov/", "http://www.freebsd.org/", "http://techpubs.sgi.com/library/tpl/cgi-bin/init.cgi", "http://www.icce.rug.nl/documents/cplusplus/", "http://digital.library.upenn.edu/books/", "http://issuu.com/", "http://onlinebooks.library.upenn.edu/", "http://selfknowledge.com", "http://www.gutenberg.org/"), "Computer Graphics" => array("http://www.threejsgames.com/", "https://aerotwist.com/", "http://learningthreejs.com/", "http://design.tutsplus.com/", "http://www.infinitee-designs.com/", "http://www.radiatedpixel.com/", "http://www.snappymaria.com/", "http://threejs.org/", "http://nemesis.thewavelength.net/", "http://tf3dm.com/", "http://phoboslab.org/"), "CSS" => array("http://www.glish.com/", "http://www.westciv.com/"), "Exploitation" => array("http://www.exploit-db.com/", "http://www.evilzone.org/", "http://hakipedia.com/", "http://www.remote-exploit.org/"), "Game Development" => array("http://gamedevelopment.tutsplus.com/", "http://www.gameartisans.org/"), "Games" => array("http://arcade.lostdecadegames.com/"), "HTML" => array("http://www.html5code.com/", "http://www.html5rocks.com/", "http://www.tizag.com/", "http://www.bigwebmaster.com/"), "Image Resource" => array("http://www.freevectordownload.com/", "http://www.freeiconsdownload.com/", "http://www.3dvalley.com/", "http://www.mayang.com/textures/", "http://www.imageafter.com/", "http://spiralgraphics.biz/packs/index.htm"), "Javascript" => array("http://www.pageresource.com/"), "Linux" => array("http://lwn.net/", "http://www.linuxdoc.org/", "http://www.linux-magazine.com/", "http://www.linux.com/", "http://www.tecmint.com/", "http://video.linux.com/", "http://www.unixwiz.net/"), "Linux Tutorial" => array("http://www.tecmint.com/free-online-linux-learning-guide-for-beginners/"), "Open Source" => array("http://www.opensource.com/", "http://www.freecode.com/"), "Resource" => array("http://down.52pojie.cn/", "ftp://ftp.oreilly.com", "http://www.3dlinks.com", "http://opengameart.org/", "http://opengameart.org/art-search-advanced?keys=&field_art_type_tid[]=10", "http://2d3d.hu/free-models/", "https://www.pygame.org/wiki/resources"), "Shell" => array("http://www.commandlinefu.com/"), "Source Code" => array("http://planet-source-code.com/", "http://programarcadegames.com/"), "Tool" => array("http://hilite.me/", "http://palined.com/search/", "http://www.bekkoame.ne.jp/~s_ita/port/port1-99.html", "http://validator.w3.org/", "http://jigsaw.w3.org/css-validator/", "http://www.webcrawler.com/"), "Video Resource" => array("http://videohive.net/"), "Web Proxy" => array("http://tom2see.us"));
foreach ($urls as $type => $list) {
    foreach ($list as $url) {
        produceURLItem($type, $url);
    }
}
?>
</tbody>
</table>

</body>

</html>
Exemplo n.º 10
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Code", "Cpp", "Convex Hull"]);
?>

<pre class="hl"><span class="hl ppc">#include &lt;GL/freeglut.h&gt;</span>
<span class="hl ppc">#include &lt;cstdlib&gt;</span>
<span class="hl ppc">#include &lt;vector&gt;</span>
<span class="hl ppc">#include &lt;cassert&gt;</span>


GLfloat sclLeft <span class="hl opt">= -</span><span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclRight <span class="hl opt">=</span> <span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclBottom <span class="hl opt">= -</span><span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclTop <span class="hl opt">=</span> <span class="hl num">2.0</span><span class="hl opt">;</span>

<span class="hl kwa">using namespace</span> std<span class="hl opt">;</span>

<span class="hl kwc">typedef</span> <span class="hl kwb">struct</span>
<span class="hl opt">{</span>
    <span class="hl kwb">double</span> x<span class="hl opt">;</span>
    <span class="hl kwb">double</span> y<span class="hl opt">;</span>
<span class="hl opt">}</span> Point<span class="hl opt">;</span>

Point <span class="hl kwd">point</span><span class="hl opt">(</span><span class="hl kwb">double</span> x<span class="hl opt">,</span> <span class="hl kwb">double</span> y<span class="hl opt">)</span>
<span class="hl opt">{</span>
    Point p <span class="hl opt">= {</span>x<span class="hl opt">,</span>y<span class="hl opt">};</span>
    <span class="hl kwa">return</span> p<span class="hl opt">;</span>
<span class="hl opt">}</span>
Exemplo n.º 11
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Code", "Cpp", "OpenGL Template 2d Keep Ratio"]);
?>

<pre class="hl"><span class="hl ppc">#include &lt;GL/freeglut.h&gt;</span>
<span class="hl ppc">#include &lt;cstdlib&gt;</span>


GLfloat sclLeft <span class="hl opt">= -</span><span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclRight <span class="hl opt">=</span> <span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclBottom <span class="hl opt">= -</span><span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclTop <span class="hl opt">=</span> <span class="hl num">2.0</span><span class="hl opt">;</span>

<span class="hl kwb">void</span> <span class="hl kwd">display</span><span class="hl opt">()</span>
<span class="hl opt">{</span>
    <span class="hl kwd">glClear</span><span class="hl opt">(</span>GL_COLOR_BUFFER_BIT<span class="hl opt">|</span>GL_DEPTH_BUFFER_BIT<span class="hl opt">);</span>

    <span class="hl kwd">glColor3f</span><span class="hl opt">(</span><span class="hl num">1.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glBegin</span><span class="hl opt">(</span>GL_QUADS<span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">0.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">0.0</span><span class="hl opt">,</span><span class="hl num">1.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">1.0</span><span class="hl opt">,</span><span class="hl num">1.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">1.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glEnd</span><span class="hl opt">();</span>

    <span class="hl kwd">glutSwapBuffers</span><span class="hl opt">();</span>
<span class="hl opt">}</span>

<span class="hl kwb">void</span> <span class="hl kwd">reshape</span><span class="hl opt">(</span><span class="hl kwb">int</span> w<span class="hl opt">,</span> <span class="hl kwb">int</span> h<span class="hl opt">)</span>
Exemplo n.º 12
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Code", "Python"]);
?>

<table>
<tbody>
<tr>
<td><a href="piano.php?<?php 
echo "session={$session}";
?>
">Pyglet - Piano</a></td>
</tr>
<tr>
<td><a href="pyopengl-template.php?<?php 
echo "session={$session}";
?>
">PyOpenGL Template</a></td>
</tr>
<tr>
<td><a href="tkinter-template.php?<?php 
echo "session={$session}";
?>
">Tkinter Template</a></td>
</tr>
</tbody>
</table>


<?php 
Exemplo n.º 13
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Code", "Python", "PyOpenGL Template"]);
?>

<pre class="hl"><span class="hl kwa">import</span> sys
<span class="hl kwa">from</span> OpenGL<span class="hl opt">.</span>GL <span class="hl kwa">import</span> <span class="hl opt">*</span>
<span class="hl kwa">from</span> OpenGL<span class="hl opt">.</span>GLU <span class="hl kwa">import</span> <span class="hl opt">*</span>
<span class="hl kwa">from</span> OpenGL<span class="hl opt">.</span>GLUT <span class="hl kwa">import</span> <span class="hl opt">*</span>

sclLeft <span class="hl opt">= -</span><span class="hl num">2.0</span>
sclRight <span class="hl opt">=</span> <span class="hl num">2.0</span>
sclBottom <span class="hl opt">= -</span><span class="hl num">2.0</span>
sclTop <span class="hl opt">=</span> <span class="hl num">2.0</span>
sclNear <span class="hl opt">= -</span><span class="hl num">10.0</span>
sclFar <span class="hl opt">=</span> <span class="hl num">10.0</span>

eyex <span class="hl opt">=</span> <span class="hl num">3.0</span>
eyey <span class="hl opt">=</span> <span class="hl num">3.0</span>
eyez <span class="hl opt">=</span> <span class="hl num">3.0</span>
<span class="hl slc"># The display() method does all the work it has to call the appropriate</span>
<span class="hl slc"># OpenGL functions to actually display something.</span>
<span class="hl kwa">def</span> <span class="hl kwd">display</span><span class="hl opt">():</span>
    w<span class="hl opt">,</span> h <span class="hl opt">=</span> winw<span class="hl opt">,</span> winh
    <span class="hl slc"># Clear the color and depth buffers</span>
    <span class="hl kwd">glClear</span><span class="hl opt">(</span>GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT<span class="hl opt">)</span>
<span class="hl slc">################################################################################</span>

    <span class="hl slc"># Initialize 2d environment</span>
    <span class="hl kwd">glMatrixMode</span><span class="hl opt">(</span>GL_PROJECTION<span class="hl opt">)</span>
Exemplo n.º 14
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Reverse Engineering", "Game Hacking Tutorial via Assault-Cube"]);
?>

<div class="post">
								<div class="inner" id="msg_101797">
								<h2>Game Hacking Tutorial via Assault-Cube</h2>
Hey Its Cr4zi8 here and I am going to be showing you how to hack games in a 3 part 
tutorial (there may be a 4th not sure yet). Welcome to part I in which I
 am going to show you how to create a simple external memory hack. First
 here is a list of what you need.<br><br>For the this part:
 <li>&nbsp; &nbsp; Windows (vm or installed on a hardrive)</li>
 <li>&nbsp; &nbsp; An Installation of Assault Cube</li>
 <li>&nbsp; &nbsp; Cheat Engine &gt;=6.4</li>
 <li>&nbsp; &nbsp; A text editor of some kind I use sublime text</li>
 <li>&nbsp; &nbsp; A C compiler mingw, lcc etc</li>
 <br>For future parts:
 <li>&nbsp; &nbsp; &nbsp;OllyDbg 1.10</li>
 <br>Good to have:
 <br>&nbsp; &nbsp;<li>&nbsp; &nbsp; aadp4olly (for getting by anti debugging 
solutions that might be implemented on commercial games)&nbsp; &nbsp;</li>
<br>Before
 we get started I would also recommend adding this to your arguments 
inside the assaultcube.bat file "-t -w 800 -h 600", just because we are 
going to be messing around with a bunch of windows.<br><br>Things you should probably know (not completely nesscary I suppose)
<li>&nbsp; &nbsp; Rudimentary understanding of ASM </li>
<li>&nbsp; &nbsp; C Programming </li>
<li>&nbsp; &nbsp; Memory Structure </li>
<li>&nbsp; &nbsp; Programming with the Windows API </li>
Exemplo n.º 15
0
<?php

include_once "/var/www/html/head.php";
generatePath(["Home", "Web", "PHP - Hypertext Preprocessor"]);
?>

<h2>PHP - Hypertext Preprocessor</h2>

When you are surfing the internet you probably find some web pages ended with <font face="Courier">.html</font>.
Generally speaking, when the web page is already sent to your computer and displayed by your browser,
a.html page is not at all different with a html page.
The difference lies in how the server generated this page.
<br><br>
Suppose you are running a website where there is a webpage telling the users about the date.
It is not a wise choice to use a static html page like this: <xmp><html>
<head><title>Date</title></head>
<body>
2015-05-24
</body>
</html>
</xmp>
Admittedly, this webpage does what it is supposed to do,
though it is a bit troubling for you to alter this page every day.
What is worse, there could be some highly demanding users toleranting with no mistake at all,
which means you had better update the date at exactly twelve o'clock.
This is more than troublesome.
<br><br>
Dynamic webpages comes as a solver to all kinds of problems like this.
PHP is one of such kind of webpages.
Others include ASP which is developed by Microsoft.
If your web server is running together with a PHP server,
Exemplo n.º 16
0
<?php

include '../head.php';
generatePath(["Home", "Algorithm", "Algorithm of Intervals"]);
?>

<h2>Algorithms of Intervals</h2>

<h3>Find Max Non-overlapping Subset of Intervals</h3>

<ol>
<li>Set the result subset to empty.</li>
<li>Find the interval that ends the first, put it in the result subset,
remove it and all interlapped intervals.</li>
<li>Repeat this process until the input set of intervals is empty.</li>
</ol>

<?php 
include '../foot.php';
Exemplo n.º 17
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Programming", "Python", "Networking"]);
?>

<h2>Networking</h2>

<h3>Socket</h3>
The <b>Berkeley Software Distribution</b>(BSD) socket is the primary means for communication between computers.
It is the interface between network applications and network stack.
<br><br>
In python, to use socket, simply import the socket library by <pre>from socket import *</pre>
To create a socket, use the constructor with some arguments.
<pre>
sock = socket(AF_INET, SOCK_STREAM)
</pre>
Here <font face="Courier">AF_INET</font> specifies the address family IPv4.
If <font face="Courier">AF_INET6</font> is used, then the address family would be IPv6.
<br><br>
The <font face="Courier">SOCK_STREAM</font> specifies that this is a TCP socket.
As we know, communicating with TCP is like accessing a file stream.
If you want to create a UDP socket, use <font face="Courier">SOCK_DGRAM</font> instead.

<h3>Bind</h3>
After creating the socket, the next step is to bind it with a specific port on some host.
The way to do this in python is quite straightforward.
<pre>sock.bind((host,port))</pre>
Note that there is only one argument which is a tuple of two elements.
If you by mistake pass the two arguments separately, an error would occur.
<br><br>
Exemplo n.º 18
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Programming", "Python"]);
?>

<table>
<tr>
<td><a href="tkinter.php?<?php 
echo "session={$session}";
?>
">Tkinter - Built-in Graphic Library</a></td>
</tr>
<tr>
<td><a href="generators.php?<?php 
echo "session={$session}";
?>
">Generators</a></td>
</tr>
<tr>
<td><a href="networking.php?<?php 
echo "session={$session}";
?>
">Networking</a></td>
</tr>
<tr>
<td><a href="lambda.php?<?php 
echo "session={$session}";
?>
">Lambda Function in Python</a></td>
</tr>
Exemplo n.º 19
0
<?php

include_once 'head.php';
generatePath(array("Home", "Log in"));
include_once 'dbconnect.php';
include_once 'utils.php';
?>

<?php 
if (!isset($_POST["username"]) or !isset($_POST["password"])) {
    ?>

<form action="<?php 
    echo $_SERVER['PHP_SELF'] . "?session=" . $session;
    ?>
" method="post">
<table>
<tr>
<td>Username</td><td><input type="text" placeholder="Enter username" id="username" name="username" maxlength="32"></td>
</tr>
<tr>
<td>Password</td><td><input type="password" id="password" name="password" maxlength="32"></td>
</tr>
<tr>
<td><input type="submit" id="submit" value="Login"></td>
</tr>
</table>
</form>

<?php 
} else {
Exemplo n.º 20
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Code", "Cpp", "OpenGL Template 2d Strethced"]);
?>

<pre class="hl"><span class="hl ppc">#include &lt;GL/freeglut.h&gt;</span>
<span class="hl ppc">#include &lt;cstdlib&gt;</span>

GLfloat sclLeft <span class="hl opt">= -</span><span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclRight <span class="hl opt">=</span> <span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclBottom <span class="hl opt">= -</span><span class="hl num">2.0</span><span class="hl opt">;</span>
GLfloat sclTop <span class="hl opt">=</span> <span class="hl num">2.0</span><span class="hl opt">;</span>


<span class="hl kwb">void</span> <span class="hl kwd">display</span><span class="hl opt">()</span>
<span class="hl opt">{</span>
    <span class="hl kwd">glClear</span><span class="hl opt">(</span>GL_COLOR_BUFFER_BIT<span class="hl opt">|</span>GL_DEPTH_BUFFER_BIT<span class="hl opt">);</span>

    <span class="hl kwd">glColor3f</span><span class="hl opt">(</span><span class="hl num">1.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glBegin</span><span class="hl opt">(</span>GL_QUADS<span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">0.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">0.0</span><span class="hl opt">,</span><span class="hl num">1.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">1.0</span><span class="hl opt">,</span><span class="hl num">1.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glVertex2f</span><span class="hl opt">(</span><span class="hl num">1.0</span><span class="hl opt">,</span><span class="hl num">0.0</span><span class="hl opt">);</span>
    <span class="hl kwd">glEnd</span><span class="hl opt">();</span>

    <span class="hl kwd">glutSwapBuffers</span><span class="hl opt">();</span>
<span class="hl opt">}</span>

<span class="hl kwb">void</span> <span class="hl kwd">reshape</span><span class="hl opt">(</span><span class="hl kwb">int</span> w<span class="hl opt">,</span> <span class="hl kwb">int</span> h<span class="hl opt">)</span>
Exemplo n.º 21
0
<?php

include '../../head.php';
generatePath(["Home", "Code", "C", "Merge Sort"]);
?>

<pre class="hl"><span class="hl ppc">#include &lt;stdio.h&gt;</span>
<span class="hl ppc">#include &lt;stdlib.h&gt;</span>

<span class="hl kwc">typedef</span> <span class="hl kwb">char</span> elmt<span class="hl opt">;</span>

<span class="hl kwb">int</span> <span class="hl kwd">mgsrt</span><span class="hl opt">(</span> elmt <span class="hl opt">*</span>start<span class="hl opt">,</span> elmt <span class="hl opt">*</span>end <span class="hl opt">);</span>

<span class="hl kwb">int</span> <span class="hl kwd">merge</span><span class="hl opt">(</span> elmt <span class="hl opt">*</span>start<span class="hl opt">,</span> elmt <span class="hl opt">*</span>mid<span class="hl opt">,</span> elmt <span class="hl opt">*</span>end <span class="hl opt">);</span>

<span class="hl kwb">int</span> <span class="hl kwd">main</span><span class="hl opt">()</span>
<span class="hl opt">{</span>
    <span class="hl kwb">char</span> a<span class="hl opt">[]=</span><span class="hl str">&quot;7654321&quot;</span><span class="hl opt">;</span>
    <span class="hl kwd">printf</span><span class="hl opt">(</span><span class="hl str">&quot;%d %s</span><span class="hl esc">\n</span><span class="hl str">&quot;</span><span class="hl opt">,</span><span class="hl kwd">mgsrt</span><span class="hl opt">(</span>a<span class="hl opt">,</span>a<span class="hl opt">+</span><span class="hl num">6</span><span class="hl opt">),</span>a<span class="hl opt">);</span>
    <span class="hl kwa">return</span> <span class="hl num">0</span><span class="hl opt">;</span>
<span class="hl opt">}</span>

<span class="hl kwb">int</span> <span class="hl kwd">mgsrt</span><span class="hl opt">(</span> elmt <span class="hl opt">*</span>start<span class="hl opt">,</span> elmt <span class="hl opt">*</span>end <span class="hl opt">)</span>
<span class="hl opt">{</span>
    <span class="hl kwb">int</span> pairs<span class="hl opt">=</span><span class="hl num">0</span><span class="hl opt">;</span>
    <span class="hl kwa">if</span><span class="hl opt">(</span> start<span class="hl opt">&lt;</span>end <span class="hl opt">)</span>
    <span class="hl opt">{</span>
        elmt <span class="hl opt">*</span>mid<span class="hl opt">=</span>start<span class="hl opt">+(</span>end<span class="hl opt">-</span>start<span class="hl opt">)/</span><span class="hl num">2</span><span class="hl opt">;</span>
        pairs   <span class="hl opt">+=</span>  <span class="hl kwd">mgsrt</span><span class="hl opt">(</span>start<span class="hl opt">,</span> mid<span class="hl opt">);</span>
        pairs   <span class="hl opt">+=</span>  <span class="hl kwd">mgsrt</span><span class="hl opt">(</span>mid<span class="hl opt">+</span><span class="hl num">1</span><span class="hl opt">,</span> end<span class="hl opt">);</span>
        pairs   <span class="hl opt">+=</span>  <span class="hl kwd">merge</span><span class="hl opt">(</span>start<span class="hl opt">,</span> mid<span class="hl opt">,</span> end<span class="hl opt">);</span>
Exemplo n.º 22
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Code", "Java"]);
?>

<table>
<tbody>
<tr>
<td><a href="reflex.php?<?php 
echo "session={$session}";
?>
">Reflex Game</a></td>
</tr>

</tbody>
</table>


</html>
<?php 
include "/var/www/html/foot.php";
Exemplo n.º 23
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Penetration"]);
?>

<table>
<tbody>
<tr>
<td><a href="anonymous.php?<?php 
echo "session={$session}";
?>
">The Art of Anonymity</a></td>
</tr>
<tr>
<td><a href="wireshark.php?<?php 
echo "session={$session}";
?>
">Wireshark Tutorial</a></td>
</tr>
<tr>
<td><a href="nikto.php?<?php 
echo "session={$session}";
?>
">nikto - Find Vulnerabilities in Website</a></td>
</tr>
<tr>
<td><a href="hping3.php?<?php 
echo "session={$session}";
?>
">hping3 - Powerful Scanning Tool</a></td>
Exemplo n.º 24
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Programming", "Python", "Lambda Function in Python"]);
?>

<h2>User Defined C Module</h2>

Here is an example of the build of a user defined <font face="Courier">shpfile</font> module written in C.

<h3>The C program</h3>

<pre class="hl"><span class="hl ppc">#include &lt;Python.h&gt;</span>

<span class="hl ppc">#include &lt;stdio.h&gt;</span>
<span class="hl ppc">#include &lt;stdlib.h&gt;</span>
<span class="hl ppc">#include &lt;assert.h&gt;</span>
<span class="hl ppc">#include &lt;string.h&gt;</span>

<span class="hl ppc">#define MAX_FILE_NAME 256</span>

<span class="hl kwc">typedef</span> <span class="hl kwb">unsigned char</span> BYTE<span class="hl opt">;</span>
<span class="hl kwc">typedef</span> <span class="hl kwb">short int</span> WORD<span class="hl opt">;</span>
<span class="hl kwc">typedef</span> <span class="hl kwb">int</span> LONGINT<span class="hl opt">;</span>

<span class="hl kwc">typedef</span> <span class="hl kwb">struct</span> Color <span class="hl opt">{</span>
    BYTE c<span class="hl opt">[</span><span class="hl num">4</span><span class="hl opt">];</span>
<span class="hl opt">}</span> Color<span class="hl opt">;</span>

<span class="hl kwc">typedef</span> <span class="hl kwb">struct</span> FileHeader <span class="hl opt">{</span>
    WORD check<span class="hl opt">;</span>
Exemplo n.º 25
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Code", "Metapost", "demo"]);
?>

<pre class="hl">outputformat <span class="hl opt">:=</span> <span class="hl str">&quot;eps&quot;</span><span class="hl opt">;</span>
prologues <span class="hl opt">:=</span> <span class="hl num">3</span><span class="hl opt">;</span>
outputtemplate <span class="hl opt">:=</span> <span class="hl str">&quot;%j-%c.eps&quot;</span><span class="hl opt">;</span>

transform pagecoords<span class="hl opt">;</span>
pagecoords<span class="hl opt">:=</span>identity scaled <span class="hl num">10</span>mm <span class="hl kwd">shifted</span> <span class="hl opt">(</span><span class="hl num">100</span>mm<span class="hl opt">,</span><span class="hl num">150</span>mm<span class="hl opt">);</span>
<span class="hl kwd">beginfig</span> <span class="hl opt">(</span><span class="hl num">1</span><span class="hl opt">)</span>
    <span class="hl kwd">fill</span> <span class="hl opt">((</span><span class="hl num">0</span><span class="hl opt">,</span><span class="hl num">0</span><span class="hl opt">)--(</span><span class="hl num">2</span><span class="hl opt">,</span><span class="hl num">0</span><span class="hl opt">)--(</span><span class="hl num">2</span><span class="hl opt">,</span><span class="hl num">1</span><span class="hl opt">)--(</span><span class="hl num">1</span><span class="hl opt">,</span><span class="hl num">1</span><span class="hl opt">)--(</span><span class="hl num">1</span><span class="hl opt">,</span><span class="hl num">2</span><span class="hl opt">)--(</span><span class="hl num">0</span><span class="hl opt">,</span><span class="hl num">2</span><span class="hl opt">)--</span>cycle<span class="hl opt">)</span>
        transformed pagecoords withcolor green<span class="hl opt">;</span>
    <span class="hl kwd">draw</span> <span class="hl opt">((</span><span class="hl num">2</span><span class="hl opt">,</span><span class="hl num">0</span><span class="hl opt">)..(</span><span class="hl num">2</span><span class="hl opt">,</span><span class="hl num">1</span><span class="hl opt">)..(</span><span class="hl num">1</span><span class="hl opt">,</span><span class="hl num">1</span><span class="hl opt">)..(</span><span class="hl num">1</span><span class="hl opt">,</span><span class="hl num">2</span><span class="hl opt">)..(</span><span class="hl num">0</span><span class="hl opt">,</span><span class="hl num">2</span><span class="hl opt">))</span>
        transformed pagecoords<span class="hl opt">;</span>
    <span class="hl kwd">drawarrow</span> <span class="hl opt">((</span><span class="hl num">0</span><span class="hl opt">,</span><span class="hl num">0</span><span class="hl opt">)--(</span><span class="hl num">2</span><span class="hl opt">,</span><span class="hl num">2</span><span class="hl opt">))</span> transformed pagecoords<span class="hl opt">;</span>
endfig<span class="hl opt">;</span>
<span class="hl kwd">beginfig</span> <span class="hl opt">(</span><span class="hl num">2</span><span class="hl opt">)</span>
    <span class="hl kwd">draw</span> <span class="hl opt">(</span><span class="hl kwa">for</span> i<span class="hl opt">=</span><span class="hl num">0</span> upto <span class="hl num">7</span><span class="hl opt">:</span> <span class="hl kwd">dir</span> <span class="hl opt">(</span><span class="hl num">135</span>i<span class="hl opt">)--</span> endfor cycle<span class="hl opt">)</span>
        transformed pagecoords<span class="hl opt">;</span>
endfig<span class="hl opt">;</span>
pagecoords<span class="hl opt">:=</span>identity scaled <span class="hl num">15</span>mm <span class="hl kwd">shifted</span> <span class="hl opt">(</span><span class="hl num">100</span>mm<span class="hl opt">,</span><span class="hl num">150</span>mm<span class="hl opt">);</span>
<span class="hl kwd">beginfig</span> <span class="hl opt">(</span><span class="hl num">3</span><span class="hl opt">);</span>
    <span class="hl opt">%</span> declare paths to be used
    path p<span class="hl opt">[],</span>p<span class="hl opt">[]</span>t<span class="hl opt">;</span>
    <span class="hl opt">%</span> set up points by defining relationships
    z1<span class="hl opt">=(</span><span class="hl num">0</span><span class="hl opt">,</span><span class="hl num">0</span><span class="hl opt">);</span>   z2<span class="hl opt">=</span>z1<span class="hl opt">+</span><span class="hl num">2u</span>p<span class="hl opt">;</span>
    z3<span class="hl opt">=</span>z1<span class="hl opt">+</span>whatever<span class="hl opt">*</span><span class="hl kwd">dir</span> <span class="hl opt">(</span><span class="hl num">60</span><span class="hl opt">)=</span>z2<span class="hl opt">+</span>whatever<span class="hl opt">*</span><span class="hl kwd">dir</span> <span class="hl opt">(-</span><span class="hl num">50</span><span class="hl opt">);</span>
    z4<span class="hl opt">=</span>z3<span class="hl opt">+(-</span><span class="hl num">1.5</span><span class="hl opt">,-</span><span class="hl num">.5</span><span class="hl opt">);</span>
<?php

include_once "/var/www/html/head.php";
generatePath(["Home", "Web", "Create a Watch with Blender"]);
?>

	<h1 class="title">Creating a Fancy Watch in Blender</h1>
	
	<div class="stats">
		<span></span>
		<span>Written By: Jahnu Best&nbsp;on&nbsp;March 27, 2011</span>		
		<span>12 Comments</span>
	</div>
	<div class="entry clearfloat">		
	<p>Welcome to another Blender Mesh tutorial!</p>
<p>This time the tutorial is a text tutorial! Orginally it was supposed 
to be a video tutorial but it was not to be. Also, for the first time, 
there’ll be two things at the bottom; the best pictures created with the
 tutorial, and also some inspirational pictures that go with the 
tutorial. Enjoy!</p>
<p>The final result:</p>
<p><img class="aligncenter size-full wp-image-125" title="Longines Primaluna 6" src="Blender%20Mesh%20%C2%BB%20Blog%20Archive%20%C2%BB%20Creating%20a%20Fancy%20Watch%20in%20Blender_files/Longines-Primaluna-61.jpg" alt="" height="252" width="448"></p>
<p>The tutorial begins …</p>
<p>Start off by deleting the default cube.</p>
<p><img class="aligncenter size-full wp-image-127" title="1_" src="Blender%20Mesh%20%C2%BB%20Blog%20Archive%20%C2%BB%20Creating%20a%20Fancy%20Watch%20in%20Blender_files/1_.jpg" alt="" height="278" width="448"></p>
<p>Add a cylinder.</p>
<p><img class="aligncenter size-full wp-image-128" title="2_" src="Blender%20Mesh%20%C2%BB%20Blog%20Archive%20%C2%BB%20Creating%20a%20Fancy%20Watch%20in%20Blender_files/2_.jpg" alt="" height="277" width="448"></p>
<p>Shrink the cylinder down on the Z-axis to an appropriate size.</p>
<p><img class="aligncenter size-full wp-image-129" title="3_" src="Blender%20Mesh%20%C2%BB%20Blog%20Archive%20%C2%BB%20Creating%20a%20Fancy%20Watch%20in%20Blender_files/3_.jpg" alt="" height="265" width="448"></p>
<p>Go into Edit Mode and delete the middle top vertex of the cylinder.</p>
<p><img class="aligncenter size-full wp-image-130" title="4_" src="Blender%20Mesh%20%C2%BB%20Blog%20Archive%20%C2%BB%20Creating%20a%20Fancy%20Watch%20in%20Blender_files/4_.jpg" alt="" height="300" width="448"></p>
Exemplo n.º 27
0
<?php

include_once "/var/www/html/head.php";
generatePath(["Home", "Web", "CSS -External Style Sheet"]);
?>

<h2>CSS - External Style Sheet</h2>

Every node in HTML has an attribute <font face="Courier">style</font> which configures the appearance that node.
Each configuration command is in the form of
<pre>
attribute: value;
</pre>
Assembling all such configurations of one node into a string forms the style of the node.
For example, we can write <xmp><table style="width:100%; background: red;"></xmp>
to start a table with wides spread over the screen and background color red.
<br><br>
If you want all the tables in your website have the same style,
you can write down the style string, copy and paste them at each occurance of tables.
Doing so seems to be kind of waste.
And if one day you want to change the style of the tables, there would be tons of work to do.
A good idea is to declare somewhere in a file that "All the tables have background color red".
Then if someday you feel that red does not suit your appetite anymore,
all you need to do is to replace the "red" in the declaration by some other color.
<br><br>
This is just what CSS is used for.
CSS is something you can write in the head of a webpage demanding that all text files should be of size 16px.
Of course, it can manipulate the webpage in more detail.
In fact, it could do it either for a particular node, or for a large group of elements.
<br><br>
CSS is very simple and consists of a list of independent rules.
Exemplo n.º 28
0
<?php

include_once "/var/www/html/head.php";
generatePath(["Home", "Web", "HTML Special Characters"]);
?>

<h2 id="html">Entities for characters with special meaning in HTML and XHTML</h2>
<table class="list">
<tr class="headers"><td>Entity</td><td>Entity<br />Displayed</td><td>Number</td><td>Number<br />Displayed</td><td class="description">Description</td></tr>

<tr><td>&amp;amp;</td><td class="entity">&amp;</td><td>&amp;#38;</td><td class="number">&#38;</td><td class="description">ampersand</td></tr>
<tr><td>&amp;gt;</td><td class="entity">&gt;</td><td>&amp;#62;</td><td class="number">&#62;</td><td class="description">greater-than sign</td></tr>
<tr><td>&amp;lt;</td><td class="entity">&lt;</td><td>&amp;#60;</td><td class="number">&#60;</td><td class="description">less-than sign</td></tr>
<tr><td>&amp;quot;</td><td class="entity">&quot;</td><td>&amp;#34;</td><td class="number">&#34;</td><td class="description">quotation mark = APL quote</td></tr>
</table>

<h2 id="char">Entities for accented characters, accents, and other diacritics from Western European Languages</h2>
<table class="list">
<tr class="headers"><td>Entity</td><td>Entity<br />Displayed</td><td>Number</td><td>Number<br />Displayed</td><td class="description">Description</td></tr>

<tr><td>&amp;acute;</td><td class="entity">&acute;</td><td>&amp;#180;</td><td class="number">&#180;</td><td class="description">acute accent = spacing acute</td></tr>
<tr><td>&amp;cedil;</td><td class="entity">&cedil;</td><td>&amp;#184;</td><td class="number">&#184;</td><td class="description">cedilla = spacing cedilla</td></tr>
<tr><td>&amp;circ;</td><td class="entity">&circ;</td><td>&amp;#710;</td><td class="number">&#710;</td><td class="description">modifier letter circumflex accent</td></tr>
<tr><td>&amp;macr;</td><td class="entity">&macr;</td><td>&amp;#175;</td><td class="number">&#175;</td><td class="description">macron = spacing macron = overline = APL overbar</td></tr>
<tr><td>&amp;middot;</td><td class="entity">&middot;</td><td>&amp;#183;</td><td class="number">&#183;</td><td class="description">middle dot = Georgian comma = Greek middle dot</td></tr>
<tr><td>&amp;tilde;</td><td class="entity">&tilde;</td><td>&amp;#732;</td><td class="number">&#732;</td><td class="description">small tilde</td></tr>
<tr><td>&amp;uml;</td><td class="entity">&uml;</td><td>&amp;#168;</td><td class="number">&#168;</td><td class="description">diaeresis = spacing diaeresis</td></tr>
<tr><td colspan="5" class="divider"><img src="spacer.gif" width="1" height="1" alt="" /></td></tr>

<tr><td>&amp;Aacute;</td><td class="entity">&Aacute;</td><td>&amp;#193;</td><td class="number">&#193;</td><td class="description">latin capital letter A with acute</td></tr>
<tr><td>&amp;aacute;</td><td class="entity">&aacute;</td><td>&amp;#225;</td><td class="number">&#225;</td><td class="description">latin small letter a with acute</td></tr>
Exemplo n.º 29
0
<?php

include '../../head.php';
generatePath(["Home", "Code", "C"]);
?>

<table>
<tbody>
<tr>
<td><a href="merge-sort.php?<?php 
echo "session={$session}";
?>
">Merge Sort</a></td>
</tr>

</tbody>
</table>

<?php 
include '../../foot.php';
Exemplo n.º 30
0
<?php

include "/var/www/html/head.php";
generatePath(["Home", "Reverse Engineering", "X86 Assembly Language"]);
?>

<h2>X86 Assembly Language</h2>

<h3>List of Instructions Specific to X86 Language</h3>
<table>
<tr class="odd">
<td><b>Instruction</b></td><td><b>Description</b></td>
</tr>
<tr class="even">
<td class="code">test al,al</td>
<td>This will <font face="Courier">and</font> the two operands and set the <font face="Courier">zero</font> and <font face="Courier">negative</font> flag, which is the only bits influenced by this instruction. This is usually used to test whether a register is zero or negative, etc. In this case, zero flag is set if and only if <font face="Courier">al</font> is zero.</td>
</tr>
</table>


<?php 
include "/var/www/html/foot.php";