有没有人知道有关计算机代数系统一般理论的任何资源(书籍,课程,讲义或任何内容)(例如mathematica,sympy)?
"介绍性"材料是首选,但我意识到,对于这样一个专门的主题,任何东西都必定相当先进.
math symbolic-math computer-algebra-systems symbolic-computation
我在这做错了什么?我该如何执行我的行动?
var recurse = new Action<IItem, Int32>((item, depth) =>
{
if (item.Items.Count() > 0) recurse(item, depth + 1); // red squiggly here
// ...
});
Run Code Online (Sandbox Code Playgroud)
当打电话recurse
说"方法,代表或事件预期"时,我得到了一个红色的波浪形.
更新
我接受了Homam的回答.我只是想添加/分享同样的另一种语法......但是我觉得眼睛看起来更容易......
Action<IEnumerable<Item>> Recurse = null;
Recurse = item =>
{
if (item.Items != null) Recurse(item.Items);
// ...
};
Run Code Online (Sandbox Code Playgroud) 这里有一些代码打印出从0到9的数字的平方:
for (int i = 0; i < 10; i++)
Console.WriteLine(i*i);
Run Code Online (Sandbox Code Playgroud)
通过for
循环从0到N加1 是一个非常常见的习语.
这是一种UpTo
表达这种方法的方法:
class MathUtil
{
public static void UpTo(int n, Action<int> proc)
{
for (int i = 0; i < n; i++)
proc(i);
}
}
Run Code Online (Sandbox Code Playgroud)
上面的方块示例现在是:
MathUtil.UpTo(10, (i) => Console.WriteLine(i * i));
Run Code Online (Sandbox Code Playgroud)
我的问题是,标准C#库是否带有类似上面的内容UpTo
?
理想情况下,我想要一种方法让'UpTo'成为所有整数对象的方法.所以我能做到:
var n = 10;
n.UpTo(...);
Run Code Online (Sandbox Code Playgroud)
这可能在C#中吗?
我有一些通常具有以下结构的NASM文件:
[BITS 64]
[ORG 0x0000000000200000]
start:
...
ret
Run Code Online (Sandbox Code Playgroud)
我正在组装它们:
nasm -f bin abc.asm
Run Code Online (Sandbox Code Playgroud)
我想用GAS写一些这些.两个问题:
我应该在GAS中使用哪些指令?我找到了'.org'指令,但GAS似乎没有'.bits'指令.
我应该传递什么gcc
或as
生成一个普通的二进制文件?即-f bin
NASM 的选项是什么.
我对C#很陌生,所以请耐心等待.
我注意到关于C#的第一件事是,许多类都是静态方法.例如...
为什么:
Array.ForEach(arr, proc)
Run Code Online (Sandbox Code Playgroud)
代替:
arr.ForEach(proc)
Run Code Online (Sandbox Code Playgroud)
为什么:
Array.Sort(arr)
Run Code Online (Sandbox Code Playgroud)
代替:
arr.Sort()
Run Code Online (Sandbox Code Playgroud)
随意给我点网上的常见问题解答.如果在某个地方的某本书中有详细的答案,我也欢迎指向它的指针.我正在寻找关于此的明确答案,但您的推测值得欢迎.
我没有Windows机器,只有Mac和Linux机器.Windows它相当昂贵,我也不想盗版它.
是否可以在Mac OS X或Linux中开发Windows Phone 7应用程序?是否需要Visual Studio?
网上有很多代数求解器和简化器(例如,algebra.com上的正确代数).但是,我正在寻找一些可以插入C#的东西,作为一个更大的项目的一部分(我正在制作我自己的计算器,但显然我会请求许可等).
理想情况下,我使用的代码如下:
String s = MathLib.Simplify("5x*(500/x^2*(sqrt(3)/4)+1)+2x^2+(sqrt(3)/2)*x^2");
Run Code Online (Sandbox Code Playgroud)
并且's'将简化为: "1082.532/x+5*x+2.866*x^2"
(那里的3dp准确性,但如果需要可以改变).
解决特定变量也会很好.我需要一些轻量级和快速的东西(如上所述的计算最好在5ms左右,包括启动延迟).
经过一些研究,像Sage,Octave或Mathematica这样的程序可能有点过分(我的应用程序可能只是一个小的<200k exe).Dotnumerics.com或Mathdotnet.com可能是合适的,但前者似乎没有提到代数简化,后者缺乏文档和示例是关闭的.我想知道是否有任何合适的替代方案.可在此处找到大型列表:http: //en.wikipedia.org/wiki/Comparison_of_computer_algebra_systems
我想的属性改变ScrollViewer
的ListBox
从C#.
我在Stackoverflow上找到了这个问题.我接受了接受的答案的建议,并将其ScrollViewer
作为子类的属性公开.但是,这似乎不适用于下面显示的示例.该问题中的一些评论也表明这种技术不起作用.
XAML:
<Window x:Class="StackoverflowListBoxScrollViewer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
</Window>
Run Code Online (Sandbox Code Playgroud)
C#:
using System;
using System.Windows;
using System.Windows.Controls;
namespace StackoverflowListBoxScrollViewer
{
public class MyListBox : ListBox
{
public ScrollViewer ScrollViewer
{ get { return (ScrollViewer)GetTemplateChild("ScrollViewer"); } }
}
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var myListBox = new MyListBox();
Content = myListBox;
myListBox.Items.Add(new Button() { Content = "abc" });
myListBox.Items.Add(new Button() { Content = "abc" });
myListBox.Items.Add(new …
Run Code Online (Sandbox Code Playgroud) 是否有一个函数可以反转通过管道传递的元素?
例如:
PS C:\> 10, 20, 30 | Reverse
30
20
10
Run Code Online (Sandbox Code Playgroud) 我需要从一般的angular_velocity转换为度/秒.
为了说明这个问题,示例boostUnits.cpp:
#include <boost/units/systems/si.hpp>
#include <boost/units/systems/angle/revolutions.hpp>
#include <boost/units/systems/angle/degrees.hpp>
#include <boost/units/conversion.hpp>
#include <boost/units/pow.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
boost::units::quantity< boost::units::si::angular_velocity> m_speed(
(30.0*boost::units::si::radians_per_second)
);
std::cout << "m_speed: " << m_speed << std::endl;
uint32_t result = static_cast<uint32_t>(
boost::units::quantity<boost::units::si::angular_velocity,uint32_t>(
m_speed*boost::units::degree::degrees/boost::units::si::seconds
).value()
);
std::cout << " result: "<< result << std::endl;
return(0);
}
Run Code Online (Sandbox Code Playgroud)
生成此编译器输出:
g++ boostUnits.cpp
/usr/local/include/boost/units/detail/conversion_impl.hpp: In static member function ‘static boost::units::quantity<Unit2, T2> boost::units::conversion_helper<boost::units::quantity<Unit1, T1>, boost::units::quantity<Unit2, T2> >::convert(const boost::units::quantity<Unit1, T1>&) [with Unit1 = boost::units::unit<boost::units::list<boost::units::dim<boost::units::time_base_dimension, boost::units::static_rational<-0x000000002l, 1l> >, boost::units::list<boost::units::dim<boost::units::plane_angle_base_dimension, boost::units::static_rational<2l, 1l> …
Run Code Online (Sandbox Code Playgroud)