GVKun编程网logo

Your Computer’s Trusted Platform Module Has Malfun

1

在本文中,我们将为您详细介绍YourComputer’sTrustedPlatformModuleHasMalfun的相关知识,此外,我们还会提供一些关于AddingOpenSource3DPhysi

在本文中,我们将为您详细介绍Your Computer’s Trusted Platform Module Has Malfun的相关知识,此外,我们还会提供一些关于Adding Open Source 3D Physics to Your iOS Applications (3)Using Bullet in Your iOS Application、An AI to estimate your heart rate using your face、Androd 应用开发你遇到过这种错误吗?Your project contains error (s),please fix them before running your applica...、angular -- 在 coreModule 中导入 sharedModule 没有循环依赖 app.module.tscore.module.tsshared.module.tsshared.module.ts ===> log.service.ts的有用信息。

本文目录一览:

Your Computer’s Trusted Platform Module Has Malfun

Your Computer’s Trusted Platform Module Has Malfun

Your Computer’s Trusted Platform Module Has Malfun
升级 BIOS fireware 重启立刻解决。

其实可以尝试清除 TPM,但有可能导致一些未知情况,比如清除后不能读取一些文件等,如果真要清除,建议备份好重要文件先。

Adding Open Source 3D Physics to Your iOS Applications (3)Using Bullet in Your iOS Application

Adding Open Source 3D Physics to Your iOS Applications (3)Using Bullet in Your iOS Application

Using Bullet in Your iOS Application

All that remains is to build an application that actually uses Bullet and displays 3D objects. Apple's GLKit framework makes it relatively easy.

Make the view controller class generated by Xcode's Single View Application template into a subclass of GLKViewController instead of UIViewCintroller. The PViewController.h file in the tutorial sample code contains the following lines:

#import <GLKit/GLKit.h>
 PViewController : @interfaceGLKViewController

Next,edit the MainStoryboard.storyboard file generated by Xcode's Single View Application template. Set the class of the generated view to GLKView using Xcode's Identity inspector,shown in figure 12.

Figure 12 Setting the view's class to GLKView

Add the GLKit and OpenGLES frameworks to the project. The easiest way is to edit the project's Build Phases,as shown in figure 13. Press the + button in the Link Binary with Libraries section to add frameworks.

Figure 13 GLKit and OpenGLES frameworks added to the project

If you build and run the tutorial project Now,you should see a black screen. The next step is to create a physics simulation and draw something more interesting.

The tutorial source code includes a file named PAppDelegate.mm. The .mm extension tells Xcode to compile the file as Objective-C++ code intermixing C++ and Objective-C. The following code declares instance variables to store Bullet physics objects:

#import "PAppDelegate.h"
#include "btBulletDynamicsCommon.h"
#include <map>


 < *,*> 
   GModelShapeMap;


  ()
{
    *collisionConfiguration;
    *dispatcher;
    *overlappingPairCache;
    *solver;
    *dynamicsWorld;
   *> collisionShapes;
   
    modelShapeMap;
}

@endtypedefstd::mapPPhysicsObjectbtCollisionObject@interfacePAppDelegatebtDefaultCollisionConfigurationbtCollisiondispatcherbtbroadphaseInterfacebtSequentialImpulseConstraintSolverbtdiscreteDynamicsWorldbtAlignedobjectArray<btCollisionShapeGModelShapeMap

The GModelShapeMap modelShapeMap variable is used to store the relationships between Objective-C objects representing Boxes and spheres and the corresponding shapes simulated by Bullet. A C++ map is a standard class similar in function to Cocoa Touch'sNSDictionary class.

The physics simulation is initialized in PAppDelegate's -application:didFinishLaunchingWithOptions: method that's part of the Cocoa Touch standard application delegate protocol. The simulation is configured to use Earth's gravitational acceleration of -9.81 meters per second2. Comments explain the steps needed to initialize Bullet. Don't worry if it doesn't make much sense to you. It's boilerplate code.

