灯角

文章 评论 浏览 24

灯角 2024-10-05 02:09:28

命令 - 从模拟器获取日志

adb -e logcat 

adb.exe 可以在 $your_installation_path$\android sdk\platform-tools 找到

更详细的信息
https:// learn.microsoft.com/ru-ru/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows

Command - get log from the emulator

adb -e logcat 

adb.exe can be found at $your_installation_path$\android sdk\platform-tools

more detailed
https://learn.microsoft.com/ru-ru/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows

android模拟器中的console.log浏览器

灯角 2024-10-04 20:35:54

我的答案的灵感来自 bkk

 public static class ObservableCollection
    {
        public static void Sort<TSource, TKey>(this ObservableCollection<TSource> source, Func<TSource, TKey> keySelector, bool isAZ)
        {
            if (isAZ)
            {
                List<TSource> sortedList = source.OrderBy(keySelector).ToList();
                source.Clear();
                foreach (var sortedItem in sortedList)
                {
                    source.Add(sortedItem);
                }
            }
            else
            {
                List<TSource> sortedList = source.OrderByDescending(keySelector).ToList();
                source.Clear();
                foreach (var sortedItem in sortedList)
                {
                    source.Add(sortedItem);
                }
            }         
        }
    }

用法

 _someObservableCollection.Sort(x => x.Number, false); // Where number is an simple property (non-object)

My answer is inspired by bkk

 public static class ObservableCollection
    {
        public static void Sort<TSource, TKey>(this ObservableCollection<TSource> source, Func<TSource, TKey> keySelector, bool isAZ)
        {
            if (isAZ)
            {
                List<TSource> sortedList = source.OrderBy(keySelector).ToList();
                source.Clear();
                foreach (var sortedItem in sortedList)
                {
                    source.Add(sortedItem);
                }
            }
            else
            {
                List<TSource> sortedList = source.OrderByDescending(keySelector).ToList();
                source.Clear();
                foreach (var sortedItem in sortedList)
                {
                    source.Add(sortedItem);
                }
            }         
        }
    }

Usage

 _someObservableCollection.Sort(x => x.Number, false); // Where number is an simple property (non-object)

订购 ObservableCollection无需创建新的

灯角 2024-10-04 20:22:44

查看 itertools izip。它看起来像这样

for i,j in izip( mylistA, mylistB ):
    print i + j

zip 函数也可以工作,但 izip 创建一个迭代器,它不会强制创建第三个列表。

Look at itertools izip. It'll look like this

for i,j in izip( mylistA, mylistB ):
    print i + j

The zip function will also work but izip creates an iterator which does not force the creation of a third list.

Python-同时迭代2个列表

灯角 2024-10-04 13:46:21

此处介绍了将实体框架与 MySQL 结合使用。

Using Entity Framework with MySQL is covered here.

来自 MySQL 服务器中数据库的实体框架 4.0 模型

灯角 2024-10-04 13:11:13
select Location, ...
from clinicdoctors
where 
 ISNULL(@Location,Location) = Location
 and ISNULL(@DoctorName,DoctorName) = DoctorName
 and ISNULL(@SpecialtyName,SpecialtyName) = SpecialtyName
select Location, ...
from clinicdoctors
where 
 ISNULL(@Location,Location) = Location
 and ISNULL(@DoctorName,DoctorName) = DoctorName
 and ISNULL(@SpecialtyName,SpecialtyName) = SpecialtyName

SQL语句过滤结果

灯角 2024-10-04 09:23:33

正如您所发现的,神秘的 : 只是一个 打开和关闭大括号的替代语法。当您将 PHP 与 HTML 混合时,它是最有效的,因为它可以更容易地发现您是否正在关闭 ifforforeachwhile 结构。

if($foo):
  // Do something
endif;

for($i = 0; $i < 10; $i++):
  // Do something
endfor;

foreach($foo as $k, $v):
  // Do something
endforeach;

while($foo):
  // Do something
endwhile;

As you have discovered, the mysterious : is simply an alternative syntax to opening and closing curly brackets. It's most effective when you're mingling PHP with HTML, since it makes it easier to discover whether you're closing an if, for, foreach or while structure.

if($foo):
  // Do something
endif;

for($i = 0; $i < 10; $i++):
  // Do something
endfor;

foreach($foo as $k, $v):
  // Do something
endforeach;

while($foo):
  // Do something
endwhile;

使用“:”将 PHP 嵌入 HTML操作员

灯角 2024-10-04 09:05:12

错误处理程序和记录器是两个不同的实体。错误处理程序决定如何处理错误。应该立即发送到记录器,应该将其保存在数据库中,还是应该简单地保存在某个缓冲区中直到有人询问。
记录器决定如何记录给定的消息。它应该显示在控制台上还是应该保存在磁盘文件中,应该以什么格式显示。

请记住记录器的功能。
1)它应该是独立的类。它的行为不应该依赖于其他类。
2)记录器最好是单例的。您不需要许多漂浮的物体做同样的事情。但是单例类在多线程方面也有自己的麻烦。所以我知道这一点是有争议的。
3)它必须并且必须具有异步日志记录的能力。这意味着生产者和消费者的实现。 (日志记录是一种 I/O 操作,因此本质上是昂贵的。您不希望主处理占用此操作。但话又说回来,您可能不想使用线程来废弃这个操作。)

在错误记录器的实现中,我可以没有看到任何记录器。此外,您的错误处理程序正在保存一个错误。您可能需要错误向量。将 SetError 保留为固定参数。传递错误 ID、错误消息和错误缓冲区长度等参数。让调用者创建错误消息。

Error Handler and logger are two different entities. Error handler decides what to do with the errors. Should it be send to logger immediately, should it be saved in databases, or should it be simply saved in some buffer till someone asks.
Logger decides how to log the given message. Should it be shown on the console or should it be saved in the disk file, in what format it should be shown.

