Posts

.net - Retrieving MYSQL Database structure information from Java -

i'm trying java , mysql same used .net , sql server: by using microsoft.sqlserver.management.smo can access database structure information instance ( server name, table structure, columns, datatype, description, default value) i tried find same java + mysql seems not popular any directions? thanks ed the simplest way accomplish retrying connection metadata, first open connection: connection conn = drivermanager.getconnection("jdbc:mysql://localhost:3306/db", "user","****"); databasemetadata metadata = conn.getmetadata(); then start navigating through metadata, can check available operations in databasemedata

php - MySQL query with DISTINCT keyword -

my mysql table country_phone_codes looks this id country_code area_code name ------------------------------------------------------------ 1 | 93 | 93 | afghanistan 2 | 93 | 9370 | afghanistan - mobile 3 | 93 | 9375 | afghanistan - mobile 4 | 355 | 355 | albania 5 | 355 | 35568 | albania - mobile - amc 6 | 213 | 213 | algeria 7 | 213 | 2131 | algeria - cat ------------------------------------------------------------ these few records of more 28000 records. trying formulate query provide me result this- country_code name ----------------------------- 93 | afghanistan 355 | albania 213 | algeria ----------------------------- by using select distinct(country_code) country_phone_codes order country_code limit 0,260 , able distinct country codes. how corresponding country name? ...

objective c - ARC restriction - Implicit conversion of 'char' to 'NSString *' is disallowed with ARC -

i'm playing mapkit , setting annotations. somewhere in code have :- #define annotation_first_type 1 unsigned char annotype = annotation_first_type annotationview = (mkpinannotationview *) [_mapview dequeuereusableannotationviewwithidentifier:annotype ]; the last line above throws error implicit conversion of 'char' 'nsstring *' disallowed arc , fair enough, need explicitly change annotype nsstring. but odd thing is; if line (3) had below instead :- annotationview = (mkpinannotationview *) [_mapview dequeuereusableannotationviewwithidentifier:**annotation_first_type**]; it compiles without error? question is, type of annotation_first_type? annotation_first_type integer. integer can implicitly converted pointer in c, if have enabled warnings compiler should have warned this. don't know why isn't compiler error, oversight. you should define annotation_first_type nsstring, e.g. #define annotation_first_type @"1"

linux - Show full list of php scripts on server -

how show full list of running php sripts on linux server? see httpd service, or pid not specific php file source, need analyze script take more memory , fixed it. thanks you have 2 options: log urls requested server , end in php scripts being executed can use php feature, allows add php script apache request sent php. enable adding root .htaccess: php_value auto_prepend_file append.php in append.php add logging feature, can insert url requested, time took generate response , max memory used. if add tab separated file, import in db table , see happening on server. more info here: http://www.electrictoolbox.com/php-automatically-append-prepend/ debug apache doing , using strace start apache strace. debug operations apache , subsequently php doing. watch out, there lot of noise in debug output. more info here: http://bobcares.com/blog/?p=103

get columns from multiple tables from multiples entities in Silverlight -

i create datagrid contains 5 columns. each column different table , each table different entity. how should in silverlight ? i'm able data 1 table , display in datagrid combining entities seems complicated. thank you. create single store procedure , take n number of columns n number of tables .

javascript - jQuery - Only Call The Hover Out Function if Cursor Isn't Entering Any Siblings -

i'm trying create effect similar navigation on site: http://rogwai.com/ . i'm close can in jsfiddle . it's working fine if hover 1 li @ time (i.e. bottom). if however, slide horizontally through each list item 'follower' returns active position or slides of end after each item that's hovered over. instead should follow mouse. looking @ code executed on hover out understandable. can't head around how make return active position or slide off end when mouse leaves menu. hopefully makes sense - should see problem straight away jsfiddle. thanks in advance. what can add mouseenter part li have it, put mouseleave part on entire ul . way, leave fire when mouse out of entire ul . http://jsfiddle.net/yzr5b/6/ $('nav.block-system-main-menu ul li:not(.follower)').mouseenter(function() { followermove($(this)); }); $('nav.block-system-main-menu ul').mouseleave(function(){ followermove($active); }); note, if using jq...

bash - How to merge every two lines into one from the command line? -

i have text file following format. first line "key" , second line "value". key 4048:1736 string 3 key 0:1772 string 1 key 4192:1349 string 1 key 7329:2407 string 2 key 0:1774 string 1 i need value in same line of key. output should this... key 4048:1736 string 3 key 0:1772 string 1 key 4192:1349 string 1 key 7329:2407 string 2 key 0:1774 string 1 it better if use delimiter $ or , : key 4048:1736 string , 3 how merge 2 lines one? awk: awk 'nr%2{printf "%s ",$0;next;}1' yourfile note, there empty line @ end of output. sed: sed 'n;s/\n/ /' yourfile