/////////////////////////////////////////////////////////////////
// Creates needed physics simulation objects and configures
// properties such as the acceleration of gravity that seldom
// if ever change while the application executes.
- ()application:( *)application 
   didFinishLaunchingWithOptions:( *)launchOptions
{
    ///collision configuration contains default setup for memory,// collision setup. Advanced users can create their own 
   // configuration.
     =  
      ();
   
    ///use the default collision dispatcher. For parallel 
   // processing you can use a diffent dispatcher 
   // (see Extras/BulletMultiThreaded)
     = 	  
      ();
   
    ///btDbvtbroadphase is a good general purpose broadphase. You 
   // can also try out btAxis3Sweep.
     =  ();
   
    ///the default constraint solver. For parallel processing you 
   // can use a different solver (see Extras/BulletMultiThreaded)
     =  ;
   
     = 
       (,);
   
    ->setGravity(());
   
   return YES;
}BOOLUIApplicationNSDictionarycollisionConfigurationnewbtDefaultCollisionConfigurationdispatchernewbtCollisiondispatchercollisionConfigurationoverlappingPairCachenewbtDbvtbroadphasesolvernewbtSequentialImpulseConstraintSolverdynamicsWorldnewbtdiscreteDynamicsWorlddispatcheroverlappingPairCachesolvercollisionConfigurationdynamicsWorldbtVector30,-9.81,0

PAppDelegate's -applicationWillTerminate: method tears down the simulation built in -application:didFinishLaunchingWithOptions:. It's not necessary to implement -applicationWillTerminate: in the tutorial sample code because when the application terminates,iOS will automatically reclaim the memory and other resources consumed by the physics engine. The code is provided in PAppDelegate.mm as example to follow if you ever need to clean up the physics engine while the application continues to execute.

PAppDelegate provides the following -physicsUpdateWithelapsedtime: method. Call the method periodically to give the physics engine opportunities to recalculate object positions and orientations.

/////////////////////////////////////////////////////////////////
// Turn the crank on the physics simulation to calculate 
// positions and orientations of collision shapes if
// necessary. The simulation performs up to 32 interpolation
// steps depending on the amount of elapsed time,and each step
// represents 1/120 seconds of elapsed time.
- ()physicsUpdateWithelapsedtime:()seconds;
{
   dynamicsWorld->stepSimulation(seconds,/);
}voidNSTimeInterval321120.0f

That's all it takes to start using Bullet physics for iOS. The simulation doesn't produce any interesting results unless some objects are added and set in motion to collide with each other. It's time to create,register,and draw physics objects.

GLKit provides most of the features needed. The tutorial project includes files named sphere.h and cube.h containing data declarations for 3D shapes. The data consists of vertex positions and "normal" vectors. Each shape is drawn as a list of connected triangles. The normal vectors provide information used to calculate how much simulated light reflects from each triangle.

The PViewController class implements all of the drawing for the tutorial. The drawing code is suboptimal to keep the code simple,and it turns out not to matter at run time. Profiling the tutorial code reveals that less than 20% of the application's execution time is spent drawing. Even if the drawing code is removed entirely,the application only runs 20% faster.

PViewController declares the following properties. The baseEffect property stores an instance of GLKit's GLKBaseEffect class. Modern GPUs are programmable allowing almost unlimited flexibility when rendering 3D graphics. The programs running on the GPU are sometimes called effects. GLKBaseEffect encapsulates the GPU programs needed by simple applications so that you don't need to dive into GPU programming when getting started.

@interface  ()

@property (strong,nonatomic,readwrite)
    *baseEffect;
@property (strong,readwrite) 
    *BoxPhysicsObjects;
@property (strong,readwrite) 
    *spherePhysicsObjects;
@property (strong,readwrite) 
    *immovableBoxPhysicsObjects;
   
@endPViewControllerGLKBaseEffectNSMutableArrayNSMutableArrayNSMutableArray

Other than baseEffect,the other properties all store arrays of Objective-C objects representing spheres and Boxes in the simulation. Bullet only recalculates positions for physics objects that have mass. Objects created with zero mass are therefore immovable within the simulation. They don't become displaced when other objects collide or fall in response to gravity. The immovableBoxPhysicsObjects property stores an array of zero mass Boxes used to form a floor. Without a few immovable objects in the simulation,all of the other objects would quickly fall out of view as the result of simulated gravity.

