Getting ALSA card information - c

Once I have the card number (for example hw:0) how can I get information and descriptions from the ALSA library? I would like ot access the data similar to what I can find in /proc/asound/cards, for example:
0 [CinemaTM ]: USB-Audio - Microsoft® LifeCam Cinema(TM)
Microsoft Microsoft® LifeCam Cinema(TM) at usb-spear-ehci.0-1.1, high speed
As I have multiple such "cards" in my system, info like "CinemaTM", "USB-Audio" and "usb-ehci.0-1.1" help me to recognize what I need to open for capture.
In a separate question I found out how to iterate over all the cards and capture devices in the system, now I'd like to retrieve information about those - but my first impression with the ALSA API is that it's quite big and cumbersome for a beginner to understand how do to things.

Open the card's control device (which is also named hw:0, but doesn't have subdevices), and call snd_ctl_card_info().
snd_ctl_card_info_get_id(): CinemaTM
snd_ctl_card_info_get_driver(): USB-Audio
snd_ctl_card_info_get_name(): Microsoft® LifeCam Cinema(TM)
snd_ctl_card_info_get_longname(): Microsoft Microsoft® ... at usb-...

Related

How to generate text from wikidata json

I am looking for pointers for libraries or methods that would be able to generate full text from the structured information returned by Wikidata - if possible in multiple languages.
To be clearer: from data like the one provided here (this is the JSON version) I would like to be able to generate text similar to the intro paragraph of the wikipedia page for the same item:
Orvieto Cathedral (Italian: Duomo di Orvieto; Cattedrale di Santa Maria Assunta) is a large 14th-century Roman Catholic cathedral dedicated to the Assumption of the Virgin Mary and situated in the town of Orvieto in Umbria, central Italy.
The reason is that the text is provided by Wikipedia for all those cases where a page exists, but I would like to have something also for the Wikidata items without a wikipedia page.
My problem #1 here is: I don't know what something like this is called, so I have no idea what to google for. Any pointers to start from are appreciated, including services or APIs.
This problem falls under the Data to text generation task. I do not know of any services that are currently offering solution. You can look at WEBNLG challenge which has the same objective and similar data. AFAIK mostly template based methods are used to automatically insert data from wikidata into wikipedia as text.

Can I get low level administrative areas from Here Maps?

I am trying to get and display low level admnisitrative areas such as neighbourhoods and disctrictcs via their polygon geometry. I am new to Here Map and GIS. I need this data just for Turkey.
I have read Here documentation, however I could not find a proper solution.
Thanks,,
It's possible to do with Platform Data Extension API. You can find description, examples, and details by link https://developer.here.com/documentation/platform-data/topics/what-is.html

Updating Adobe Flash Pro CS6 to the latest Flash Player 23?

I read this post where someone asked
How can I change flash player version in flash cs6? and there was an answer instructing him how to add Flash Player 15, so I figured I could do something similar with Flash Player 23, but it doesn't seem to be working properly. Does Adobe not provide a FlashPlayer23_0.xml file themselves? There are lots of lines in there, and copying one of the older xml files and editing a couple of them as the guide suggests doesn't seem right. In one of the lines I'm supposed to edit, I'm not sure what to put in for the version of FlashPlayer23.0.
<player id="FlashPlayer23.0" version="XX" asversion="3">
After doing all that, in Flash Pro I now see a "Flash Player 23" in the Target dropdown of the Publish section, and I have that selected, but when I actually publish, I get an error when I try to use one of the newer Flash features.
I'm actually just trying to use the new removeAt() Array method where you can remove one element of an array by its index. It says you need at least Flash Player 19 for it to work. Here is my test code:
var a:Array = [0,1,2];
a.removeAt(1);
trace(a);
If I try that out with Flash Player 11 as the publish setting, I get the following expected error:
TypeError: Error #1006: removeAt is not a function.
If I set it to publish to Flash Player 23, I get this error:
ReferenceError: Error #1069: Property http://adobe.com/AS3/2006/builtin::removeAt not found on Array and there is no default value.
Does anyone know why this is?
(1)
In one of the lines I'm supposed to edit, I'm not sure what to put in
for the version of FlashPlayer 23.0.
Always look for something called "release notes" for your version and it will tell you the number. The FlashPlayer 23.0 release notes (see Authoring Guidelines section) say :
To use the new Flash Player, you will need to target SWF version 34 by
passing "-swf-version=34"...
Set that as : <player id="FlashPlayer23.0" version="34" asversion="3">
(2)
I get an error when I try to use one of the newer Flash features
Did you actually replace the existing older playerglobal.swc file with the newest downloaded one (for FP 23.0 features)? The compiler needs the latest Flash Player file placed in the installation folders.
Remember installing the plugin from Adobe website is just for benefit of browsers, you still need to manually setup the installed Flash CC or CS software with the latest SWC file so that the compiler understands these new commands/features.

