CMSIS API for "taskENTER_CRITICAL()" in FreeRTOS - freertos

As I know, in FreeRTOS, these are two methods taskENTER_CRITICAL() and taskEXIT_CRITICAL() which are used to enter and exit the critical section. Is there any wrapper for these two methods in the CMSIS API?
Just like the osKernelStart() is the CMSIS API to wrap the vTaskStartScheduler() in the FreeRTOS.

At least in v2 there is
int32_t osKernelLock(void)
I haven't found something similar in v1.
CMSIS-RTOS2

Related

Where is 's' object cached when using AppMeasurement in DTM

Omniture's basic page tracking function, s.t(), was not crafted for AJAX implementation. Unlike the onclick s.tl() function which has some gating instructions with s.linkTrackVars and s.linkTrackEvents, the s.t() function just perpetuates every cached property through to the next call and beyond.
I used to be able to use a ClearVars function to empty out all of the s object's attributes, but now that I am using AppMeasurement and letting DTM manage my implementation with the most updated version of that library—which I want to keep doing—I can't call the s object. I get the same "ReferenceError: s is not defined" that another person asked about here!.
I tried following Crayon Violent's instructions within that post, but I can't seem to find where DTM is stashing the cached values in between Adobe calls. This code:
window.s = new AppMeasurement();
lets me change/clear the attributes of s, but it's not the s I'm looking for. When I call the next AJAX s.t() function, all of the cached values are still there.
In my experience working with DTM and AA, there has been no end to bugs and caveats and workarounds with DTM's "native integration" of AA. This is why I have more or less decided that the best thing I can do is to either manage the lib myself or else treat AA as a 3rd party script (100% implement it through rules, just ignore that it's available as a tool).
As mentioned in my answer you linked, that line of code only works to expose the AA object in the window namespace if you are managing the library yourself. When you configure DTM to manage the library, it will instantiate AA object itself, and it will be buried within its own code (Honestly, I don't know why DTM did this, considering AA puts a number of other variables in the global namespace that DTM does nothing about).
AFAIK there is no documented way to reference it, but one thing I have found that seems to work for me - which as a disclaimer to cover my own arse I do NOT officially endorse: use at your own risk - is to use the following to get a reference of it:
var s = _satellite.getToolsByType('sc')[0].getS();
This uses getToolsByType method to get an array of the SiteCatalyst (Adobe Analytics) objects setup as tools in DTM. It does this by looping through _satellite.tools and comparing _satellite.tools[n].settings.engine to what you passed to getToolsByType.
Then I use [0] to get the first one in the array, under the assumption that there's only one configured (most people only do one). Then the getS() object pulls together the s object based on the settings in DTM. So from there, you can do things with it, including making use of s.clearVars()

Resumable uploading in latest version of Google API PHP SDK

The example code for a resumable upload (usually used for large files) in the SDK is out of date and does not work (https://github.com/google/google-api-php-client/blob/master/examples/fileupload.php).
Specifically, the $request object that is passed when getting a new Google_Http_MediaFileUpload is of the wrong class type. Google_Http_MediaFileUpload wants an Google_HTTP_Request object, but in the example code, the thing being passed is actually (in recent releases of the SDK) a Google_Service_Drive_DriveFile.
After poking around a bit, I cannot see the obvious way to do this with the current SDK, with the same economy as the example code. (I can see the long-winded way, by creating Google_HTTP_Request objects myself according to the generic API documentation).
Does anyone have an example of working code for this? (I Googled but did not find any. The changes in the SDK appear to be in the last few weeks).
I tested the latest version from Git and the example is working fine. The only "problem" is that it took a little while for the script to finish processing, even after I saw the file on Google Drive.
The $request variable is actually of the expected type Google_HTTP_Request.
$request = $service->files->insert($file);
// In the above line, $service is a `Google_Service_Drive` and
// $service->files is `Google_Service_Drive_Files_Resource`'
// which extends `Google_Service_Resource`.
// That insert() method returns the result of a call
// to Google_Service_Resource::call(), which
// returns a Google_HTTP_Request

How to obtain all OIDs from all MIBs

I would like obtain a list of all OIDs in the MIBs that are loaded on a manager and display it to users so that they can choose which MIB object to perform the GET/SET request. I would also like to obtain the syntax and max-access of the object. I'm programming using C++. I want to parse the MIBs to obtain the OIDs, not use snmpwalk. I am trying to use the Net-SNMP MIB_API. I've looked at the manual page but am not clear of how to use the functions to achieve what I want to do.
I see that read_all_mibs() is already called when we call init_mib(). That means I don't need to call read_all_mibs() again, right? Could anyone please guide on what is the next step after init_mib() that I should do.
Any help would be much appreciated. Thanks.
You should look at the apps/snmptranslate.c file for an example of how to walk the loaded mib tree to get information like the syntax and max-access details.
And, no, if you call init_snmp() or init_mib() you don't need to call read_all_mibs()

How do I construct the cake when using Scalaxb to connect to a SOAP service?

I've read the documentation, but what I need to know is:
I'm not using a fictitious stock quote service (with an imaginary wsdl file). I'm using a different service with a different name.
Where, among the thousands and thousands of lines of code that have been generated, will I find the Scala trait(s) that I need to put together that correspond to this line in the documentation's example:
val service = (new stockquote.StockQuoteSoap12Bindings with scalaxb.SoapClients with scalaxb.DispatchHttpClients {}).service
Now, you might be thinking "Why not just search for Soap12Bindings in the generated code"? Good idea - but that turns up 0 results.
The example in the documentation is outdated, or too specific. (The documentation is also internally inconsistent and inconsistent with the actual filenames output with scalaxb.)
First, search for SoapBindings instead of Soap12Bindings to find the service-specific trait (the first trait).
Then, instead of scalaxb.SoapClients, use scalaxb.Soap11Clients.

How do you make a combo of two emotes in lua in World of Warcraft work?

How do you make a combo of two emotes in lua in World of Warcraft work?
function Button2_OnClick()
PlaySoundFile("Interface\\Addons\\Fart\\common_fart[1].wav");
DoEmote("moon");
DoEmote("sit");
DoEmote("dance");
DoEmote("beckon");
end
I am using Wow Addon Studio to make a fart application on Wow.
I used this function, and only the sit motion showed, and beckon and moon only showed on the chat window. The dance emote didn't show up anywhere.
Blizzard has explicitly prohibited anything that can be used to make lua wait or pause because it is an essential ingredient to making a gold mining or grinding bot.
There isn't a native (i.e. lua only) way to have lua wait without using all the CPU. Outside of the WOW client, you'd use win.sleep or some other 3rd party API call that calls into the host application or operating systems threading functions.
It may be possible to simulate a wait by having code execute on a frequent event (such as text arriving at the chat window) and then in the event handler checking to see if enough time has passed to permit executing the next command in the sequence. This probably wouldn't be a very accurate timer and it would be rather complex as you'd have to create a data structure to hold the sequence of commands, the timings between each, the current command, etc. and so on.
This may be an intentional limitation of the API to prevent in game automation (botting).
What has worked for me is to have a global variable that is incremented through the loop. Such as
Integer count = 0;
function Button2_OnClick()
i++
switch
case(1)
PlaySoundFile("Interface\\Addons\\Fart\\common_fart[1].wav");
case(2)
DoEmote("moon");
case(3)
DoEmote("sit");
case(4)
DoEmote("dance");
case(5)
DoEmote("beckon");
default
i=0;
end
end
What you would have to do then is to click the button multiple times, but you would get the effect you're going for.
I would suggest you wait some time before doing the next emote. As far as I know, the server disconnects you if you spam too much. This might just trigger it sometimes.
Besides that, I guess maybe the client has a way of preventing it? In either case, I would suggest you add some sort of fraction-of-a-second delay between the emotes.
Cheers,
Amit Ron
Could it be that the last two can't be done while sitting?
infact, integer i = 0, because defining integer 'count' and then using i is incorrect. :)

Resources