我已将宝石放入红宝石中。我可以安装它,但是我不需要它。
irb(main):032:0>需要'jsql'
startAnimation() { Animated.parallel([ Animated.timing(this.state.translate, { toValue: -27, duration: 200, }), Animated.timing(this.state.color, { toValue: 1, duration: 300, }), ]).start(); this.setState({ fontWeight: '800' });}; stopAnimation() { this.state.translate.setValue(0); this.state.color.setValue(0); this.setState({ fontWeight: '400' });};
LoadError(无法加载此类文件-jsql)
我曾经遇到过这个问题,需要机械化宝石。
答案 0 :(得分:0)
似乎您已经创建了一个名为public class SemiNumericComparer : IComparer<string>
{
public int Compare(string s1, string s2)
{
if (int.TryParse(s1, out var i1) && int.TryParse(s2, out var i2))
{
if (i1 > i2)
{
return 1;
}
if (i1 < i2)
{
return -1;
}
if (i1 == i2)
{
return 0;
}
}
var text1 = SplitCharsAndNums(s1);
var text2 = SplitCharsAndNums(s2);
if (text1.Length > 1 && text2.Length > 1)
{
for (var i = 0; i < Math.Max(text1.Length, text2.Length); i++)
{
if (text1[i] != null && text2[i] != null)
{
var pos = Compare(text1[i], text2[i]);
if (pos != 0)
{
return pos;
}
}
else
{
//text1[i] is null there for the string is shorter and comes before a longer string.
if (text1[i] == null)
{
return -1;
}
if (text2[i] == null)
{
return 1;
}
}
}
}
return string.Compare(s1, s2, true);
}
private string[] SplitCharsAndNums(string text)
{
var sb = new StringBuilder();
for (var i = 0; i < text.Length - 1; i++)
{
if ((!char.IsDigit(text[i]) && char.IsDigit(text[i + 1])) ||
(char.IsDigit(text[i]) && !char.IsDigit(text[i + 1])))
{
sb.Append(text[i]);
sb.Append(" ");
}
else
{
sb.Append(text[i]);
}
}
sb.Append(text[text.Length - 1]);
return sb.ToString().Split(' ');
}
}
的宝石,它在https://docs.expo.io/versions/latest/introduction/already-used-react-native#useful-commands上列出。
因此,要使用它,您需要使用from my_app.task import long_task
import json
import asyncio
loop = asyncio.get_event_loop()
def my_view(request):
body = request.body
body = json.loads(body)
key = body['key']
arguments = [key]
loop.run_in_executor(None, long_task, arguments)
return JsonResponse({'message': 'request submitted'})
安装它,或者将其与其他依赖项一起添加到项目的Gemfile中,然后运行jsql
仅在执行此步骤后,您的宝石才能使用。