How do I show a popup in Blackberry 10? I want to show popup when any contact is added /deleted/updated. I took one method like this---
void ContactEditor::showToast(QString text) {
bb::system::SystemToast toast;
toast.setBody(text);
toast.setPosition(bb::system::SystemUiPosition::MiddleCenter);
toast.exec();
}
and called like this---
showToast("contact added...");
included file for System Toast also.
but this is giving me error----
make[2]: *** [o-g/addressbook] Error 1
make[1]: *** [debug] Error 2
make: *** [Simulator-Debug] Error 2
can somebody tell me whats the problem ?
Add LIBS += -lbbsystem to your application pro file. and include
#include <bb/system/SystemToast>
SystemToast *toast = new SystemToast(this);
toast->setBody("Your Toast");
toast->setPosition(SystemUiPosition::MiddleCenter);
toast->show();
Related
I'm trying to use google test to test a C function. A simple test using ASSERT_NO_FATAL_FAILURE(); and also EXPECT_THAT();. But when I try to use matchers (like not null for example) the IDE says: Use of undeclared identifier 'NotNull'.
#include "gtest/gtest.h"
extern "C" {
#include "first_tdd.h"
}
TEST(sum, sum_has_return)
{
EXPECT_THAT(sum(), NotNull());
}
cmake_minimum_required(VERSION 3.19)
project(untitled C)
set(CMAKE_C_STANDARD 99)
add_executable(main.c sum.c)
# 'Google_test' is the subproject name
project(Google_tests)
# 'lib' is the folder with Google Test sources
add_subdirectory(googletest)
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}, ${gmock_SOURCE_DIR}/include ${gmock_SOURCE_DIR})
# 'Google_Tests_run' is the target name
# 'test1.cpp tests2.cpp' are source files with tests
set(Sources
sum.c
)
add_executable(Google_Tests_run sum_tests.cpp sum.c)
target_link_libraries(Google_Tests_run gtest gtest_main)
Message when I try to run the test.
error: use of undeclared identifier 'NotNull'
EXPECT_THAT(sum(), NotNull());
^
1 error generated.
make[3]: *** [CMakeFiles/Google_Tests_run.dir/sum_tests.cpp.o] Error 1
make[2]: *** [CMakeFiles/Google_Tests_run.dir/all] Error 2
make[1]: *** [CMakeFiles/Google_Tests_run.dir/rule] Error 2
make: *** [Google_Tests_run] Error 2
Folder Structure
Does any one know if I should include something else?
Thank you.
NotNull is declared in the namespace ::testing. Possible fixes
TEST(sum, sum_has_return)
{
EXPECT_THAT(sum(), ::testing::NotNull());
}
or
TEST(sum, sum_has_return)
{
using ::testing::NotNull;
EXPECT_THAT(sum(), NotNull());
}
I am trying to read a GDML file with G4GDMLParser:
...
G4GDMLParser parser;
parser.Read(G4Str_Filename, fValidate);
But it gives an error:
...
G4GDML: Reading materials...
G4GDML: Reading solids...
Evaluator : syntax error
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : InvalidExpression
issued by : G4GDMLEvaluator::Evaluate()
Error in expression: 40.0
*** Fatal Exception *** core dump ***
**** Track information is not available at this moment
**** Step information is not available at this moment
-------- EEEE -------- G4Exception-END --------- EEEE -------
*** G4Exception: Aborting execution ***
Signal: SIGABRT (Aborted)
I tried putting GDML file next to the executable but it didnt help.
I found it problem is My locale TR uses " , "not " . " for floats just set your locale somewhere in your code;
std::setlocale(LC_ALL, "en_US.UTF-8");
std::setlocale(LC_NUMERIC, "en_US.UTF-8");
I am trying to execute c++ function using boost library in R. I've also installed boost header file package (BH). When I try to execute the code it give me the following error:
src <- '
#include <Rcpp.h>
#include <boost/math/special_functions/binomial.hpp>
for (unsigned long i = 0; i < 5; ++i) {
boost::math::binomial_coefficient<double>(25, i);
}'
sillyExp <- cfunction(signature(), src, convention = ".C")
Where I am going wrong?
Edit: Following is the error
Error in compileCode(f, code, language, verbose) :
Compilation ERROR, function(s)/method(s) not created! file68b0697546bd.cpp:11:54: fatal error: boost/math/special_functions/binomial.hpp: No such file or directory
#include <boost/math/special_functions/binomial.hpp>
^
compilation terminated.
make: *** [C:/PROGRA~1/R/R-34~1.3/etc/x64/Makeconf:215: file68b0697546bd.o] Error 1
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-34~1.3/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-34~1.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file68b0697546bd.dll" WIN=64 TCLBIN=64 OBJECTS="file68b0697546bd.o"' had status 2
If you really want to execute some C++ code, then you can use Rcpp::evalCpp:
Rcpp::evalCpp("boost::math::binomial_coefficient<double>(25, 3)",
depends="BH",
include="#include <boost/math/special_functions/binomial.hpp>")
#> [1] 2300
I have a rather large mesh, (which I load with osgDB). It also has several sub-meshes.
I am trying to set the emission lighting. However I can see (suspect) that only the 1st sub-mesh is lit up. How is it possible to light up all the sub-meshes.
I am not using lighting to lit up the scene.
What is the recommended approach?
int main()
{
osg::Node * cytBuilding = osgDB::readNodeFile( OBJ_FILE );
osg::Group * root = new osg::Group();
osg::PositionAttitudeTransform * scenePAT = new osg::PositionAttitudeTransform();
root->addChild(scenePAT);
scenePAT->addChild( cytBuilding );
//material
osg::Material* material = new osg::Material();
material->setAmbient(osg::Material::FRONT, osg::Vec4(1.0,1.0f,1.0f,1.0f));
material->setDiffuse(osg::Material::FRONT, osg::Vec4(1.0,1.0f,1.0f,1.0f));
material->setSpecular(osg::Material::FRONT, osg::Vec4(0.0,0.0f,0.0f,1.0f));
material->setEmission(osg::Material::FRONT, osg::Vec4(1.0,1.0f,1.0f,1.0f));
osg::StateSet* stateset = new osg::StateSet();
stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
root->setStateSet(stateset);
// viewer
osgViewer::Viewer viewer;
viewer.setSceneData( root );
viewer.realize();
return viewer.run();
As I read the mesh (osgDB::readNodeFile()), it display following error messages
*** line not handled *** :map_bump
*** line not handled *** :bump
*** line not handled *** :map_opacity
*** line not handled *** :map_d
*** line not handled *** :refl
*** line not handled *** :map_kS
*** line not handled *** :map_Ns
Resulting display was:
Same mesh when I display with meshlab, I see
This largely depends on how the StateSets within the model are organized.
Could you try to enforce lighting on your root node?
stateset->setMode( GL_LIGHTING, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );
You could also try to implement a small visitor to dump all Materials and StateSets within the model to see how they are assigned, maybe its overridden per node with a OVERRIDE|PROTECTED flag.
Just for testing, did you try to apply your Material to all Geodes or Geometries within the model?
Being relatively new to Splunk (ver 6) and even newer to Reg-ex, I have log files that I and trying to index that have a header than I need to ignore. There are 6 header lines. The first 4 all begin with * and the last two are blank lines. I'm assuming they are just carriage returns. I'm looking for help with the regular expression that will ignore these lines in the transforms.conf file when adding the data. Below is an example from the log file I want to add:
*******************************
*** This is a Header ***
*** 07:32:06 Tue Jan 07 ***
*******************************
Jan-07 07:32:06 SERVERNAME:somedatainfo
Jan-07 07:32:06 SERVERNAME:moredatainfo
On the forwarder or indexer you can set the sourcetype for the file that is being monitored.
# in inputs.conf
[monitor:///path/to/your/file]
sourcetype=new_sourcetype
On the indexer, you can get rid of the first lines like this:
# in props.conf
[new_sourcetype]
TRANSFORMS-test=ignore_header
#in transforms.conf
[ignore_header]
REGEX=^\*\*\*+
DEST_KEY=queue
FORMAT=nullQueue