Two GLKViewController methods provide the key to drawing with GLKit: -update and -glkView:drawInRect:. The –update method is called periodically in sync with the iOS device display refresh rate. The display always refreshes 60 times per second,butGLKViewController's default behavior is to call –update at 30Hz. In other words, –update is called once for every two display refreshes. GLKViewController can be configured to call –update at other rates,but 30 times per second works well for simulations. Right after calling –update, GLKViewController tells the view it controls to display,and the view calls back to GLKViewController's -glkView:drawInRect:. Therefore,you implement simulation update in –update and implement custom 3D drawing code in -glkView:drawInRect:.

/////////////////////////////////////////////////////////////////
// This method is called automatically at the update rate of the 
// receiver (default 30 Hz). This method is implemented to
// update the physics simulation and remove any simulated objects
// that have fallen out of view.
- ()update
{
    *appDelegate = 
      [[] ];
   
   [appDelegate :
      .];

   // Remove objects that have fallen out of view from the 
   // physics simulation
   [ ];
}voidPAppDelegateUIApplication sharedApplicationdelegatephysicsUpdateWithelapsedtimeselftimeSinceLastUpdateselfremoveOutOfViewObjects

The following drawing code sets baseEffect properties to match the orientation of the iOS device,specifies perspective,positions a light,and prepares for drawing 3D objects. Theaspect ratio is the ratio of a view's width to its height. The aspect ratio may change when an iOS device is rotated from portrait orientation to landscape and back. Perspectivedefines how much of the 3D scene is visible at once and how objects in the distance appear smaller than objects up close.

In the real world,we only see objects that reflect light into our eyes. We perceive the shape of objects because different amounts of light reflect for different parts of the objects. Setting the baseEffect's light position controls how OpenGL calculates the amount of simulated light reflected off each part of a virtual 3D object. Calling [self.baseEffect preparetoDraw] tells the base effect to prepare a suitable GPU program for execution.

/////////////////////////////////////////////////////////////////
// GLKView delegate method: Called by the view controller's view
// whenever Cocoa Touch asks the view controller's view to
// draw itself. (In this case,render into a frame buffer that
// shares memory with a Core Animation Layer)
- ()glkView:( *)view drawInRect:()rect
{
   // Calculate the aspect ratio for the scene and setup a 
   // perspective projection
      aspectRatio = 
   ()view. / ()view.;
   
   // Set the projection to match the aspect ratio
   .. = 
   (
      (),// Standard field of view
      aspectRatio,// Don't make near plane too close
      ); // Far arbitrarily far enough to contain scene
   
   // Configure a light
   ... = 
   (,);// Directional light
      
   [. ];

   // Clear Frame Buffer (erase prevIoUs drawing)
   (|);
   
   [ ];
   [ ];      
}voidGLKViewCGRectconstGLfloatGLfloatdrawableWidthGLfloatdrawableHeightselfbaseEffecttransform.projectionMatrixGLKMatrix4MakePerspectiveGLKMathdegreesToradians35.0f0.2f200.0fselfbaseEffectlight0positionGLKVector4Make0.6f1.0f0.4f0.0fselfbaseEffectpreparetoDrawglClearGL_COLOR_BUFFER_BITGL_DEPTH_BUFFER_BITselfdrawPhysicssphereObjectsselfdrawPhysicsBoxObjects

OpenGL ES is a technology for controlling GPUs. Parts of OpenGL ES execute on the GPU itself,and other parts execute on the cpu. Programs call a library of C functions provided by OpenGL to tell OpenGL what to do. The glClear() function,called in the tutorial's -glkView:drawInRect:, erases prevIoUs drawing and discards prevIoUsly calculated information about which 3D objects are in front of others.

