小编cha*_*987的帖子

如何创建自己的域名扩展?

bit.ly,goo.gl,is.gd,j.mp,migre.me等用自己的域扩展名.ly,.gl,.gd,.mp,.me等我怎样才能创建自己的个性化域扩展样.xyz?请帮忙.

dns personalization

39
推荐指数
3
解决办法
8万
查看次数

只需从hive表中获取列名

我知道你可以通过hive中的以下技巧从表中获取列名:

hive> set hive.cli.print.header=true;
hive> select * from tablename;
Run Code Online (Sandbox Code Playgroud)

是不是也有可能只是得到从表中的列名?

我不喜欢改变一个我只需要一次的设置.

我目前的解决方案如下:

hive> set hive.cli.print.header=true;
hive> select * from tablename;
hive> set hive.cli.print.header=false;
Run Code Online (Sandbox Code Playgroud)

这看起来过于冗长,反对DRY原则.

sql hadoop hive

38
推荐指数
2
解决办法
8万
查看次数

如何使用JavaScript动态创建表单?

我希望使用JavaScript动态地在HTML页面中的任何位置创建一个不可见的表单,然后自动提交.
我想创建下面给出的表单:

<form name='myForm' method='post' action='http://www.another_page.com/index.htm'>
<input type='text' name='myInput' value='Values of my input'>
<input type='hidden1' value='Hidden value 1'>
<input type='hidden2' value='Hidden value 2'>
</form>
Run Code Online (Sandbox Code Playgroud)

我尝试使用下面的JavaScript:

my_form=document.createElement('FORM');
my_form.name='myForm';
my_form.method='POST';
my_form.action='http://www.another_page.com/index.htm';
my_tb=document.createElement('INPUT');
my_tb.type='TEXT';
my_tb.name='myInput';
my_tb.value='Values of my Input';
my_tb.appendChild(my_form);
document.body.add(my_form,document.body.elements[0]);
document.my_form.submit();
Run Code Online (Sandbox Code Playgroud)

但不工作?我怎样才能做到这一点?请帮忙.

javascript forms

18
推荐指数
1
解决办法
6万
查看次数

如何在C#程序中添加自己的数据类型?

类似"int"表示"Int32"类,"string"表示"String"类.如何将像"abc"这样的数据类型引用到我的"Abc"类?

c# types

9
推荐指数
4
解决办法
2万
查看次数

如何在PHP中创建虚拟目录?

我想在PHP中创建一个实现虚拟目录功能的应用程序.
示例:http://mydomain.com/user001将显示网址的内容http://mydomain.com/index.php?user=user001.我怎样才能做到这一点?

注意:
我正在使用Apache服务器.

php virtual-directory

6
推荐指数
1
解决办法
8081
查看次数

C#中的多重继承问题

在我阅读帖子时,我想到了这个问题为什么C#不支持多重继承? 来自MSDN博客.

首先看下面的代码:

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class A
    {
        int num;
        public A()
        {
            num = 0;
        }
        public A(int x)
        {
            num = x;
        }
        public override int GetHashCode()
        {
            return num + base.GetHashCode();
        }
    }
    class B : A
    {
        int num;
        public B()
        {
            num = 0;
        }
        public B(int x)
        {
            num = x;
        }
        public override int GetHashCode()
        {
            return num + base.GetHashCode();
        }
    }
    class …
Run Code Online (Sandbox Code Playgroud)

c#

5
推荐指数
1
解决办法
1119
查看次数

从PHP应用程序发送和接收SMS

我想像Facebook一样发送和接收服务.有没有PHP API可以做到这一点?我想使用像Facebook这样的特定号码.

注意可以
通过电子邮件发送短信,但如何通过我的PHP应用程序接收短信?我正在寻找一个免费的PHP API,没有任何外部硬件来做到这一点.可能吗?

php api sms

4
推荐指数
1
解决办法
8885
查看次数

如何在C#.NET GUI应用程序中实现语法突出显示和自动完成功能?

我是一名新的C#学生程序员.我想制作一个类似于应用程序的编辑器,它将突出显示代码(语法高亮)并具有函数变量等的自动完成功能......我不知道如何做到这一点.你能给我一些教程链接或一些提示吗?我可以在"富文本框"中实现这些功能吗?

c# autocomplete syntax-highlighting

3
推荐指数
1
解决办法
4872
查看次数

如何在我的班级中实现前后递增/递减运算符?

我想++在我的c#类中使用运算符重载来重载运算符以使用预增量和后增量.但只有后增量才有效.如何使这两个功能在我班上工作?假设我做了一个类ABC -

using System;
using System.Collections.Generic;
using System.Text;

namespace Test
{
    class ABC
    {
      public int a,b;
      public ABC(int x, int y)
      {
        a = x;
        b = y;
      }
      public static ABC operator ++(ABC x)
      {
        x.a++;
        x.b++;
        return x;
      }
    }

    class Program
    {
        static void Main(string[] args)
        {
            ABC a = new ABC(5, 6);
            ABC b, c;
            b = a++;
            Console.WriteLine("After post increment values are {0} and {1} and values of b are {2} and …
Run Code Online (Sandbox Code Playgroud)

c# operator-overloading

2
推荐指数
1
解决办法
4520
查看次数

time.Ticker 的表现

无法找出在下面的 for 循环中我们花费了超过 10 微秒的时间,以至于我们错过了大量的滴答声?

package main

import (
    "context"
    "fmt"
    "time"
)

func main() {
    RunTicker(time.Millisecond, 10 * time.Second) // Scenario 1
    RunTicker(10 * time.Microsecond, 10 * time.Second) // Scenario 2
}

func RunTicker(tickerInterval, tickerDuration time.Duration) {
    var counter int

    ctx, can := context.WithTimeout(context.Background(), tickerDuration)
    defer can()

    ticker := time.NewTicker(tickerInterval)

exitfor:
    for {
        select {
        case <-ticker.C:
            counter++
        case <- ctx.Done():
            ticker.Stop()
            break exitfor
        }
    }

    fmt.Printf("Tick interval %v and running for %v.Expected counter: %d but got %d\n", tickerInterval, …
Run Code Online (Sandbox Code Playgroud)

performance go ticker

2
推荐指数
1
解决办法
103
查看次数

Console.ReadLine()函数不起作用

请参阅以下程序:

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace FileOperation1
{
    class FileMain
    {
        static void Main(string[] args)
        {
            FileMain fm = new FileMain();
            char ch = fm.Menu();
            while (ch != '0')
            {
                switch (ch)
                { 
                    case '0':
                        break;
                    case '1':
                        //Console.WriteLine("This featute is not implemented till now.");
                        break;
                    case '2':
                        Console.Write("Enter the name of the file: ");
                        String FileName = Console.ReadLine();// ReadLine() method is not workin here
                        FileOperation Fo=new FileOperation();
                        Console.WriteLine("\n" + Fo.FileRead(FileName, FileMode.Open, FileAccess.Read));
                        break;
                    case '3': …
Run Code Online (Sandbox Code Playgroud)

c# function

0
推荐指数
1
解决办法
9583
查看次数