How can I access the iTunes DB in VB6?

I am trying to rewrite a closed-source program called Pod Player (written in VB6). To do anything, I need to be able to access the iPod's DB and load it into a series of ListBox controls. Things I need to access is: any playlists and what they contain, the iPod's name, track numbers, song titles, genres, artists, albums, path to the songs, their rating, UIN, file size, length and preferably album artwork. I also need to be able to change rating information if needed. So how can I interact (read/write) with the iPod's DB in VB6?
Or is it possible to write a DLL or OCX in another language that can do this and be called/used by the VB6 program?
I should also mention that Pod Player uses some or most of SharePod's code (before SP went .NET).
I found a database parser on Planet Source Code and tried out the demo form included as well as an implementation of it in my Pod Player rewrite, but (according to the demo form) it only reads 76% of the database before dropping out due to a playlist-related problem. I tested it on an iNano 4 and an iShuffle 4 and both are completely compatible with Pod Player. How can I get it (parser is in iPod.bas) to work correctly?
Have a look at this page: http://homepage.ntlworld.com/simon.mason20/ipod_tunes_spec.htm
It contains details of the iTunes database format

Google Waves - basic structure

Is a wave limited to the sharing of textual information (HTML), or am I correct in assuming that a wave can contain arbitrary data (represented in XML), so long as it also contains the javascript necessary to render it in a meaningful way?
I ask because the collaborative document preparation demonstrated in the Google I/O video looks very powerful, but there are many other types of documents than simple rtf text. In my case I would be looking interactively to develop gantt charts.
There is a lot that can be done inside each Wave. They have not yet made all features available, but here is a link to some samples: http://wave-samples-gallery.appspot.com/ which includes my Slashdot Gadget:http://wave-samples-gallery.appspot.com/about_app?app_id=18006
The Slashdot Gadget actually takes the RSS feed for Slashdot and displays the latest headlines.
Here is the XML: http://www.m1cr0sux0r.com/slashdot.xml
alt text http://www.m1cr0sux0r.com/xml.jpg
I got access to Google Wave a few days ago, and here's what the raw data for their Sokoban game (which supports two players playing simultaneously on the same board) looks like, for example:
<blip>
<p _t="title">
</p>
<p>
<w:gadget author="blixt#wavesandbox.com" prefs="" state="" title="" url="http://sokoban-server.appspot.com/com.example.simplegadget.client.SokobanGadget.gadget.xml">
<w:pref name="playerAllocation" value="1 1,blixt">
</w:pref>
<w:pref name="totalMoves" value="8">
</w:pref>
<w:pref name="playerPositions" value="1 4,2">
</w:pref>
<w:pref name="rockPositions" value="6 2,2 3,2 14,2 15,2 16,2 4,3">
</w:pref>
</w:gadget>
</p>
</blip>
So yes, you can store any data you like in a single blip, with the possibility to go backwards in "time" to see older versions of the data etc.
By the way, if you're interested in seeing some code for a robot that sits in a wave and interacts with users, I made one for a game I'm developing: Google Code Project for multifarce (and the game in question, it's not really public yet and as such not particularly functional.) The bot source is here: multifarce Wave robot source
Basically, all you need to get a bot running are the 14 last lines in that code. I love it! =)

Resources