如果你看这里:http://en.wikipedia.org/wiki/Stack_Overflow
您会注意到有一些"内容"部分,如果您点击其中一个链接,它会将您发送到页面上的特定部分.
我如何在GitHub wiki中执行此操作?使用Markdown或他们使用的任何东西?
#include <Windows.h>
#include <GL\glut.h>
#pragma comment(lib, "glut32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
bool init(void)
{
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glMatrixMode(GL_PROJECTION);
// Set grid to be from 0 to 1
gluOrtho2D(0.0, 3.0, 0.0, 3.0);
return true;
}
void drawline(float from_x, float from_y, float to_x, float to_y)
{
// From coordinate position
glVertex2f(from_x, from_y);
// To coordinate position
glVertex2f(to_x, to_y);
}
void render(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 1.0, 0.0); // Color (RGB): Yellow
glLineWidth(2.0); // Set …
Run Code Online (Sandbox Code Playgroud) 我正在尝试从已定义结构的数组中添加/删除数据.
struct process
{
public int Proc_Id;
public int Proc_BurstTime;
public int Proc_Priority;
public override string ToString()
{
return "ID: " + Proc_Id.ToString() + " Time: " + Proc_BurstTime.ToString() + " Prior: " + Proc_Priority.ToString();
}
};
readonly process[] ProcessList = new process[]
{
new process{ Proc_Id = 1, Proc_BurstTime = 3000, Proc_Priority = 1},
new process{ Proc_Id = 2, Proc_BurstTime = 5000, Proc_Priority = 2},
new process{ Proc_Id = 3, Proc_BurstTime = 1000, Proc_Priority = 3},
new process{ Proc_Id …
Run Code Online (Sandbox Code Playgroud) 有趣的是,我一直在我的计算机上通过localhost处理这个问题.它工作得很好.然后我将相同的代码复制到GoDaddy,突然间它无法正常工作.
这是我的代码:
<?php
include ('simple_html_dom.php');
$html = file_get_html('http://www.tibia.com/community/?subtopic=worlds&world=Aurora');
$table = $html->find('table[class=Table2]')[0];
for ($i = 0; $i < 20; $i++)
{
$player = $table->find('tr[class=Even]')[$i]->find('a')[0];
echo $player->href . '<br>';
$html2 = file_get_html($player->href);
$date = $html2->find('[@id="characters"]/div[5]/div/div/table[3]/tbody/tr[2]/td[1]')[0];
echo $date . '<br>';
$dateArr = explode(" ", $date);
echo $dateArr . '<br>';
echo count($dateArr[0]);
//for ($k = 0; count($dateArr[0]); $k++)
//{
// echo $dateArr[0][$k] . '<br>';
//}
}
?>
Run Code Online (Sandbox Code Playgroud)
这是确切的错误:
解析错误:语法错误,第6行的/home/content/27/11250627/html/tibia/pvplist.php中的意外'['
好的,这是输入消息:
你有一个耳朵
你有一个冰块
你有一只狗
你有一个苹果
你有一块石头
我想要得到这样的输出:
耳
冰块
狗
苹果
岩
我怎么能做到这一点?
这是我目前的代码:
<?php
$str = $_POST["txtarea"];
preg_match_all('/You have (a|an) (.*)/', $str, $matches);
array_shift($matches);
foreach($matches[0] as $child)
{
echo $child;
}
?>
Run Code Online (Sandbox Code Playgroud)
整个(a | an)部分不起作用.
在我的数据库中,我有一个具有'date'数据类型的列.
这意味着它只会采用YYYY-MM-DD格式的日期.
我的问题是,
如何将当前日期从C#发送到数据库?
就像,如果我在PHPMyAdmin的查询中使用CURDATE(),它会以我想要的格式给出今天的日期.但是当我向数据库发送信息时,我怎么能以某种方式在C#Windows窗体中使用"CURDATE()"?
string query = "INSERT INTO player (date, name, level, experience) " +
"VALUES ('" + DateTime.Today + "','" +
getPlayerName(Tibia.Handle, (BattleList_Start + Base + (BattleList_Step * playerIndex) + 4)) + "'," +
ReadInt32(LvlAdr + Base, 4, Tibia.Handle) + "," +
ReadInt32(XpAdr + Base, 4, Tibia.Handle) + ")";
Run Code Online (Sandbox Code Playgroud) 我收到了这个错误:
System.Windows.Forms.dll 中发生类型为“System.InvalidOperationException”的未处理异常
附加信息:跨线程操作无效:控制从创建它的线程以外的线程访问的“Redlight”。
Redlight 和 Greenlight 是图片框。基本上,我希望它能够做的就是每秒在每张图片之间交替。我在这个网站上搜索了类似的错误,我看到它与“调用”有关,但我什至不知道那是什么,有人能指教我吗?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
namespace EMCTool
{
public partial class EMCTool_MainForm : Form
{
bool offOn = false;
public EMCTool_MainForm()
{
InitializeComponent();
}
private void EMCTool_MainForm_Load(object sender, EventArgs e)
{
System.Threading.Timer timer = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback), null, 0, 1000);
}
private void timerCallback(object obj)
{
if (offOn == false)
{
Redlight.Show();
offOn = true;
}
else …
Run Code Online (Sandbox Code Playgroud)