AVQueuePlayer SeekToTime - avqueueplayer

[queuePlayer seekToTime:CMTimeMake(time,1)];
While I take seekToTime, the audio does replay, not seek to the time.
How to create CMTime para or you can tell me how to do all.

Please try below code:
UISlider *s = (UISlider*)sender;
[appDelegate.queuePlayer seekToTime:CMTimeMakeWithSeconds(s.value, queuePlayer.currentTime.timescale)];
first para is progress (0-1.0)
second para like this 'queuePlayer.currentTime.timescale'

Related

Semantic Mediawiki error: processing error text "#category " cannot be used as a property name in this wiki

Following this guide I've created a page with the following source code
{{#subobject:mysubobject
|url = https://www.instagram.com/p/CXeE2j-NT6s/
|title = Bullismo: proposta una legge in Francia per punirlo penalmente. Si rischia anche il carcere
|#category = bullismo|violenza|leggi|punizioni|+sep=;
}}
But I get the following error message:
processing error text "#category " cannot be used as a property name in this wiki.
Any hint on what's going on? I couldn't find any answer on google.
Try removing the space after #category. Also, note that a semicolon is used to separate several categories in your case:
{{#subobject:mysubobject
|url = https://www.instagram.com/p/CXeE2j-NT6s/
|title = Bullismo: proposta una legge in Francia per punirlo penalmente. Si rischia anche il carcere
|#category=bullismo;violenza;leggi;punizioni|+sep=;
}}
Within a subobject you are creating proporties, you cannot give them a separate category. And here you are saying give me a property #category within my subobject.
Some classes/properties are protected. The name category is one of them

How to align and set color at the same time inside a cell with python-docx

I am trying to make a table with python-docx.
This is my desire output:
¡--OK(bold)--¡--MIDDLE(in red)--¡----RIGHT¡
And this is what I get:
¡--OK(bold)--¡MIDDLE(in red)----¡RIGHT----¡
The code that I use is:
from docx import Document
from docx.shared import RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
document = Document()
table = document.add_table(rows=1, cols=3, style='Table Grid')
fila = table.rows[0].cells
# First cell: OK in bold
texto = 'OK'
dentro = fila[0].paragraphs[0]
dentro.add_run(texto).bold = True
dentro.alignment = WD_ALIGN_PARAGRAPH.CENTER
# Second cell: Middle in red
texto = 'MIDDLE'
dentro = fila[1].paragraphs[0].add_run(texto)
dentro.alignment = WD_ALIGN_PARAGRAPH.CENTER
font = dentro.font
font.color.rgb = RGBColor(255,0,0) # Red
# Third cell : Right
texto = 'RIGHT'
dentro = fila[2].paragraphs[0]
dentro.add_run(texto)
dentro.aligment = WD_ALIGN_PARAGRAPH.RIGHT
document.save('demo.docx')
I have two issues: First one is that I do not get the correct alignment in the middle cell when I add the color issue. Second one is that in cells after the wrong output of middle one, the alignment does not seem to work. How can I fix it? Do I have to wait until next version (actual 0.8.10)? Thanks,
Your code for the middle cell is different. You assign the new run to dentro rather than the paragraph. This causes the alignment value to be assigned to the run where it does nothing.
Change:
dentro = fila[1].paragraphs[0].add_run(texto)
to:
dentro = fila[1].paragraphs[0]
run = dentro.add_run(texto)
font = run.font
font.color.rgb = RGBColor(255, 0, 0)
I'm not sure how to account for the RIGHT alignment not "taking" on the third cell; I would make this fix and then see how you go.

How to interpretHTML code inside uib-tooltip

After looked for a solution, I have found a lot of article but not a way to do what I want so I'm there.
My problem:
I use uib-tooltip to set some explanation on the use/utility of some fields. I also use $translate with i18n files to do some translation.
These i18n files contains some html codes for special chars (because of servers issue I can't simply use UTF-8...).
And so, when I use simply for exemple:
<span translate="create.period"></span>
It's working fine, the HTML is interpreted fine and I have the good result.
Exemple of value on my i18n file:
create.period:'Ce champ contient la valeur de la période'
Result from the previus code:
Ce champ contient la valeur de la période
But if I use the uib-tooltip I have some issue.
Exemple of my code:
<span class='glyphicon glyphicon-question-sign pointer signColor' uib-tooltip="{{'create.period' | translate}}"></span>
And here the reult on the tooltip popup is :
Ce champ contient la valeur de la période
I have seen lot of thing like old way to do (uib-tooltip-html) or way to do with
$sce and ng-bind-html, but I can't do that here because I on the uib-tooltip.
So do I have miss some simple thing?
Or have you a solution for me? (and explanatinons :p)
Thank you very much ! :)
I add a try for a filter:
filter("htmlToPlaintext", ['$sce', '$compile', function ($sce, $compile) {
return function (val) {
return $sce.valueOf($sce.trustAsHtml(val));;
};
}])
Saddly not worky.
$scope.create.period = $sce.trustAsHtml('Ce champ contient la valeur de la période');
scope variable
<span class='glyphicon glyphicon-question-sign pointer signColor' uib-tooltip-html="create.period"></span>
pass '$sce' dependency in your controller