PViewController's –drawPhysicssphereObjects and –drawPhysicsBoxObjects methods draw spheres and Boxes with positions and orientations calculated by the physics engine. Without going into a lot of detail,each of the methods calls OpenGL ES functions to specify where to find vertex data defining triangles. Then the triangles are drawn by calling code similar to the following:

      // Draw triangles using the first three vertices in the 
      // currently bound vertex buffer
      (,// Start with first vertex in currently bound buffer
         sphereNumVerts);glDrawArraysGL_TRIANGLES0

OpenGL ES can only draw points,lines segments,and triangles. Complex shapes are composed of many triangles. The shapes in this tutorial are defined in sphere.h and cube.h. The shapes were initially drawn in a free open source 3D modeling application called Blender. Modeling is the term used by artists who create 3D shapes. The created models are exported from Blender in .obj file format and then converted into C header files suitable for direct use with OpenGL. Conversion is performed by an open source Perl language script.

It takes a little more work to setup GLKit. PViewController's -viewDidLoad method shows representative boilerplate code. This article glosses over methods like PViewController's –addRandomPhysicsObject. The code for adding physics objects is straightforward and particular to this tutorial. You'll most likely add different objects with different logic in your physics simulation projects.

Conclusion

The simulation provides remarkably complex and varied interaction between objects. The downloadable code is available in two variants. The Physics zip file (3dphyslibios_physics.zip) contains a Physics folder with an Xcode project. If you have built the Bullet demo applications for Mac OS X,you can copy the Physics folder into your bullet-2.80-rev2531 folder,double-click the Physics.xcodeproj file and press Run. A separate larger PhysicsPlusBullet zip file (3dphyslibios_physicsplusbullet.zip) contains the tutorial example and the needed Bullet source code combined. As always with open source,it's better to get the source code directly from the maintainers instead of grabbing a snapshot preserved in a tutorial's .zip file. Nevertheless,if you're impatient,the PhysicsPlusBullet zip file will get you up and running quickly.

This article provided a whirlwind tour of two large and powerful frameworks,Bullet and GLKit. It's not difficult to combine the two technologies in iOS applications. Like many open source libraries,Bullet is relatively easy to compile for iOS in spite of quirks related to the tools and coding style used by the library's authors. GLKit enables development of interesting and visually complex 3D applications with very little code. The tutorial implements all of its drawing in about 200 lines of code including comments and blank lines.

If you are interested in a more thorough introduction to 3D graphics concepts and GLKit,my new book, Learning OpenGL ES for iOS: A Hands-on Guide to Modern 3D Graphics Programming,is complete and available Now as a Rough Cut electronic edition. Look for the title at your favorite bookstore in the fall. Free sample codefrom the book is available.

An AI to estimate your heart rate using your face

An AI to estimate your heart rate using your face

A wearable heart rate monitor is one thing, but what about a system that’s able to estimate a person’s heartbeat from footage of their face alone? That’s what researchers at the Chinese Academy of Sciences set out to design in a preprint paper published on Arxiv.org. In it, they describe RhythmNet, an end-to-end trainable heart rate estimator that taps AI and photoplethysmography (PPG) — an optical technique that detects blood volume changes in skin tissue — to address challenges in head movement and variations in lighting.

As the researchers explain, PPG-based HR estimation is made possible by the fact that skin light absorption varies periodically with the blood volume pulse (BVP). Chromosomes like hemoglobin in the microvasculars of the dermis and subcutis layers take in a disproportionate amount of light, such that tiny color changes occur as blood pumps through underlying veins and arteries. They’re invisible to the human eye, but they can be easily captured by RGB sensors like those embedded in wearables.

To train a RhythmNet, the team created a large-scale multi-modal corpus — VIPL-HR1, which is available in open source — containing 2,378 visible light videos and 752 near-infrared videos of 107 subjects. Each clip was captured with a combination of webcams and infrared sensors as a well as smartphones, and contains variations in head movements, head poses (with annotated yaw, pitch, and roll angles), illumination, and device usage.

