core-api

Why doesn't each_slice work?

早过忘川 提交于 2019-12-23 03:17:13
问题 I am trying to use the Enumerable#each_slice. It doesn't work on my computer, stating that method is not found. I am running ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] API: http://ruby-doc.org/core/classes/Enumerable.html#M003142 Example: (1..10).each_slice(3) {|a| p a} # I get NoMethodError: undefined method `each_slice' for 1..10:Range What am I doing wrong? 回答1: In ruby 1.8.6 you have to require 'enumerator' (which is part of stdlib and has been merged into core in 1.8.7+

Custom Authorization Filter in .NET Core API

落爺英雄遲暮 提交于 2019-12-11 10:06:52
问题 I want to authorize users before accessing any data using my core api, so I tried is using JWT authentication. I have successfully generated token while signing in user using api and saved that token on client side in session, now whenever user wants to access any data using api, I'll send that token in header to api and I want to validate that JWT token using custom authorization filter. I have created custom authorization filter and applied it on my GetMenu api and I'm able to validate that

Where do I report a Windows core library problem?

微笑、不失礼 提交于 2019-12-10 14:46:13
问题 How do I let Microsoft know about a problem I've found in one of their core library routines? Do they have a central repository to report these things? I am not a member of Microsoft Development Network (MSDN). Or should I even bother? 回答1: If it's a documentation bug (or if the documentation should call it out), you can get good results with the Feedback links in MSDN library. You can report bugs in Microsoft developer tools (among other things) by signing up at connect.microsoft.com. If you

Is it possible to relate the same audio device in different APIs?

岁酱吖の 提交于 2019-12-01 10:59:56
I'm using the winmm api to deal with audio. I'm using waveInGetDeviceCaps and waveInMessage to uniquely identify an "audio line". Everything works fine, except that in Vista, the name of the device is capped in 32 chars by the WaveInCaps struct. To work around that, I'm envisioning using the core api when OS version is >= Vista. I'm using the IMMDeviceEnumerator.GetDevice and IMMDeviceEnumerator.EnumAudioEndpoints to gather audio line information, but I'm not sure how to tell that one device under core api relates to one entry under the waveXx api. I guess I could compare the device path of

Is it possible to relate the same audio device in different APIs?

跟風遠走 提交于 2019-12-01 08:20:31
问题 I'm using the winmm api to deal with audio. I'm using waveInGetDeviceCaps and waveInMessage to uniquely identify an "audio line". Everything works fine, except that in Vista, the name of the device is capped in 32 chars by the WaveInCaps struct. To work around that, I'm envisioning using the core api when OS version is >= Vista. I'm using the IMMDeviceEnumerator.GetDevice and IMMDeviceEnumerator.EnumAudioEndpoints to gather audio line information, but I'm not sure how to tell that one device