问题列表 - 第48474页

如何列出hbase表中的所有行键?

如何列出hbase表中的所有行键?

我需要使用带有REST接口的PHP来做到这一点.

rest hadoop hbase stargate

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

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

使用文件和文件系统:在NIO之前,将来使用NIO和NIO2

在Java 1.4之前,通常的做法是通过在不同的InputStreams/OutputStream之间移动字节来处理文件.

从添加了NIO的 Java 1.4 开始,建议使用Channels来做同样的事情.

使用Java 7中的NIO2,java.nio.file中还有另一个API支持像

val source = Paths.get("fooDir/fooFile.txt")
val target = Paths.get("barDir/barFile.txt")
source moveTo target
source createLinkTo target
Run Code Online (Sandbox Code Playgroud)

旧的或多或少的无用现在对文件系统操作,除非你想手动触摸字节?

java filesystems file-io file

2
推荐指数
3
解决办法
995
查看次数

为什么$('html').animate()仅适用于IE和$('body').Chrome/Safari需要animate()吗?

我必须使用$('html, body').animate(),使片段完全跨浏览器兼容,但这将动画链接,因为它们有时会采取行动时都不方便<html><body>.

IE8取决于拥有'html',而Chrome或Safari依赖于'body',所以我必须包括两者.

为什么会出现差异?

javascript jquery jquery-selectors

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

resx文件是否适合针对不同客户进行自定义的方法?

我正在考虑为不同的客户定制应用程序中的各种文本。似乎.resx资源将是一种明智的方法。但是,我遇到的所有关于resx的文献似乎都是针对语言差异(如英语,法语,西班牙语等)进行本地化,因此仅检查文本中的客户差异也是最好的选择。

并且,假设它还可以为不同的客户处理不同的语言,例如:

CustomerA.resx
CustomerA.en-US.resx
CustomerA.de-DE.resx

CustomerB.resx
CustomerB.en-US.resx
CustomerB.de-DE.resx

... etc
Run Code Online (Sandbox Code Playgroud)

resx是寻求客户差异的方法吗?

.net c# asp.net customization resx

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

如何为自定义Drupal 7模块生成翻译文件?

我使用的是CentOS 5.5 Linux(没有X),PHP 5.3和Drupal 7.0.

我网站的核心语言是俄语(不是英语)!

我创建了一个game.info和以下game.module,为首页生成3个块:

function game_block_info() {
  return array(
  'game_main' => array(
    'info' => t('Set FlashVars and show the flash game.'),
    'cache' => DRUPAL_NO_CACHE,
  ),
  'game_winner' => array(
    'info' => t('Show the winner of the last week.'),
    'cache' => DRUPAL_NO_CACHE,
  ),
  'game_leader' => array(
    'info' => t('Show the leader of the current week.'),
    'cache' => DRUPAL_NO_CACHE,
  );
}


function game_block_view($block_name = '') {
  global $user;

  if ($block_name == 'game_main') {
    if (user_is_logged_in()) { …
Run Code Online (Sandbox Code Playgroud)

localization drupal gettext internationalization drupal-7

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

如何在C中手动将十进制值转换为十六进制字符串?

我知道这个问题之前已经在各种不同的方式和情况下被问到了StackOverflow,但是我寻找的答案的搜索对我的具体案例并没有多大帮助.所以虽然这看起来像是一个问题的副本,例如如何将整数转换为C中的十六进制字符串?给出的答案是准确的,但对我没用.

我的问题是如何手动将十进制整数转换为十六进制字符串.我知道stdlib.h和printf有一些节拍技巧,但这是一项大学任务,我需要手动完成(教授的命令).但是,我们可以寻求帮助.

使用好的旧"除以16并将余数转换为十六进制并反转值"获取十六进制字符串的方法,但是我的代码中必定存在一个大错误,因为它不会让我回来,例如"BC"表示十进制值"188".

假设算法永远不需要为大于256(或FF)的小数找到十六进制值.虽然参数的传递可能不是最佳或理想的,但我们已经被告知要使用它(虽然我可以修改getHexValue函数,因为我自己编写了这个函数).

这是我到目前为止:

/* Function to get the hex character for a decimal (value) between
 * 0 and 16.  Invalid values are returned as -1.
 */
char getHexValue(int value) 
{
   if (value < 0) return -1;
   if (value > 16) return -1;
   if (value <= 9) return (char)value;
   value -= 10;
   return (char)('A' + value);
}


/* Function asciiToHexadecimal() converts a given character (inputChar) to
 * its hexadecimal (base 16) equivalent, stored as a …
Run Code Online (Sandbox Code Playgroud)

c hex decimal

7
推荐指数
1
解决办法
9458
查看次数

什么是Swing - 相当于HTML <optgroup>

我希望我的JComboBox将多个选项组合在一起,类似于HTML optgroup:

<select>  
 <optgroup label="A">  
  <option/>
  <option/>  
 </optgroup>
</select>  
Run Code Online (Sandbox Code Playgroud)

我在Swing找不到任何解决方案.操作Combobox的UI-Renderer似乎是一个坏主意,因为它依赖于操作系统和L&F(它们是私有的,因此无法扩展).

java swing combobox optgroup

10
推荐指数
3
解决办法
2772
查看次数

Ruby on rails - 静态方法

我想要一个每5分钟执行一次的方法,我为ruby(cron)实现了.但它不起作用.我认为我的方法无法访问.我想要执行的方法位于一个类中.我想我必须将该方法设为静态,以便我可以访问它MyClass.MyMethod.但我找不到合适的语法,或者我找错了地方.

Schedule.rb

every 5.minutes do
  runner "Ping.checkPings"
end
Run Code Online (Sandbox Code Playgroud)

Ping.rb

def checkPings      
  gate =  Net::Ping::External.new("10.10.1.1")
  @monitor_ping = Ping.new()

  if gate.ping?        
    MonitorPing.WAN = true
  else 
    MonitorPing.WAN = false
  end

  @monitor_ping.save      
end
Run Code Online (Sandbox Code Playgroud)

ruby oop static-methods

54
推荐指数
3
解决办法
6万
查看次数

从<xsl:for-each>内部调用模板

我有一个像下面的xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:nsm="http://192.137.81.132/deneme/sample.xsd"
               exclude-result-prefixes="nsm">

    <xsl:output method="text"/>
    <xsl:param name="fieldOf">address</xsl:param>
    <xsl:param name="inputId" select="concat($fieldOf,'/value')"/>

    <xsl:variable name="vXpathExpression" select="concat('global/fieldset/field/', $inputId)"/>
    <!-- these fields are from xml file-->

    <xsl:template match="/">
        <xsl:value-of select="$vXpathExpression"/>: <xsl:text/>
        <xsl:for-each select="document('sample.xsd')/xs:schema/xs:complexType[@name='fieldtype']/xs:choice/child::*">

        </xsl:for-each>

        <xsl:call-template name="getNodeValue">
            <xsl:with-param name="pExpression" select="$vXpathExpression" />
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="getNodeValue">
        <xsl:param name="pExpression"/>
        <xsl:param name="pCurrentNode" select="."/>

        <xsl:choose>
            <xsl:when test="not(contains($pExpression, '/'))">
                <xsl:value-of select="$pCurrentNode/*[name()=$pExpression]"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:call-template name="getNodeValue">
                    <xsl:with-param name="pExpression" select="substring-after($pExpression, '/')"/>
                    <xsl:with-param name="pCurrentNode" select="$pCurrentNode/*[name()=substring-before($pExpression, '/')]"/>
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)

在这种情况下它有效.但是当我从for-each内部调用模板时,我无法运行它.它什么都没有,没有错误,没有价值.有没有办法解决这个问题?谢谢

编辑:您可能想知道是否每个都有效.确实如此.我可以在每个内部获得属性.

xml xslt xsd

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