PIC BTFSC and BTFSS not working on PORTA

I've always blinked leds on PORTB in PIC16F628A.
Nowdays i need to do that on PORTA because I'm trying keypad matrix on PORTB.
The code below runs perfectly on RB3 of PORTB, but I doesn't in PORTA.
Here is the example in PORTA.
I've tested and the problem is in BTFSS and BTFSC function... Because if I turn led off or on manually is functioning well.
(also I've ommited delay_1s_routine code)
main
;*********CONFIGURACION LED**********
clrf Puerto_Led
movlw 0x07
movwf CMCON
bsf STATUS,RP0
clrf TRISA
bcf STATUS,RP0
loop
call prende_apaga_Led
call delay_1s_routine
goto loop
prende_apaga_Led
btfsc PORTA,RA1 ;si esta en 0 salta el GOTO
goto $+3
bsf PORTA,RA1 ;Pongo en '1' el bit del Led Verde
return
bcf PORTA,RA1 ;Pongo en '1' el bit del Led Verde
return
Thanks in Advice!!
EDITED: Put real values on code
PD: Tested this instruction separately and works great
- bsf PORTA,RA1
- bcf PORTA, RA1
I prefer:
Instead of going into techno quirks and philosophical debates, bypass the problem..
I always use shadow registers for port states and test and drive over them.
So use a bit in your RAM to reflect the state of PORTA, RA1. Trust me it will work seamlessly.
In your code after the label prende_apaga_Led,
You seem to be treating the LED pin once as an input (testing using btfsc), and once as an output (bsf and bcf). The pin can not be used as both at the same time. Either you set the associated TRISA bit as input or output and stick to it.
It seems to me that the code you are trying to do toggles the value of the LED based on its previous state. The way you are doing it won't work. An easier way to do it is by using the xor function as follows:
movlw 0xYY; where YY is the pattern in which 0 means no change to the pin output, 1 means toggle then follow by
xorlw PORTA
so simply it will be as:
clrf Puerto_Led
movlw 0x07
movwf CMCON
bsf STATUS,RP0
clrf Conf_Led
bcf STATUS,RP0
loop
movlw 0xYY ; change YY, i.e. if the LED is on RA2 YY will be 0x04
xorlw Puerto_Led
call delay_1s_routine
goto loop

How to add style to decoratedPopupPanel?

I have this code that creates a decorated popup panel :
...
var x = 600;
var y = 150+row*23;
var popPanel = app.createDecoratedPopupPanel().setStyleAttributes({background:'#FFFFDD',padding:'15px'});
var message = app.createHTML("Opération non reversible !!<BR>Il faudra 'rafraichir' votre navigateur<BR>"+
"après vous être effacé du planning (case ✖)<BR>pour voir les données à jour").setPixelSize(300,60).setStyleAttributes({background:'#FFFFDD',padding:'15px'});
popPanel.add(message);
popPanel.setAnimationEnabled(true);
popPanel.setPopupPosition(x, y);
popPanel.setAutoHideEnabled(true);
popPanel.show();// I didn't chain the commands to make it easier to test by commenting one or another...
return app;
}
and it gives this result :
My question is : knowing that background attribute determines the surrounding zone (popup panel padding 15px) and that the inside widget has also its background color (and its own padding as well), how can I change the color of this blue frame ?
It seems that decorated** can not be redecorated in GAS. I too have wondered this (when working with decorated tab panels). I concluded that it was not possible. I used the Chrome inspector and found out that the blue part is actually a set of images. So it wouldn't be a simple CSS fix.
This thread seems to have the final verdict.
Thanks to the link from the other answer (leading to James Ferreira's site) I was able to build this new code that is a lot more easy to customize...
Here it is with the result below :
...
var x = 600;
var y = 150+row*23;
var popPanel = app.createPopupPanel().setStyleAttributes({background:'#ccccaa',padding:'5px', borderRadius:'15px 15px 15px 15px',borderColor:'#ffffdd',borderWidth:'5px'});
var message = app.createHTML("Opération non reversible !!<BR>Il faudra 'rafraichir' votre navigateur<BR>"+
"après vous être effacé du planning (case ✖)<BR>pour voir les données à jour").setPixelSize(300,60).setStyleAttributes({padding:'5px'});
popPanel.add(message); popPanel.setAnimationEnabled(true).setPopupPosition(x, y).setAutoHideEnabled(true).show();
return app;
}
The borderRadius:'px px px px' can be used on any widget, allowing for nice buttons as wel ;-)