Posts

php - Switching on mysqli over mysql -

i have mysql installed , want work on mysqli new database. does affect previous database in mysql if enable mysqli in phpmyadmin? mysqli -> mysql improved extension . the mysqli extension, or known, mysql improved extension, developed take advantage of new features found in mysql systems versions 4.1.3 , newer. mysqli extension included php versions 5 , later. you have change code have done using mysql . no need change database. mysqli methods use mysql database. this may help

mysql - Haversine Formula works as Normal SQL but not in stored procedure -

Image
i using haversine formula find distance between users. works normal mysql piece of code. when use same in stored procedure not working , throws 0.00 distances. don't know why? this working code: drop temporary table if exists temp_tab; create temporary table temp_tab(temp_id integer not null auto_increment primary key, user_fb_id bigint(20) unique,distance double(15,8) default null) charset=utf8; insert temp_tab (user_fb_id, distance) select * (select user_fb_id, 6371 * acos(sin(radians( 11.01684450 )) * sin(radians(`latitude`)) + cos(radians( 11.01684450 )) * cos(radians(`latitude`)) * cos(radians(`longitude`) - radians( 76.95583210 ))) `distance` `user_login_log` user_id <>'1831820984' having `distance` <= 50 order `activity_at` desc) t1 group user_fb_id; select * temp_tab; normal sql output: stored procedure output: stored procedure: delimiter ;; create definer=`up_beta`@`127.0.0.1` procedure ...

Overriding in C#, making two subsequent method virtual -

it's question of overriding in c#. when use following code: class program { class { public virtual void callme() { console.writeline("this a"); } } class b : { public new virtual void callme() { console.writeline("this b"); } } class c : b { public override void callme() { console.writeline("this c"); } } static void main(string[] args) { obj = new c(); obj.callme(); console.readkey(); } } output: this a and when use: class program { class { public virtual void callme() { console.writeline("this a."); } } class b : { public override void callme() { console.writeline("this b."); } } class c : b { public override void callme() ...

java - How to open local text file with JavaFX WebView -

Image
is possible open local text file javafx webview ? have try following code not working. how can make enable this? thanks. webview wv = new webview(); wv.getengine().setcreatepopuphandler(new callback<popupfeatures, webengine>() { @override public webengine call(popupfeatures p) { stage stage = new stage(stagestyle.utility); webview wv2 = new webview(); stage.setscene(new scene(wv2)); stage.show(); return wv2.getengine(); } }); wv.getengine().loadcontent("<a href="file:///c:\users\dev\infor.txt">open file</a>"); stackpane root = new stackpane(); root.getchildren().add(wv); scene scene = new scene(root, 300, 250); primarystage.settitle("hello world!"); primarystage.setscene(scene); primarystage.show(); yes, can open local text file javafx webview. sample app: import javafx.application.application...

oracle - To insert a value in a String -

i have requirement manipulate string required value. i need change actualstring99 actualstring_99 . passing actualstring99 function , returning actualstring_99 in following way. select 'value' actual, regexp_replace('value', '[[:digit:]]') string, regexp_replace('value', '[[:alpha:]]') digit, concat(concat(regexp_replace('value', '[[:digit:]]'),'_'),regexp_replace('value', '[[:alpha:]]')) required dual; passing value as actualstring99 . have other simple way (using or without using regular expression) out calling function? to prepend underscore before numerical part of string, can use regexp_replace backreference. select regexp_replace('actualstri...

bluetooth lowenergy - connecting issue with android ble -

i have issue ble getting disconnecting, below code changes based on answer earlier used response show data ble device phone , but after code change can not data device think has "enable_indication_value" , "enable_notification_value" can call both @ same time public void setcharacteristicnotification(bluetoothgattcharacteristic bluetoothgattcharacteristic, boolean flag) { if(mbluetoothadapter == null || mbluetoothgatt == null) { log.w(tag, "bluetoothadapter not initialized"); } else { mbluetoothgatt.setcharacteristicnotification(bluetoothgattcharacteristic, flag); bluetoothgattdescriptor bluetoothgattdescriptor = bluetoothgattcharacteristic.getdescriptor(uuid.fromstring(samplegattattributes.client_characteristic_config)); if(bluetoothgattdescriptor != null) { bluetoothgattdescriptor.setvalue(bluetoothgattdescriptor.enable_notification_value); mbluetoothgatt.writedescriptor(...

r - Change label in ggpairs upper panel -

Image
do know how change labels in upper panel in ggpairs ( ggally package)? found how change size, font not label. here want shorten label ("set" pour setosa etc...). tried put in labels=c("set", "ver", "vir") or upper=list(params=list(size=8),labels=c("set", "ver", "vir")) doesn't work. ggpairs(iris, columns=c(2:4), title="variable analysis", colour="species", lower=list(params=list(size=2)), upper=list(params=list(size=8))) conceptually same @mike's solution, in 1 line. levels(iris$species) <- c("set", "ver", "vir") ggplairs(<...>) here's another, more flexible proposal if have many levels , not want abbreviate them hand: trim levels desired length. levels(iris$species) <- strtrim(levels(iris$species), 3) ggplairs(<...>) and way, width parameter vectorized: rm(iris) strtrim(levels(iris$species), c(1, ...