Keep in mind the features of the logger.
1) It should be independent class. It's behavior should not depend on the other classes.
2) Logger most preferable should be singleton. You don't need many objects floating around doing the same thing. But then singleton classes has their own headaches when come to multi-threading. So I know this point is debatable.
3) It must and must have capabilities of asynchronous logging. This means producer and consumer implementation. (Logging is an i/o operation and hence expensive in nature. You don't want your main processing hogging for this. But then again you may not want to use threads to scrap this one.)

In you implementation of error logger I can't see any logger. Also your error handler is saving a single error. You may need the vector of errors. Keep SetError with fixed arguments. Pass arguments like error id, error message and error buffer length. Let the caller create the error message.

如何向类添加错误记录器

灯角 2024-10-04 04:21:50

这是一个简单的解决方案,只需旋转进度条即可

android:rotation="270"

Here is a simple solution, just rotate your progress bar

android:rotation="270"

Android - 将 ProgressBar 设置为垂直条而不是水平条?

灯角 2024-10-04 01:17:03

我不知道有任何数据序列化语言可以满足您的所有这些要求。

我非常喜欢 JSON 和 OGDL(因为它们比 XML 更容易阅读),但它们(至少)都无法允许继承。

PS:维基百科此处对流行数据格式进行了比较。

PPS:我想你应该考虑编写一个 DSL内部(或)实现并不难实现,您可以使用 Python 本身作为宿主语言。

I don't know of any data serialization language that satisfies all of those requirements of yours.

I'm very fond of JSON and OGDL (because they are much easier to read then XML), but they both fail (at least) in allowing inheritance.

PS: Wikipedia has a comparison of popular data formats here.

PPS: I guess you should consider writing a DSL. A internal (or weak) implementation would not be that hard to implement, and you could use Python itself as the host language.

人类和计算机可读的分层数据格式,具有跨文件继承性

灯角 2024-10-04 00:51:51

看起来您在 GA 前面缺少一个单引号 '

It looks like you are missing a single quote ' in front of GA.

不在 SQL Server 2005 中

灯角 2024-10-03 20:39:07

这适用于输出 XML,但我仍然不知道如何输出 HTML:

(defn dom->xml
  "serialize a dom element back to XML text"
  [elem]
  (let [sw (java.io.StringWriter.)]
    (.serialize
     (org.apache.xml.serialize.XMLSerializer. 
      sw (org.apache.xml.serialize.OutputFormat.))
     elem)
    (str sw)))

This works for outputting XML, but I still don't know how to output HTML:

(defn dom->xml
  "serialize a dom element back to XML text"
  [elem]
  (let [sw (java.io.StringWriter.)]
    (.serialize
     (org.apache.xml.serialize.XMLSerializer. 
      sw (org.apache.xml.serialize.OutputFormat.))
     elem)
    (str sw)))

将 NekoHTML ElementNSImpl 对象序列化回 HTML/XML

灯角 2024-10-03 18:34:03

您可以将包含第一个单元格内容的 UIView 放置在 UITableView 的顶部。当您填充单元格时,您应该将第一个单元格留空(它将被初始位置的固定 UIView 覆盖)。

You can place the UIView with the content of the first cell on top of the UITableView. When you fill up the cells you should leave the first cell empty (it will be covered by the fixed UIView in the initial position).

UITableView 中的顶行固定

灯角 2024-10-03 18:15:24
sed -i.bak -r 's/page-([0-9]+)/apple-\1.html/' file

sed  's/page-\([0-9][0-9]*\)/apple-\1.html/' file > t && mv t file

除了sed之外,你还可以使用gawk的gensub()

awk '{b=gensub(/page-([0-9]+)/,"apple-\\1.html","g",$0) ;print b  }' file
sed -i.bak -r 's/page-([0-9]+)/apple-\1.html/' file

sed  's/page-\([0-9][0-9]*\)/apple-\1.html/' file > t && mv t file

Besides sed, you can also use gawk's gensub()

awk '{b=gensub(/page-([0-9]+)/,"apple-\\1.html","g",$0) ;print b  }' file

如何在sed命令中使用正则表达式

灯角 2024-10-03 16:04:41

Ruby — 52

s=?1;loop{puts s;s.gsub!(/(.)\1*/){"#{
amp;.size}"+$1}}

任务太简单了,也太没用了……

Ruby — 52

s=?1;loop{puts s;s.gsub!(/(.)\1*/){"#{
amp;.size}"+$1}}

Task is too simple, and too perlish...

代码高尔夫:莫里斯数列

灯角 2024-10-03 14:54:49

如果您使用的是NServiceBus V3,您可以查看IMutateOutgoingMessages和IMutateIncomingMessages接口。

http://support.nservicebus.com/customer/portal /articles/894155-nservicebus-message-mutators-sample

或者,如果您想让消息按特定顺序通过处理程序,请查看此链接:

http://support.nservicebus.com/customer /portal/articles/862397-如何指定调用处理程序的顺序-

If you are using NServiceBus V3, you can take a look at the IMutateOutgoingMessages and IMutateIncomingMessages interfaces.

http://support.nservicebus.com/customer/portal/articles/894155-nservicebus-message-mutators-sample

Or if you want to have the messages go through handlers in a specific order, check out this link:

http://support.nservicebus.com/customer/portal/articles/862397-how-do-i-specify-the-order-in-which-handlers-are-invoked-

NServiceBus消息拦截?

更多

推荐作者

搞钱吧!!!

文章 0 评论 0

zhangMack

文章 0 评论 0

qq_je1Wlq

文章 0 评论 0

fsdcds

文章 0 评论 0

unknown

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文