• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP generatePath函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中generatePath函数的典型用法代码示例。如果您正苦于以下问题:PHP generatePath函数的具体用法?PHP generatePath怎么用?PHP generatePath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了generatePath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: handle_post

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");
    }
}
开发者ID:Baddaboo,项目名称:SoftwareEngineeringProj2015,代码行数:11,代码来源:form.php


示例2: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:index.php


示例3: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:tips.php


示例4: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:index.php


示例5: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:SQLSelect.php


示例6: generatePath

<?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),
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:apache2.php


示例7: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:30,代码来源:convex-hull.php


示例8: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:opengl-2d-ratio.php


示例9: generatePath

<?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 
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:index.php


示例10: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:pyopengl-template.php


示例11: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:assault-cube-hacking.php


示例12: generatePath

<?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,
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:php.php


示例13: generatePath

<?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';
开发者ID:yczhangsjtu,项目名称:html,代码行数:19,代码来源:interval.php


示例14: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:networking.php


示例15: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:index.php


示例16: generatePath

<?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 {
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:login.php


示例17: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:merge-sort.php


示例18: generatePath

<?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>
开发者ID:yczhangsjtu,项目名称:html,代码行数:31,代码来源:user-c-module.php


示例19: generatePath

<?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&l 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP generateQuestionMarks函数代码示例发布时间:2022-05-15
下一篇:
PHP generatePassword函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap