IPB: equivalent for $this->registry->class_forums->forum_by_id - ipb

Hi,
I would like to know whats the right code that does the same as
$this->registry->class_forums->forum_by_id[ $forumid ];
but for posts?
I thought it was something like:
$this->registry->classPost->post_by_topic_id[ $topic_id ];
but it wont work. Could you please give me a hint?
Thank you.

Related

wxMaxima: how to get decimal number results?

This should be easy but I am struggling on that.
I googled already but nothing seems to work.
(I am using wxMaxima 15.08.1 on Windows)
My example code looks like this:
kill (all);
numer:true;
sigma_z: 1000.0$ /*[N/mm²]*/
sigma_b_zul : simga_z*0.7;
sigma_b_zul : simga_z*0.7, numer;
sigma_b_zul : simga_z*0.7, numer:true;
float(sigma_b_zul);
the output is every time:
0.7 simga_z
the next cell looks like:
d_d: 1000$ /*dfd*/
sigma_g_f_d: d_d * 0.7;
the result is:
7.0E+2
I am completely clueless why maxima behaves like this. Can anyone help?
The variable you define is
sigma_z: 1000.0$ /*[N/mm²]*/
but then you call
simga_z*0.7;
Please, notice the difference between sigma_z and simga_z.

How to find nth derivative of a function using leibnitz rule in wxMaxima?

I know the pseudo code.
It goes something like this:
if f(x): g(x)*h(x) then u:g(x) and v:h(x)
for i:0 thru n do block
( binomial(n,i)*diff(u,x,i)*diff(v,x,n-i), i:i+1);
I'm not able to actually execute the code. I get some thing I don't need. Please
help me.
Thankyou
kill(all)$
y:x^4*log(x);
u:log(x);
v:x^4;
n:4;
lsum(binomial(n,i)*diff(u,x,n-i)*diff(v,x,i),i,[0,1,2,3,4]);

MultiSelectionHelper not working as expected

I'm trying to perform an operation on multiple lines on my form. I have tried to use multiselectionhelper, and it seems as it would work, but for some reason, it's not. My operation is still looking at the last line I have selected instead of all the selected lines.
myTable myTableTmp;
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
selectionHelper.parmDatasource(myTable_ds);
myTableTmp = selectionHelper.getFirst();
while (myTableTmp )
{
//perform operation
myTableTmp = selectionHelper.getNext();
}
This looks like it would work, but still not working as expected.
Any help would be greatly appreciated. Thanks!
I have finally figured it out. I'm not sure how I missed it. The answer was really simple. I had this:
myTable myTableTmp;
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
selectionHelper.parmDatasource(myTable_ds);
myTableTmp = selectionHelper.getFirst();
while (myTableTmp )
{
localTable.methodCall();
myTableTmp = selectionHelper.getNext();
}
I should have used myTableTmp.methodCall() instead of the localtable.methodCall()
Thanks for anyone that tried to help!

Ogre::SceneManager::setAmbientLight doese not work

i am building the wiki Advanced Ogre Framework,
then i find that the Ogre::SceneManager::setAmbientLight() does not work at all.
i find nothing useful after google, anyone can give me some idea?
the code is like this:
m_pSceneMgr = OgreFramework::getSingletonPtr()->m_pRoot->createSceneManager(ST_GENERIC, "GameSceneMgr");
m_pSceneMgr->setAmbientLight(Ogre::ColourValue(0.7f, 0.7f, 0.7f));
finally i figure it out bymyslef,
in the framework, i call setAmbientLight() before these code:
DotSceneLoader* pDotSceneLoader = new DotSceneLoader();
pDotSceneLoader->parseDotScene("CubeScene.xml", "General", m_pSceneMgr, m_pSceneMgr->getRootSceneNode());
delete pDotSceneLoader;
there is a node in the CubeScene.xml set the ambient color again, which is (0,0,0), so my call can not work then.

split the string to get specific value on ruby on rails?

I want to get two separate value from
/en/faq
the two separate value will be
lang =en
rem =faq
I have used to split which was relatively much easier. Nonetheless, this is my approach which needs tweaking around, hopefully from your help I will be able to accomplish it.
string = "/en/faq"
lang = string.split("/").first
rem = string.split("/en/")
puts "/#{lang}/#{rem[1]}"
The desired output should be "/en/faq/" but the output is
"//faq"
i know i have got '.first' which is why I am getting a null value but could anyone help on getting the right results please?
thanks in advance.
string = "/en/faq"
lang = string.split("/")
rem = string.split("/#{lang[1]}/")
puts "/#{lang[1]}/#{rem[1]}"
this does the trick and thanks to Sebi for his prompt answer!

Resources