RhythmNet consists of several components, including a face detector that localizes upwards of 81 facial landmarks given a video of a person’s face. A separate component performs alignment and skin segmentation to remove eye regions and other non-face areas, and then generates spatial-temporal maps from video frames 0.5 seconds apart to represent heart rate signals. The HUC99 maps are fed into a machine learning model trained to predict heart rate from the spatial-temporal maps, after which the estimated beats per minute is computed as the average of all the estimated rates from individual clips.

The researchers evaluated their system on two widely-used databases in MAHNOB-HCI and MMSE-HR, as well as their own. They report that for most of the samples (71%) tested against VIPL-HR1, RhythmNet achieved a heart rate estimation error lower than 5 beats per minute and that it correlated well with the ground truth between 47 beats per minute and 147 beats per minute. Moreover, they say that error rates on MAHNOB-HCI and MMSE-HR didn’t exceed 8.28 beats per minute, outperforming the previous work to which the model was compared.

Androd 应用开发你遇到过这种错误吗?Your project contains error (s),please fix them before running your applica...

Androd 应用开发你遇到过这种错误吗?Your project contains error (s),please fix them before running your applica...

程序没有错误,但是就是运行不起来,

总是提示: “Your project contains error(s),please fix them before running your application

 

    有几种原因:

         1. 在不同的电脑下开发,而且文件存放路径不同,错误的主要原因是  “.classpath”  文件的载三方类库包路径错误。

         2. 也可能是你的 SDK 版本不存在或者没有。

         3. 编译的 class、apk 文件有问题:执行清除一下就可以了。Project→Clean→Clena Projects Selected Below 选择你出错的项目就可以了。


总结:开发 Android 应用程序是注意一下细节应该就不会出现这些问题。


angular -- 在 coreModule 中导入 sharedModule 没有循环依赖 app.module.tscore.module.tsshared.module.tsshared.module.ts ===> log.service.ts

angular -- 在 coreModule 中导入 sharedModule 没有循环依赖 app.module.tscore.module.tsshared.module.tsshared.module.ts ===> log.service.ts

如何解决angular -- 在 coreModule 中导入 sharedModule 没有循环依赖 app.module.tscore.module.tsshared.module.tsshared.module.ts ===> log.service.ts

我需要访问 coreModule 内的 sharedModule=>random.component... 目前,我遇到循环依赖错误。我应该继续尝试这样做还是本质上是错误的?

这是我当前的应用程序结构

app.module.ts

-> 导入:core.module.ts

core.module.ts

-> 导入:shared.module.ts(我认为这会导致循环依赖

shared.module.ts

  • 它由任何需要的功能模块导入

  • app.module.ts 也导入它

  • core 正在导入它,因为它保存了我的 log.service.ts

  • 可以从shared

    预测核心中还有其他需要的东西

shared.module.ts ===> log.service.ts

  • 这是共享的,因为它不是单例
  • 尝试删除核心中的共享导入并简单地在核心组件中导入 log.service 但现在核心不会

如果 core 导入 shared 是错误的。 core 如何访问共享

中的内容

解决方法

由于 shared 模块导入 main 模块但仅用于其中一个服务,因此将该服务设为单独的模块。这样做将允许您在任何地方导入该特定模块(服务)。

,

您不应该在 coreModule 中导入 sharedModule,这与整个目的相矛盾。 CoreModule 是您加载在整个应用程序中使用的组件/模块/提供者等的地方,这应该只导入到 appModule 中。 SharedModule 用于您的 featureModule。

同时在您的应用程序中搜索 (Ctrl+F) CoreModule,也许您也在其他地方导入它。

我们今天的关于Your Computer’s Trusted Platform Module Has Malfun的分享就到这里,谢谢您的阅读,如果想了解更多关于Adding Open Source 3D Physics to Your iOS Applications (3)Using Bullet in Your iOS Application、An AI to estimate your heart rate using your face、Androd 应用开发你遇到过这种错误吗?Your project contains error (s),please fix them before running your applica...、angular -- 在 coreModule 中导入 sharedModule 没有循环依赖 app.module.tscore.module.tsshared.module.tsshared.module.ts ===> log.service.ts的相关信息,可以在本站进行搜索。

本文标签: