default

Oracle setting per user default scheme (not altering a session)

陌路散爱 提交于 2019-11-28 06:56:49
is there a way to change an oracle user's default schema? I found it in the FAQ that I can alter it in the session, but it's not what I want. E.G. the user at log on always sees another schema as default. Thanks in advance. I believe a logon trigger should work: CREATE OR REPLACE TRIGGER db_logon AFTER logon ON DATABASE WHEN (USER = 'A') BEGIN execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = B'; END; For some reason Tony's trigger did not work for me. However, a slightly different trigger that I found on the web using the same concept did. create or replace trigger set_default_schema

Clang and the default compiler in OS X Lion

人走茶凉 提交于 2019-11-28 06:37:32
In OS X Snow Leopard (10.6) I used the following lines in ~/.bashrc to force compilation with clang instead of standard gcc: # Set Clang as the default compiler for the system export CC=clang export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments I also (occasionally) had to use the following lines to use llvm-gcc when clang would fail to compile certain things (PostgreSQL was guilty of this for a long time): # Set LLVM GCC as the default compiler for the system export CPP='llvm-gcc-4.2' export CC='llvm-gcc-4.2' export CXX='llvm-g++' On OS X Lion (10.7), are these lines still

MySQL DATE field with default CURDATE(). NOT DATETIME

a 夏天 提交于 2019-11-28 04:40:41
问题 It is possible to set default value on DATE ( NOT DATETIME ) column in MySQL 5.7 to current date? I try this (generated by Workbench): ALTER TABLE `db`.`table` CHANGE COLUMN `column` `column` DATE NOT NULL DEFAULT CURDATE() ; but not works for me. (no data in table) 回答1: No, you cannot. The documentation is pretty clear on this: This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can

How can I use DB side default value while use Hibernate save?

谁说胖子不能爱 提交于 2019-11-28 04:29:47
I have a column in DB with default value as sysdate . I'm looking for a way to get that default value inserted while I'm not giving anything to corresponding property on app side. By the way, I'm using annotation-based configuration. Any advice? Xavi López The reason why the date column gets a null value when inserting, even though it is defined as default SYSDATE dbms-side, is that the default value for a column is only used if the column is not given a value in the query. That means it must not appear in the INSERT INTO sentence, even if it has been given null . If you want to use the

Find out if Android device is portrait or landscape for normal usage?

℡╲_俬逩灬. 提交于 2019-11-28 04:20:23
Is there anyway to find out if a device is portrait or landscape by default? In that I mean how you normally use the device. Most phones have a portrait screen for normal usage but is there some flag for finding that out? Hazem Farahat You can do this by: For Lanscape if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){ //Do some stuff } For Portrait if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){ //Do some stuff } Check: http://developer.android.com/reference/android/content/res/Configuration.html#orientation Thanks

What are the default font characteristics in Android ?

风流意气都作罢 提交于 2019-11-28 03:49:33
I know that fonts properties can be found in the TypeFace class but I can't find the default characteristics of the writing in Android. I mean, if I take a TextView and simply do setText("Blabla") on it, what will I get? Which size in px? Which font? etc. Maragues You can check the default style of the widgets here: android/res/values/styles.xml Then, looking for Textview you reach <style name="Widget.TextView"> <item name="android:textAppearance">?android:attr/textAppearanceSmall</item> </style> and after researching a little bit, you find out that this appearance is defined in the same

Linux: command to open URL in default browser

ぐ巨炮叔叔 提交于 2019-11-28 03:46:01
What command we have to execute (from Java, but that should not matter) on Linux (different common distributions) to open a given URL in the default browser? The most cross-distribution one is xdg-open http://stackoverflow.com I believe the simplest method would be to use Python: python -m webbrowser "http://www.example.com/" on ubuntu you can try gnome-open. $ gnome-open http://www.google.com In Java (version 6+), you can also do: Desktop d = Desktop.getDesktop(); d.browse(uri); Though this won't work on all Linuxes. At the time of writing, Gnome is supported, KDE isn't. At least on Debian

What is the purpose of the default keyword in Java?

本秂侑毒 提交于 2019-11-28 03:38:20
An interface in Java is similar to a class, but the body of an interface can include only abstract methods and final fields (constants). Recently, I saw a question, which looks like this interface AnInterface { public default void myMethod() { System.out.println("D"); } } According to the interface definition, only abstract methods are allowed. Why does it allow me to compile the above code? What is the default keyword? On the other hand, when I was trying to write below code, then it says modifier default not allowed here default class MyClass{ } instead of class MyClass { } Can anyone tell

Get default user email in iOS Device

删除回忆录丶 提交于 2019-11-28 03:34:01
问题 Is it possible to retrieve the user email associated with the default email account directly from an app? Screenshot: Thanks. 回答1: I can't prove a negative, but I am fairly certain this is not possible. You can use MFMailComposeViewController to allow the user to send an email from the default account, but you cannot directly access information about the default account. If you need the user's email address, you either have to ask for them to type it in, or have them select it from their

Angularjs Template Default Value if Binding Null / Undefined (With Filter)

爷,独闯天下 提交于 2019-11-28 03:24:53
I have a template binding that displays a model attribute called 'date' which is a date, using Angular's date filter. <span class="gallery-date">{{gallery.date | date:'mediumDate'}}</span> So far so good. However at the moment, if there is no value in the date field, the binding displays nothing. However, I would like it to display the string 'Various' if there is no date. I can get the basic logic using a binary operator: <span class="gallery-date">{{gallery.date || 'Various'}}</span> However I can't get it to work with the date filter: <span class="gallery-date">{{gallery.date | date: