Posts

c++ - why doesn't clang++ compile the following code? -

i have following code: #include <type_traits> int main() { } g++ file.cc -std=c++0x works fine. however, need use clang++ reason. when try clang++ file.cc -std=c++0x i bunch of errors: in file included file.cc:1: in file included /usr/include/c++/4.4.4/type_traits:50: /usr/include/c++/4.4.4/tr1_impl/type_traits:230:41: error: expected ')' struct is_function<_res(_argtypes......)> ^ /usr/include/c++/4.4.4/tr1_impl/type_traits:230:28: note: match '(' struct is_function<_res(_argtypes......)> ^ /usr/include/c++/4.4.4/tr1_impl/type_traits:230:12: error: redefinition of 'is_function<type-parameter-0-0 (type-parameter-0-1, ...)>' struct is_function<_res(_argtypes......)> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/4.4.4/tr1_impl/type_traits:227:12: note: previous definition here struct is_function<_res(_argtypes......

database - How to get the commands and table that deadlocked in Oracle? -

i want deadlocked tables/column, , commands locked table/column. has way? the oracle view v$lock contains details of locks @ time. the id1 value map dba_objects.object_id. you need granted select on these views if not have dba access. more details here , here

php - Make something appear only on first page in Wordpress -

how can make banner appear on index page of wordpress theme when click second or other page pagination of recent posts not want appear. suggestions? thanks you can use conditional is_paged() if( !is_paged() ) { // show wanna show } it's going show on first page, on page 2, 3, 4... it's not going show.

javascript - Display select fields using conditional statements in JS -

i designing self-service site people problems accessing secure website. want generate drop downs questions situation based on answers each previous drop down box. trying use js , conditional statements accomplish this. not programmer understand enough reverse engineer it. here's have far. <select id="location" name="location" onclick='test()'> <option value="0">is personal computer or government computer?</option> <option value="home">personal</option> <option value="gfe">government</option> </select> <select id="home" name="home" style="display: none" onclick='test()'> <option value="0">do have cac?</option> <option value="1">yes</option> <option value="2">no</option> </select> <select id="multi-cac" name="multi-cac" s...

ios - How to generate random letters as per the word -

i’m developing word puzzle game,where 1 word given.according word random letters generated…for that, applied below logic how random letters not generated per given word. nsmutablearray *arrofabcd = [[nsmutablearray alloc] initwithobjects:@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z", nil]; float x = 70; float y = 100; float width = 30; float height = 20; for(int =0;i<32;i++) { nsuinteger randomindex = arc4random() %(arrofabcd.count); uibutton *btnletter = [uibutton buttonwithtype:uibuttontyperoundedrect]; [btnletter setframe:cgrectmake(x, y, width, height)]; [btnletter settitle:[nsstring stringwit...

getStringExtra - Public Static Final - The Busy Coder's Guide to Android -

i on page 301 of book , example of activity getting "extras" intent started it. new java maybe missing pretty obvious but... thought when declare variable "final" meant doesn't change. there line of code initialising final variable: public static final string extra_message="msg"; and later in oncreate method: tv.settext(getintent().getstringextra(extra_message)); the text displayed in activity not "msg" string passed intent "i other activity". why have have variable declaration above code work? don't understand doing. thanks you getting extra received activity indexed key 'msg'. like when intent used start activity : intent.putextra("msg", "text going in textview"); the key 'msg', value textview 'text going in textview'

php - Yii rest api insert data in database -

i have problem rest service. i'm new programmer in yii framework , did not create service before. code next: my controller: public function actionlist() { $model=new entryfile; if($_post) { $init = cjson::decode(file_get_contents('php://input')); $model->attributes=$init['input']; $model->eetype=($model->eetype); $model->eesize=($model->eesize); $model->eefilename=($model->eefilename); $model->eefilechecksum=($model->eefilechecksum); $model->eeentrypath=($model->eeentrypath); } $model=new outputfile; if($_post) { $init = cjson::decode(file_get_contents('php://input')); $model->attributes=$init['output']; $model->ofname=($model->ofname); $model->ofd...