API error: <_UIKBCompatInputView: 0x13fd1d7c0; frame = (0 0; 0 0); layer = <CALayer: 0x1c4426e40>> returned 0 width, assuming UIViewNoIntrinsicMetric - ionic-framework

I'm using Ionic 3 on iPhone 7 plus with iOS 11. When I run my App, and fill in some text/input fields (basic forms) the app freezes for a few seconds and becomes completely unresponsive (which isn't good, not to say the least). I noticed this error coming up in Xcode, maybe that's the problem. Has anyone else encountered similar errors?
API error: <_UIKBCompatInputView: 0x13fd1d7c0; frame = (0 0; 0 0);
layer = > returned 0 width, assuming
UIViewNoIntrinsicMetric

Remove deprecated items from the forRoot config in app.module.ts
IonicModule.forRoot(),
Eg. remove these:
{
scrollPadding: true,
scrollAssist: false
}
See https://ionicframework.com/docs/utilities/config for more info.

Related

How can i reduce the OLED display clear time?

I have use STM32F0 microcontroller.
I try to integrate the stm32 with OLED(SSD1306:128*64).
It's an I2C communication.
The issue is while clearing the display takes some seconds(like 2sec.).
How can I make it faster?
I have attached the issue portion image.
Is there any way to solve the issue?
I think the issue in I2C_TransferHandling function, because its repeatedly call in loop. But no idea about how to solve this issue.
Issue section
void Display_Clear(void)
{
int i = 0;
Write_inst_oled(SSD1306_SET_COLUMN_ADDR);
Write_inst_oled(0);
Write_inst_oled(127);
Write_inst_oled(SSD1306_SET_PAGE_ADDR);
Write_inst_oled(0);
Write_inst_oled(7);
I2C_TransferHandling(I2C1,(SlaveAddr<<1),1, I2C_Reload_Mode, I2C_Generate_Start_Write);
while(I2C_GetFlagStatus(I2C1, I2C_FLAG_TXIS) == RESET);
Display_SendByte(SSD1306_DATA_CONTINUE);
delay_ms(1);
for (i = 0; i < 1024; i++) // Write Zeros to clear the display
{
I2C_TransferHandling(I2C1,0, 1, I2C_Reload_Mode, I2C_No_StartStop);
while(I2C_GetFlagStatus(I2C1, I2C_FLAG_TXIS) == RESET);
Display_SendByte(0);
delay_ms(1);
}
I2C_TransferHandling(I2C1, (SlaveAddr<<1), 0, I2C_SoftEnd_Mode, I2C_Generate_Start_Write);
Write_inst_oled(SSD1306_SET_COLUMN_ADDR);
Write_inst_oled(0);
Write_inst_oled(127);
Write_inst_oled(SSD1306_SET_PAGE_ADDR);
Write_inst_oled(0);
Write_inst_oled(7);
}
Remove delay from the loop. You wait 1ms on every iteration. It will save you more than 1 second,
Increase the I2C speed. most displays support 400k+ I2C speeds. Sending 1024 bytes will take at least 0.8sek

AES GCM mechanism parameters in C

I am having problem setting the parameters for the AES GCM mechanism.
I am receving the following error
#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
What am I doing wrong?
CK_BYTE iv[12] = { 0 };
CK_MECHANISM mechanismAES = { CKM_AES_GCM, NULL_PTR, 0 };
CK_GCM_PARAMS params = {
.pIv=iv,
.ulIvLen=12,
.ulIvBits=96,
.pAAD=NULL,
.ulAADLen=0,
.ulTagBits=0
};
mechanismAES.pParameter = &params;
mechanismAES.ulParameterLen = sizeof(params);
C_EncryptInit(hSession, &mechanismAES, hKey);
.ulTagBits=0 is very likely the issue. The tag size is the size of the authentication tag. You would not have an authenticated mode of encryption if you left it out.
Valid tag sizes of GCM are 128, 120, 112, 104 or 96 bits. Smaller tag sizes such as 64 bits may be acceptable by some API's. You are however strongly encouraged to keep to the 128 bit tag size, as the security of GCM strongly depends on it.
You may also want to specify either the IV len or the IV bits if the error doesn't go away.

Which code is right for Peterson's algorithm?

Recently I have started learning Inter process communication.
To implement peterson's algorithn I have found two codes:
1.#define N 2
2. #define TRUE 1
3. #define FALSE 0
4. int INTERESTED[N] = FALSE
5. int TURN;
6. void Entry_Section(int process)
7. {
8. int other;
9. other = 1 – process;
10. INTERESTED[process] = TRUE;
11. TURN = process;
12. while(INTERESTED[other] == TRUE && TURN = process)
13. }
14. void Exit_Section(int process)
15. {
16. INTERESTED[process] = FALSE;
17. }
And
1.do
2. {
3.flag[i]=True;
4. turn=j;
5. while (flag[j] && turn==j); // critical. 6.section flag[i]=False; // remainder. 7.section
8. } while (True);
So I want to know which one is true.
I think the second one is correct.
Because:
(1st code)
When, context switch occurs after setting flag value 'turn = process' (process means its pointing itself) and next process comes in enter_regin() function. Both of the values of 'intrested[2]' array will be true. And the while loop after it (which acts as trap) will be true and non of the process can get out of it.
I just want to know am I right or wrong.

How to fix refreshPreferences Message in Xcode 9 [duplicate]

This question already has answers here:
refreshPreferences HangTracerEnabled / HangTracerDuration messages in iOS 11 + Xcode 9
(3 answers)
Closed 5 years ago.
add this line code to my class
let myLayer = CALayer()
myLayer.contents = self.makeTrySwiftLogoImage().CGImage
var transform = CATransform3DIdentity
transform.m34 = 1.0 / -500
transform = CATransform3DRotate(transform, 45.0f * M_PI / 180.0, 0, 1, 0)
myLayer.transform = transform
and get this message to my console
2017-09-22 18:00:53.354890+0330 SibDiet[973:944502] refreshPreferences: HangTracerEnabled: 0
2017-09-22 18:00:53.355974+0330 SibDiet[973:944502] refreshPreferences: HangTracerDuration: 500
2017-09-22 18:00:53.356014+0330 SibDiet[973:944502] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
and don't run my application, remove this 6 line and run again but receive this message again, remove Xcode and install again but no fix
I managed to fix it on High Sierra(10.13.1) XCode 9.1 and with iOS 11.0.3 by defining OS_ACTIVITY_MODE as disable by going in XCode via
Product > Scheme > Edit Scheme > Arguments > Environment Variables
add OS_ACTIVITY_MODE disable
schema editor (fragment)
Note: NSLog may not work after doing this.
Similar issue is reported in the question:
refreshPreferences HangTracerEnabled / HangTracerDuration messages in iOS 11 + Xcode 9

Qt Embedded exchanged colors bits: Red and Blue

I'm using QtEmbedded (4.8.0) on an ARM display device with 16bits color depth on the framebuffer (/dev/fb0). At this scenario we are getting the colors bits RED and BLUE exchanged.
We are using the following compile flags:
./configure -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -prefix /home/rchaves/Toolchain -release -opensource -shared -fast -depths 16 -largefile -no-exceptions -no-accessibility -stl -no-sql-mysql -no-sql-psql -no-sql-oci -no-sql-odbc -no-sql-tds -no-sql-db2 -no-sql-sqlite -no-sql-sqlite2 -no-sql-ibase -no-qt3support -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon-backend -no-svg -no-webkit -no-javascript-jit -no-script -no-scripttools -no-declarative -no-declarative-debug -qt-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-openssl -no-nis -no-cups -iconv -no-pch -no-dbus -qt-freetype -no-opengl -qt-gfx-linuxfb -qt-kbd-linuxinput -qt-mouse-tslib -nomake demos -nomake examples
And the following parameters to execute the application:
QWS_DISPLAY=LinuxFb:/dev/fb0:depth=16 ./app -qws
Here there are the application framebuffer (samples) log:
The framebuffer device was opened successfully.
Fixed screen info:
id: DISP3 BG
smem_start: 0x93800000
smem_len: 7864320
type: 0
type_aux: 0
visual: 2
xpanstep: 1
ypanstep: 1
ywrapstep: 0
line_length: 2048
mmio_start: 0x0
mmio_len: 0
accel: 0
The framebuffer device was mapped to memory successfully.
Successfully switched to graphics mode.
Variable screen info:
xres: 1024
yres: 768
xres_virtual: 1024
yres_virtual: 3840
yoffset: 0
xoffset: 0
bits_per_pixel: 16
grayscale: 0
red: offset: 0, length: 5, msb_right: 0
green: offset: 5, length: 6, msb_right: 0
blue: offset: 11, length: 5, msb_right: 0
transp: offset: 0, length: 0, msb_right: 0
nonstd: 0
activate: 64
height: -1
width: -1
accel_flags: 0x0
pixclock: 15385
left_margin: 157
right_margin: 157
upper_margin: 16
lower_margin: 15
hsync_len: 5
vsync_len: 1
sync: 0
vmode: 0
Frame Buffer Performance test...
Average: 43020 usecs
Bandwidth: 174.338 MByte/Sec
Max. FPS: 23.245 fps
Will draw 3 rectangles on the screen,
they should be colored red, green and blue (in that order).
Done.
Better late than never. I had this exact problem with a SAM5 processor using Qt5.5.1 and the linuxfb plugin. Reconfigure or recompile the Qt5 framework will NOT solve the problem.
Apparently the LinuxFB plugin does not support the BGR format. There is an open bug tracking this issue. Check the determineFormat function in ../src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp, in which you will find out that the ImageFormats are hardcoded to **RGB no matter what kind of framebuffer info was provided.
To solve the problem, applying the patch attached to the bug may help you to resolve this issue.
I said "may" because my framebuffer driver was falsely reporting it is in the RBG format. So watch out for that. If that is the case, just hardcode the swapRgb flag until you fix your framebuffer driver.
Update: Try setting -depths generic in ./configure and run with -display linuxfb:genericcolors. This is as per this thread which discusses the problem.
Old answer: It sounds like your endian-ness of the display is swapped.
As per the documentation, you can try to pass the littleendian option to the display string. The other option is to consult the linux fb documentation about performing endian swaps.