- 浏览: 36497 次
文章分类
- 全部博客 (35)
- java (36)
- Toast to C (1)
- Java二进制指令代码解析 (1)
- CHAR (1)
- varchar以及varchar2的区别 (1)
- Java学习笔记(二)----JBoss发展现状 (1)
- Enum的策略模式 (1)
- j2EE开发群 欢迎加入该群一起学习 群号:172429747 (1)
- clipRect 介绍 (1)
- 认识Java程序之对象间消息传递 (1)
- Android的Location功能代码 (1)
- Android的Activity之间的通信 (1)
- 关于提高自己JAVA水平的十大技术讨论(转) (1)
- 推荐三本书 (1)
- C#打印DataGrid中的数据 (1)
- 注意新技术的风险是否会超过获得成功的几率 (1)
- MapXtreme2004代码 简单专题图的显示 (1)
- 在网页中插入RM视频文件的历程 (1)
- 《使用 Microsoft .NET 的企业解决方案模式》读书笔记2 (1)
- xml格式字符串与java对象互转 (1)
- 手机wifi传文件的一简单代码 (1)
- HOWTO: Disable HTTP Methods in Apache (1)
- SQL 笔试题(摘) (1)
- java的ProcessBuilder阻塞问题 (1)
- 现在在郑州做java开发想去深圳 (1)
- Could not find a JavaScript runtime (1)
- 构造方法,重载,多个,无参,参数,this,super (1)
- Servlet多线程 (1)
- 如何使SOLR系统自动AUTO COMMIT (1)
- Linux下Mysql表名区分大小写 (1)
- 好玩的游戏合集~~ (1)
- HashMap源码分析 (1)
- 以一个枢纽值二分一个数组 (1)
最新评论
-
liuyes:
写的有点乱呀
HashMap源码分析 -
chenglinjava:
来北京吧!!!
现在在郑州做java开发想去深圳
<h4>By Jason – October 13, 2011</h4>
From: http://jasonvictordartmouth.posterous.com/a-toast-to-c
At
Cloudmetrx, we use a lot of C. So given the recent passing of UNIX
legend Dennis Ritchie, the creator of the C language, we think a toast
to C is only fitting.
Our extensive reliance on C is especially
unusual considering the other languages in our stack – Clojure, Node.js,
and other hipster platforms. We aren't predisposed to using older,
"venerated" technologies simply because they're older and venerated. But
when it comes to high-performant computation, there's just nothing like
C. Some will claim Java, but those people are incorrect. There's
nothing like C.
In my opinion, the reason C has maintained its
popularity for all these years is that it is relatively paradigm-free.
Most languages, for better or worse, come equipped with some inherently
recommended programming paradigm – object-oriented, functional,
whatever. The realities of the hardware, then, are sculpted to best
support that paradigm.
C, on the other hand, doesn't sculpt the
hardware. It gives you raw access to the hardware. You do what you wish
with the hardware. There is no inherent overhead due to your paradigm –
you are expected to enforce whatever paradigm you please by yourself.
C
is the Turing part of the Church-Turing Thesis. C basically gives you
math plus a ticker tape you can write onto. All algorithms revolve
around those two basic concepts: reading and writing to the tape, and
doing small mathematical operations.
As it happens, the universal
computing device referred to in the Thesis is implemented like Turing,
but often used like Church. The lambda calculus revolves around
meaningful and elegant representations of behavior, as it makes sense to
humans; but the Turing Machine represents behavior as it makes sense
for a machine based on transistors and electrons. It is the more natural
of the two; and so C is a more natural way to harness the power of the
actual hardware, at the expense of readability, and perhaps even
elegance.
It is quite a feat to create a technology still being
actively used decades after its inception and rise to popularity. I
don't think the only reason is that it is (relatively speaking)
paradigm-free. The syntax itself is also brilliant – as complex as the
language is, and as complex as managing memory is, C makes it
brilliantly clear what is going on. The C syntax has also influenced
other languages – from PERL to Java to JavaScript – a testament to its
clarity and usability.
And with all this power, C is still a joy
to write in. There's something special to me about cracking a 5-hour
energy and sitting down with <tt>vim</tt>
to hack some C. It's like
driving a manual car, and feeling the rush as you switch gears, going
faster and faster. After a month of Python, C drives like a BMW with a
rocket engine. The speed is facemelting; you run <tt>time</tt>
and your jaw drops at the results – a millisecond! For that? Amazing.
But C isn't always pretty. C can be a naughty girl that seg faults, leaving you in despair, confused, forced to use <tt>gdb</tt>
. But at the end of the day, you always come back to C – that seductress of speed. [Citation needed]
At Cloudmetrx, we use C for essentially all of our financial logic except bootstrapping
.
Without the ability to crank out a blindingly fast result in C, the
Real-Time Cloudmetrx product would likely be impossible, since we
wouldn't be able to use horizontal scale to handle the loads. And
indeed, the speed difference between a derivative pricing model – many
of which require Monte Carlo – written in C and a model written in Java
is noticeable. Not huge, but noticeable; and likely too big to serve
real-time financial analytics.
So here's to C, that naughty girl, that seductress of speed. Salud!
?
发表评论
-
以一个枢纽值二分一个数组
2012-02-08 15:17 869划分算法由两个指针开始,分别指向数组的两头。在左边的指 ... -
HashMap源码分析
2012-02-08 13:33 1116[size=medium;]HashMap源码分析 ... -
好玩的游戏合集~~
2012-02-07 16:19 1049因为刚接触windows phone不久,自己平时收藏 ... -
Linux下Mysql表名区分大小写
2012-02-04 13:58 11461、Linux下mysql安装完后是默认:区分表名的 ... -
如何使SOLR系统自动AUTO COMMIT
2012-02-03 16:49 906转自:http://blog.csdn.net/thu ... -
Servlet多线程
2012-02-03 13:24 922? <div class="Se ... -
构造方法,重载,多个,无参,参数,this,super
2012-02-02 14:29 2416构造方法名([参数列表]){ ? [this([参数 ... -
Could not find a JavaScript runtime
2012-02-02 13:19 776My Rails3.1 app worked fine ... -
现在在郑州做java开发想去深圳
2012-01-31 14:43 918 &nb ... -
java的ProcessBuilder阻塞问题
2011-12-28 18:08 1347<span style="color: ... -
SQL 笔试题(摘)
2011-12-28 11:29 1005(1)表名:购物信息 购物人 商品名称 ... -
HOWTO: Disable HTTP Methods in Apache
2011-12-21 14:59 919<h3 class="entry-h ... -
手机wifi传文件的一简单代码
2011-12-20 13:39 1315手机与笔记本传文件的方法有很多种,如果不方便使用蓝牙 ... -
xml格式字符串与java对象互转
2011-12-20 11:34 1435import java.lang.reflect. ... -
《使用 Microsoft .NET 的企业解决方案模式》读书笔记2
2011-12-19 10:39 713第2章 组织模式 面向对象编程的基本元素是类。但是,如 ... -
在网页中插入RM视频文件的历程
2011-12-19 08:59 982俺最早想到的是直接利用Frontpage2003,看看 ... -
MapXtreme2004代码 简单专题图的显示
2011-12-15 14:24 713MapControl1.Map.Clear();< ... -
注意新技术的风险是否会超过获得成功的几率
2011-12-14 18:28 362</span></span> ... -
C#打印DataGrid中的数据
2011-12-14 16:59 1339<span style="" ... -
推荐三本书
2011-12-13 15:19 695推荐最近一直在看的三本书,很好,真的很好,别的也没什么 ...
相关推荐
在XCode的项目导航器中,右键单击“ Libraries ➜ Add Files to [your project's name] 转到node_modules @merryjs/toast并添加MerryToast.xcodeproj 在XCode的项目导航器中,选择您的项目。 将libMerryToast.a...
即使Toast-to-front应用程序与下图所示的先前显示的应用程序无关,Toast也将保留在屏幕上: 您可以很容易地注意到,Toasts的问题在于它们是持久的。 吐司被解雇后,它会显示在任何屏幕的顶部,并且在创建时所指定的...
- _I'd ask you to raise your glass and join me in a toast to the health of all our friends present here._(请大家举杯,一起为在座的所有朋友的健康干杯。) - _Here's to you!_(为您干杯!) - _To your...
为某人干杯(toast to someone):在庆祝或敬意时举杯向某人表示祝贺或敬意。 记得(不要)去做某事(remember (not) to do something):记住要或不要执行某个行动。 第一次(for the first time):首次,第一次做...
RubyOnWheels Toast模块,允许您使用Ruby进行编码!..." # Prints to Toast's logger motor = Toast :: Motor . new :talon , :can , 1 # Creates a new Talon on the CAN Bus with ID 1 motor . set 0.4 # Set
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } public native String stringFromJNI(); } ``` 七、构建与运行 保存所有更改后,点击Android Studio顶部菜单的"Build" -> "Rebuild Project",...
小行星警报 这是一个使用JavaScript构建的... $toast("Deleted", "#E74C3C"); }) $alert("Successfull", '#E74C3C') $toast("No internet connection", "#F4D03F") $loader_show("#FF5733") If you don't pr
Android NDK(Native Development Kit)是Google为Android平台提供的一套工具集,允许开发者使用C、C++等原生代码来开发应用的一部分或全部功能。这个"androidNDK helloworld"资源就是一个入门级别的示例,旨在帮助...
例如,可以定义三个点A、B、C,然后用`moveTo(A.x, A.y)`开始,接着`lineTo(B.x, B.y)`,再`lineTo(C.x, C.y)`,最后用`close()`封闭路径。 - 调用`canvas.drawPath(path, paint)`:在`onDraw()`方法中,使用定义好...
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } } ``` 通过上述步骤,我们成功地在第二个项目中使用了在第一个项目中生成的JNI库。需要注意的是,如果在多个项目间共享.so库,最好将其封装为独立的...
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } } ``` 这里通过`System.loadLibrary()`加载.so文件,并通过`native`关键字声明本地方法。 步骤五:生成.so文件 1. 在Android Studio中,点击顶部...
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } public native String stringFromJNI(); } ``` 至此,我们已经完成了Java和C++之间的接口定义。接下来,需要通过CMakeLists.txt来编译C++代码。在...
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } } ``` 在`onCreate`方法中,我们调用了`stringFromJNI()`方法,并显示了返回的结果。 接下来,我们需要为C/C++代码生成JNI接口。在Android Studio...
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } ``` 7. **编译与运行**:更新完所有文件后,构建项目,生成APK并安装到设备上。运行应用,本地方法的实现将被执行,可以看到相应的输出。 通过...
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } } ``` 6. **构建和运行**: 最后,确保你的Android Studio已经配置了正确的设备或模拟器,然后点击运行按钮。如果一切正常,你的应用将能够调用本地...
11. **潜在致癌性**:"the compound is _____ to cause cancer" 丙烯酰胺被认为可能致癌,[C] "suspected" 表示“被怀疑”,符合描述。 12. **预防原则**:"but have no hard scientific proof ____ the ...
Toast.makeText(this, stringFromJNI(), Toast.LENGTH_SHORT).show(); } } ``` 5. **生成JNI头文件** 使用`javah`工具(现在通常由Android Studio的`Make Project`操作代替)生成JNI头文件。头文件会声明C/C++...
- 选项 C 表示发送短信,这是不正确的,发送短信需要使用 `Intent.ACTION_SEND` 并且指定 `sms:` 或 `smsto:` 协议。 - 选项 D 表示其他项不正确,这是不正确的,因为 B 项是正确的。 ### 3. 移动互联网的定义 -...
imageResId = new int[] { R.drawable.a, R.drawable.b, R.drawable.c, R.drawable.d, R.drawable.e }; titles = new String[imageResId.length]; titles[0] = "第一个"; titles[1] = "第二个"; titles...
Toast.makeText(this, result, Toast.LENGTH_SHORT).show(); } public native String stringFromJNI(); } ``` 总结起来,这个教程涵盖了如何使用NDK和CMake构建Android应用,将C++代码编译为.so库,并通过JNI...