我喜欢在我的手机上保留一个商店购买的iPhone应用程序版本,以便我可以重现出现的任何客户问题,但我显然也希望运行最新的开发版本.我可以安装两个(一个来自iTunes,一个来自xCode),但我对能够更好地分辨两者的方式感兴趣.我可能只是更改名称或图标暂时的,但似乎并不十分故障保护,即我可能会忘记与错误的图标出货.
有一个快乐的娱乐时间开发者方式来做到这一点?
我正在尝试格式化一些printf语句以允许任意级别的缩进.理想情况下,我想要以下输出,其中"One","Two"等是可变长度日志消息的占位符.
One
Two
Three
Two
One
Run Code Online (Sandbox Code Playgroud)
我正在研究缩进所需的可变长度间距,我知道我可以执行以下操作:
printf( "%*s", indent_level, "" );
Run Code Online (Sandbox Code Playgroud)
但我想知道是否有办法在没有第二个空字符串arg的情况下完成它.
Chingu示例看起来像这样:
require 'rubygems'
require 'chingu'
class Game < Chingu::Window
def initialize
super
@player = Player.new
end
end
class Player < Chingu::GameObject
def initialize(options = {})
super(options.merge(:image => Gosu::Image["player.png"])
end
end
Game.new.show
Run Code Online (Sandbox Code Playgroud)
如果我想用线而不是图像绘制Player对象,我将如何进行此操作?
以下代码看似直观,但我无法让它工作!
class Player < Chingu::BasicGameObject
def initialize(options = {})
super
@radius = options[:radius]
@c = Gosu::Color.new(0xffff0000)
end
def draw
$window.draw_rect([@x-1,@y+1,@x+1,@y+1,@x+1,@y-1,@x+1,@y+1],@c,1)
end
end
Run Code Online (Sandbox Code Playgroud)
难道我做错了什么?
调试Android应用程序的最佳方法是什么?每隔一段时间应用程序崩溃一次,它说应用程序意外停止,它从未说明为什么它会崩溃,或者在我的代码中,找到崩溃原因和异常的赌注方式是什么?
我尝试使用网站上的这篇文章这样的缓存配置:
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>
<section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler, NHibernate.Caches.SysCache" requirePermission="false" />
</configSections>
<!-- NHibernate -->
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<!-- dialect, connection string, etc... -->
<property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property>
<property name="cache.use_second_level_cache">true</property>
</session-factory>
</hibernate-configuration>
<!-- Caching -->
<syscache>
<cache region="LongTerm" expiration="3600" priority="5" />
<cache region="ShortTerm" expiration="900" priority="3" />
</syscache>
<-- ... -->
Run Code Online (Sandbox Code Playgroud)
不过,似乎我的 hibernate.cfg.xml 的架构文件不喜欢这个。我应该使用 cache.region_prefix 还是什么?我想使用 Syscache,顺便说一句。
我记得当我以前在日本开发网站时 - 有三种不同的字符编码货币 - 开发人员有一个技巧来"强制"编码源文件,所以它总是在他们的IDE中以正确的编码打开.
他们所做的是在包含日语字符的文件顶部放置注释,该日语字符仅存在于该特定字符编码中 - 它不在任何其他字符编码中!这非常有效.
我记得这一点,因为现在我有一个类似的,虽然是英语国家的问题.
我有一些文件必须是ISO-8859-1,但在我的编辑器(Linux上的Bluefish 1.0.7)中保持打开为UTF-8.除了磅(£)符号和诸如此类的东西之外,这通常不是问题.不要误会我的意思,我可以修复文件并将其另外保存为ISO-8859-1,但我希望它始终在我的编辑器中以ISO-8859-1打开.
那么,有没有任何类型的角色黑客 - 就像我上面提到的 - 这样做?还是其他任何方法?
PS.Unicode倡导者/福音传道者不必浪费时间试图转换我,因为我已经是其中之一!这是我继承的摇摇欲坠的旧系统:-(
PPS.请不要说"使用不同的编辑器"因为我是一个老屁并按我的方式设置:-)
我想我不完全理解析构函数在C++中是如何工作的.这是我为重新创建问题而编写的示例程序:
#include <iostream>
#include <memory>
#include <vector>
using namespace std;
struct Odp
{
int id;
Odp(int id)
{
this->id = id;
}
~Odp()
{
cout << "Destructing Odp " << id << endl;
}
};
typedef vector<shared_ptr<Odp>> OdpVec;
bool findOdpWithID(int id, shared_ptr<Odp> shpoutOdp, OdpVec& vec)
{
shpoutOdp.reset();
for (OdpVec::iterator iter = vec.begin(); iter < vec.end(); iter++)
{
Odp& odp = *(iter->get());
if (odp.id == id)
{
shpoutOdp.reset(iter->get());
return true;
}
}
return false;
}
int main()
{
OdpVec vec;
vec.push_back(shared_ptr<Odp>(new …Run Code Online (Sandbox Code Playgroud) 我已经基于列表框实现了自己的usercontrol.它具有一个具有集合类型的依赖项属性.当我在窗口中只有一个usercontrol实例时,它工作正常,但如果我有多个实例,我会遇到问题,他们共享集合依赖项属性.以下是说明这一点的示例.
我的用户控件名为SimpleList:
<UserControl x:Class="ItemsTest.SimpleList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="_simpleList">
<StackPanel>
<TextBlock Text="{Binding Path=Title, ElementName=_simpleList}" />
<ListBox
ItemsSource="{Binding Path=Numbers, ElementName=_simpleList}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</StackPanel>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
代码背后:
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace ItemsTest
{
public partial class SimpleList : UserControl
{
public SimpleList()
{
InitializeComponent();
}
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register("Title", typeof(string), typeof(SimpleList), new UIPropertyMetadata(""));
public List<int> Numbers
{
get …Run Code Online (Sandbox Code Playgroud) 我想知道你们对这两个框架的看法,包括:
我已经知道并使用jQuery,我最近发现它缺乏用于大型Web应用程序的"企业就绪"组件.
现在我不想开始讨论jquery,或者为什么mootools不在那里,我想知道你们对这两个框架的具体看法.
谢谢!
我想写一个迭代数字的循环 105 102 19 17 101 16 106 107
对于每次迭代,我想在查询中插入数字并将其插入表中.
伪:
LOOP (105 102 19 17 101 16 106 107)
FETCH select * from some_table where value=current_iteration_index --105..etc.
INTO my_rec_type
END LOOP;
Run Code Online (Sandbox Code Playgroud) android ×1
c ×1
c# ×1
c++ ×1
debugging ×1
destructor ×1
dojo ×1
ide ×1
iphone ×1
iso-8859-1 ×1
itemscontrol ×1
javascript ×1
libgosu ×1
nhibernate ×1
oracle ×1
plsql ×1
printf ×1
process ×1
ruby ×1
sql ×1
syscache ×1
unicode ×1
wpf ×1
xcode ×1
yui ×1