Posts

Showing posts from June, 2015

Android Notification.PRIORITY_MAX Is Deprecated What Is The Alternative To Show Notification On Top?

Answer : PRIORITY_MAX This constant was deprecated in API level 26. use IMPORTANCE_HIGH instead. PRIORITY_MAX int PRIORITY_MAX This constant was deprecated in API level 26. use IMPORTANCE_HIGH instead. Highest priority, for your application's most important items that require the user's prompt attention or input. Constant Value: 2 (0x00000002) // create ios channel NotificationChannel iosChannel = new NotificationChannel(IOS_CHANNEL_ID, IOS_CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH); iosChannel.enableLights(true); iosChannel.enableVibration(true); iosChannel.setLightColor(Color.GRAY); iosChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); getManager().createNotificationChannel(iosChannel); https://developer.android.com/reference/android/app/Notification.html#PRIORITY_MIN In android O there was introduction of Notification channels. In particular you define Channel with constru

Adding Shadows At The Bottom Of A Container In Flutter?

Image
Answer : Or you can wrap your Container widget with a Material widget which contains an elevation property to give the shadowy effects. Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Material( elevation: 15.0, child: Container( height: 100, width: 100, color: Colors.blue, child: Center(child: Text("Material",style: TextStyle(color: Colors.white),)), ), ), SizedBox(width: 100,), Container( height: 100, width: 100, decoration: BoxDecoration( boxShadow: <BoxShadow>[ BoxShadow( color: Colors.black54, blurRadius: 15.0, offset: Offset(0.0, 0.75)

Code For White Colour Code Example

Example: rgba white color rgb(255,255,255) /*white*/ Hex #FFFFFF

Sql Update Set Multiple Columns Code Example

Example 1: sql update multiple columns from another table -- Oracle UPDATE table2 t2 SET ( VALUE1 , VALUE2 ) = ( SELECT COL1 AS VALUE1 , COL1 AS VALUE2 FROM table1 t1 WHERE t1 . ID = t2 . ID ) ; -- SQL Server UPDATE table2 t2 SET t2 . VALUE1 = t1 . COL1 , t2 . VALUE2 = t1 . COL2 FROM table1 t1 INNER JOIN t2 ON t1 . ID = t2 . ID ; -- MySQL UPDATE table2 t2 INNER JOIN table1 t1 USING ( ID ) SET T2 . VALUE1 = t1 . COL1 , t2 . VALUE2 = t1 . COL2 ; Example 2: sql server update multiple columns at once UPDATE Person . Person Set FirstName = 'Kenneth' , LastName = 'Smith' WHERE BusinessEntityID = 1 Example 3: update multiple columns in sql UPDATE table - name SET column - name = value , column - name = value WHERE condition = value Example 4: update table sql multiple set -- CANT do multiple sets but can do case UPDATE table SET ID = CASE WHEN ID = 2555 THEN 111111259

Add Column To Existing Table In Postgres Code Example

Example 1: postgresql add column with constraint ALTER TABLE customers ADD COLUMN contact_name VARCHAR NOT NULL; Example 2: alter table add column psql ALTER TABLE table_name ADD column_name data_type column_constraint; Example 3: alter table add multiple columns postgresql ALTER TABLE customer ADD COLUMN fax VARCHAR, ADD COLUMN email VARCHAR; Example 4: alter table add column postgres Alter Postgres Table

Bootstrap Dropdown Not Opening First Click On React 16

Answer : You may have jQuery or Bootstrap included twice. I don't use React, but I was having the same problem with Angular. It turns out that I was including jQuery/Bootstrap in my index.html as well my "scripts" configuration (which I think would be your "entry"). You should import this line and Test again : import 'bootstrap/dist/js/bootstrap.bundle'; this work for me like a charm :) I got the same issue. I noticed that when i was using bootstrap.min.js and jquery.min.js at a same time. Then my dropdown takes two click for toggle in first time after page load. Then i commented bootstrap.min.js . Now it is not giving me this issue. Try this. Maybe it will solve your problem.

Catch Vs Catch (Exception E) And Throw Vs Throw E

Answer : I think there are two questions here. What is the difference between throw and throw e; ? I don't think there is ever a good reason to write catch (Exception e) { throw e; } . This loses the original stacktrace. When you use throw; the original stacktrace is preserved. This is good because it means that the cause of the error is easier to find. What is the difference between catch and catch (Exception e) ? Both of your examples are the same and equally useless - they just catch an exception and then rethrow it. One minor difference is that the first example will generate a compiler warning. The variable 'e' is declared but never used It makes more sense to ask this question if you had some other code in your catch block that actually does something useful. For example you might want to log the exception: try { int value = 1 / int.Parse("0"); } catch (Exception e) { LogException(e); throw; } Now it's necessary

Android Shape With Gradient Border And Shadow

Image
Answer : Here you go Create your layout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#c8c0c0" android:orientation="vertical"> <LinearLayout android:layout_width="120dp" android:layout_height="120dp" android:layout_centerInParent="true" android:background="@drawable/my_rectangle"> </LinearLayout> </RelativeLayout> Create my_rectangle.xml file inside drawable folder <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <gradient

Latex Maketitle Add Spacing Code Example

Example: spacing lines latex \usepackage { setspace } \doublespacing

Can't Install Wine From Winehq.org On Ubuntu (actually Lubuntu) 18.04 LTS

Answer : Analysis The WineHQ repository misses the dependencies for wine-stable package. I have reported a bug 48513 to WineHQ bugzilla. The main problem here is bad documentation, which is written in non-reproducible way. The Rosanne DiMesio's main idea is "People who don't bother to read the directions are always going to have problems.". So we need to write our own documentation until WineHQ-officials become smarter. The problem with dependencies was caused by the FAudio dependency, which is not contained in Debian/Ubuntu and WineHQ repositories. We can determine the exact package name by using command below and analyzing of their output: $ sudo apt-get install wine-stable-amd64 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not y

Math.abs Method In Java Code Example

Example: abs in java public class Test { public static void main ( String args [ ] ) { Integer a = - 8 ; double d = - 100 ; float f = - 90 ; System . out . println ( Math . abs ( a ) ) ; System . out . println ( Math . abs ( d ) ) ; System . out . println ( Math . abs ( f ) ) ; } }

Bootstrap 4 Form In W3school Code Example

Example: responsive form bootstrap 4 < form > < div class = " form-group " > < label for = " exampleFormControlInput1 " > Email address </ label > < input type = " email " class = " form-control " id = " exampleFormControlInput1 " placeholder = " name@example.com " > </ div > < div class = " form-group " > < label for = " exampleFormControlSelect1 " > Example select </ label > < select class = " form-control " id = " exampleFormControlSelect1 " > < option > 1 </ option > < option > 2 </ option > < option > 3 </ option > < option > 4 </ option > < option > 5 </ option > </ select > </ div > < div class = " form-group " > < label for = " exam