有没有办法(硬件/软件组合),我可以使用PC控制一个或多个"飞利浦生活色彩"灯 - 例如作为"遥控器"的USB棒.通过这种方式,我可以通过软件(例如网络应用程序 - 通过iPhone /远程控制)控制灯泡,甚至可以创建飞利浦在其部分电视中构建的内容并调用"流光溢彩"(图形驱动程序检测主要颜色以控制灯泡).
我想这更像是一个硬件而不是一个软件问题 - 但我在网上找不到任何关于这个的信息,我肯定不会是第一个在我昨天打开LivingColors灯的时候提出这个想法的人;)
**如果结构可以是自我指涉的.喜欢
struct list
{
struct list *next;
};
Run Code Online (Sandbox Code Playgroud)
因为除了默认访问说明符之外,类和结构之间没有区别.那么可以写一堂课......
class list
{
class list *next;
};
Run Code Online (Sandbox Code Playgroud)
或者可能有任何不同的语法来获得自我指涉类.如果是的话怎么样?**
我之前从未使用过这些函数,但在阅读了很多关于sprintf()之后,我决定知道它.
所以我继续做下面的事情.
function currentDateTime() {
list($micro, $Unixtime) = explode(" ",microtime());
$sec= $micro + date("s", $Unixtime);
$sec = mb_ereg_replace(sprintf('%d', $sec), "", ($micro + date("s", $Unixtime)));
return date("Y-m-d H:i:s", $Unixtime).$sec;
}
sprintf(currentDateTime());
Run Code Online (Sandbox Code Playgroud)
它什么都不打印.另一方面使用printf()函数:
printf(currentDateTime());
Run Code Online (Sandbox Code Playgroud)
它打印结果就好了.那么这两个函数之间的区别是什么?如何正确使用sprintf()函数?
我想知道如何比较两个日期时间值,一个是从sql数据库中检索到的,另一个是当前的一个用c#
如何获取命令行参数(特别是在GNU中,如果有任何差异)Common Lisp?
快速问题...使用J2ME(CLDC 1.1,MIDP-2.1)可以让Midlet睡一段时间(不使用线程)...例如:
public class myMidlet extends MIDlet{
public void startApp() {
/* Sleep for 10 seconds */
/* The answer was: */
try {
Thread.sleep(time_ms);
} catch (Exception e) {}
}
...
Run Code Online (Sandbox Code Playgroud)
我没有那么多使用Java,也不想仅为简单的睡眠编写线程.
提前致谢
答案摘要
我缺乏Java知识.我看到使用Thread.sleep()的例子让我相信它只能在Midlet产生的线程对象中使用...而不是midlet本身.我不想把midlet逻辑假脱机到一个线程让它睡不着......但是现在我知道midlet在默认线程中运行:) 要找到我从未读过的Java书因为我没想到我会用这种语言
我对算法感兴趣(见这里),我想知道是否存在(与我之前的问题相反),并行编程中主流的算法和数据结构.关于主流并行算法和ds的问题可能还为时过早,但这里的一些大师可能对其中一些人有过良好的经历/糟糕的经历.
编辑:我对algos和ds的成功实际应用比对学术论文更感兴趣.
谢谢
可能重复:
在C++中转发嵌套类型/类的声明
我有一个这样的课......
class Container {
public:
class Iterator {
...
};
...
};
Run Code Online (Sandbox Code Playgroud)
在其他地方,我想通过引用传递一个Container :: Iterator,但我不想包含头文件.如果我尝试转发声明类,我会遇到编译错误.
class Container::Iterator;
class Foo {
void Read(Container::Iterator& it);
};
Run Code Online (Sandbox Code Playgroud)
编译上面的代码给出了......
test.h:3: error: ‘Iterator’ in class ‘Container’ does not name a type
test.h:5: error: variable or field ‘Foo’ declared void
test.h:5: error: incomplete type ‘Container’ used in nested name specifier
test.h:5: error: ‘it’ was not declared in this scope
Run Code Online (Sandbox Code Playgroud)
我怎样才能转发声明这个类,所以我不必包含声明Iterator类的头文件?
有没有办法找出两个CGPathRef是否相交.在我的例子中,所有CGPath都有closePath.
例如,我有两条路.一条路径是以一定角度旋转的矩形,另一条路径是弯曲路径.两条路径的起源将经常变化.在某些时候,它们可能相交.我想知道它们什么时候相交.如果您有任何解决方案,请告诉我.
提前致谢
我有一个带有ListView的用户控件,其中包含来自ObservableCollection的简单项.我希望ListView的ContextMenu包含项目,具体取决于ListView中选择的内容.如果未选择任何项目,则不应显示某些MenuItems.
打开ContextMenu时,甚至都没有调用我的转换器.绑定似乎是错误的,我在输出窗口中找到它:
System.Windows.Data错误:4:找不到引用'ElementName = listView'的绑定源.BindingExpression:路径=的SelectedItem; 的DataItem = NULL; target元素是'MenuItem'(Name =''); 目标属性是"可见性"(类型"可见性")
我不明白什么是错的,无法通过搜索网络来解决这个问题.
这是一些简化的代码:
<UserControl x:Class="MyApp.DatabaseControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:MyApp"
Height="Auto"
Width="Auto">
<UserControl.Resources>
<l:ValueToVisibilityConverter x:Key="valueToVisibility" />
</UserControl.Resources>
<Grid>
<ListView x:Name="listView" ItemsSource="{Binding Persons}">
<ListView.View>
<GridView>
<GridViewColumn Width="140" Header="First Name" DisplayMemberBinding="{Binding FirstName}"/>
<GridViewColumn Width="140" Header="Last Name" DisplayMemberBinding="{Binding LastName}" />
</GridView>
</ListView.View>
<ListView.ContextMenu>
<ContextMenu>
<MenuItem
Header="Open"
Visibility="{Binding SelectedItem, ElementName=listView, Converter={StaticResource valueToVisibility}}"/>
<Separator/>
<MenuItem Header="Add..."/>
<MenuItem Header="Remove"/>
</ContextMenu>
</ListView.ContextMenu>
</ListView>
</Grid>
Run Code Online (Sandbox Code Playgroud)
非常感谢!
c++ ×2
algorithm ×1
api ×1
binding ×1
c# ×1
cocoa ×1
cocoa-touch ×1
command-line ×1
common-lisp ×1
comparison ×1
contextmenu ×1
datetime ×1
interface ×1
iphone ×1
java ×1
java-me ×1
lisp ×1
menuitem ×1
midlet ×1
midp ×1
philips-hue ×1
php ×1
printf ×1
scheduling ×1
visibility ×1
wpf ×1
zigbee ×1