外文分享

mediaplayer getduration returns 0 only in my server files

限于喜欢 提交于 2021-02-20 03:49:38
问题 i'm trying to get the audio file duration from my server using media player MediaPlayer mp = new MediaPlayer(); try { mp.reset(); mp.setDataSource("link here"); mp.prepare(); }catch (IOException e){ e.printStackTrace(); } mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mediaPlayer) { Log.e("time",mp.getDuration()+" .."); } }); when i put my server file link , it always return 0 but when i use another link from the web it gives me

Request header field x-access-token is not allowed by Access-Control-Allow-Headers

拈花ヽ惹草 提交于 2021-02-20 03:49:38
问题 I am stuck with this error. please help.. XMLHttpRequest cannot load. Request header field x-access-token is not allowed by Access-Control-Allow-Headers. 回答1: Your server should return that it accepts custom headers (like x-access-token). For example, if you are using nodejs with expressjs, try this: app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); // keep this if your api accepts cross-origin requests res.header("Access-Control-Allow-Headers", "Origin, X

Get type of binary on filesystem via C# running in 64 bit

和自甴很熟 提交于 2021-02-20 03:49:37
问题 I have a C# application, compiled in Visual Studio 2017 on the 'Any CPU' target, with the 'Prefer 32-bit' option disabled. In this application, I am trying to pinvoke kernel32!GetBinaryType(). When running with 'Prefer 32-bit' enabled, it works fine. When running in either 32 or 64-bit mode from a C++ executable, it works fine. I am not sure what I am doing wrong with the 64-bit C# application. This is my pinvoke signature: [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError =

Sending Variable from Component to Service in Angular 5

…衆ロ難τιáo~ 提交于 2021-02-20 03:49:37
问题 In my current Angular 5 project, I have been making successful API calls from my service (Code kept clean for brevity) myService.ts : @Injectable() export class my-service-service { constructor(private _http: HttpClient) { } myData1() { return this._http.get("API_URL") .map(result => result); } And accessing that information on my connected component by subscribing to the above service. myComponent.ts: import { myServiceService } from './my-service-service.service'; @Component({ ... })

I have mysql and apache superset setup on dockers and connected by a bridge network, what will theSQLAlchemy URI be?

为君一笑 提交于 2021-02-20 03:49:36
问题 I pulled the official superset image: git clone https://github.com/apache/incubator-superset.git then added the MYSQL Client to requirements.txt cd incubator-superset touch ./docker/requirements-local.txt echo "mysqlclient==1.4.6" >> ./docker/requirements-local.txt docker-compose build --force-rm docker-compose up -d After which I made the MYSQL Container docker run --detach --network="incubator-superset_default" --name=vedasupersetmysql --env="MYSQL_ROOT_PASSWORD=vedashri" --publish 6603

Convert decimal <--> binary with T-SQL

时间秒杀一切 提交于 2021-02-20 03:49:30
问题 How can I convert binary (base 2 stored as varchar) into decimal (base 10 stored as int or bigint) and the other way around, using T-SQL? Example results: 7 (dec) <--> 111 (bin) 136 (dec) <--> 10001000 (bin) 2123942362 (dec) <--> 1111110100110001100100111011010 (bin) 回答1: This answer can handle bigint Convert to bit(varchar containing 1 and 0) DECLARE @input BIGINT = 9223372036854775807 ;WITH N(N)AS ( SELECT top 63 POWER(cast(2 as bigint), ROW_NUMBER()over(ORDER BY (SELECT 1))-1) FROM (VALUES

Access Office 365 (sharepoint REST api) in Azure using Java

送分小仙女□ 提交于 2021-02-20 03:49:24
问题 I am new to Azure and sharepoint integration with Java. I am trying to integrate Java with Sharepoint. The Sharepoint-Office 365 is available in Azure ADFS. I need to write a Java program to authenticate and then access the files using the RESTful APIs provided by Sharepoint. Azure is using WS-Federation authentication process. I have been trying to look for the code that helps me to use the WS-F authentication and then access the files. I am not able to find any useful material. The basic

LOCF and NOCF methods for missing data: how to plot data?

戏子无情 提交于 2021-02-20 03:49:20
问题 I'm working on the following dataset and its missing data: # A tibble: 27 x 6 id sex d8 d10 d12 d14 <dbl> <chr> <dbl> <dbl> <dbl> <dbl> 1 1 F 21 20 21.5 23 2 2 F 21 21.5 24 25.5 3 3 NA NA 24 NA 26 4 4 F 23.5 24.5 25 26.5 5 5 F 21.5 23 22.5 23.5 6 6 F 20 21 21 22.5 7 7 F 21.5 22.5 23 25 8 8 F 23 23 23.5 24 9 9 F NA 21 NA 21.5 10 10 F 16.5 19 19 19.5 # ... with 17 more rows I would like to fill the missiningness data via the Last Observation Carried Forward method (LOCF) and the Next

I have mysql and apache superset setup on dockers and connected by a bridge network, what will theSQLAlchemy URI be?

浪子不回头ぞ 提交于 2021-02-20 03:49:18
问题 I pulled the official superset image: git clone https://github.com/apache/incubator-superset.git then added the MYSQL Client to requirements.txt cd incubator-superset touch ./docker/requirements-local.txt echo "mysqlclient==1.4.6" >> ./docker/requirements-local.txt docker-compose build --force-rm docker-compose up -d After which I made the MYSQL Container docker run --detach --network="incubator-superset_default" --name=vedasupersetmysql --env="MYSQL_ROOT_PASSWORD=vedashri" --publish 6603

Select distinct rows with max date in mysql 5.7 [duplicate]

浪子不回头ぞ 提交于 2021-02-20 03:49:17
问题 This question already has answers here : SQL select only rows with max value on a column [duplicate] (27 answers) Closed 7 months ago . Suppose having query SELECT c_id, id, max(date) as max_date FROM table GROUP BY c_id,updated And following result: c_id, id, max_date 1 5 2017-12-28 16:09:20 1 6 2019-12-28 16:09:20 2 7 2017-12-28 16:09:20 2 8 2019-12-28 16:09:20 I expect to get: c_id, id, max_date 1 6 2019-12-28 16:09:20 2 8 2019-12-28 16:09:20 How to achieve that in mysql 5.7? 回答1: Use a