Posts

security - PHP writing to a text file on server -

i have log process writes little custom .txt log file on server when people supply input on particular form (so can keep eye on trying use injection). my question: file plaintext, , not link anywhere in code other php calls file_get_contents , file_put_contents . there way see file? search engine possibly find it? (i understand security obscurity. question how 1 might possibly "unobscure" this.) i understand security obscurity. question how 1 might possibly "unobscure" this. they need able know site’s code structure & logic. if name directory logs stored in other logs/ first decent step. or keep directory named logs/ have nested in directory know such my_cool_stuff/logs . if want sure nobody get’s it, can set apache config rule block directly reading .txt files directly browser, use apache files directive in web site’s apache config or in .htaccess on site: <files ~ "\.(txt|yml|yaml)$"> order allow,deny deny...

Using MYSQL Associative Table and JOIN -

here structure of 3 tables: create table `contacts` ( `id` int(11) unsigned not null auto_increment, `name` varchar(99) default not null, primary key (`id`) ) engine=innodb auto_increment=1 default charset=latin1; create table `addresses` ( `id` int(11) unsigned not null auto_increment, `street` varchar(99) default not null, `city` varchar(99) default not null, `state` varchar(20) default not null, `zip` int(9) default not null, primary key (`id`) ) engine=innodb auto_increment=1 default charset=latin1; create table `contacts_addresses` ( `id` int(11) unsigned not null auto_increment, `idcontact` int(9) default not null, `idaddress` int(9) default not null, primary key (`id`) ) engine=innodb auto_increment=1 default charset=latin1; sample data: mysql> select * contacts; +----+----------------+ | id | name | +----+----------------+ | 1 | hank kingsley | | 2 | phil collins | | 3 | sam weisgamgee | | 4 | john johnson | | 5 | dale gi...

postgresql - how to get points from linestring postgis -

i have linestring (0 0 , 2 4 , 5 5); i need output in form : x (1st cell) || y (2nd cell) 0 || 0 2 || 4 5 || 5 and same polygon. how ? you can use st_x , st_y in conjunction st_pointn x , y of individual points, , use generate_series create index each point of linestring, eg, with line (select st_geomfromtext('linestring(0 0, 2 4, 5 5)') geom) select st_x(st_pointn(geom,num)) x, st_y(st_pointn(geom,num)) y line, (select generate_series(1, (select st_numpoints(geom) line)) num) series;

plsql - How to run oracle PL/SQL in C++? -

i want run sql script c++ program. code goes this: int main() { //..... sql_stmt = "insert t1 values ('qwerty');\ninsert t1 values ('dothar');"; sql_stmt = "declare\nrollback_check_counter number;\n" "begin\n" "rollback_check_counter :=1;\n" "savepoint sp_1;\nif rollback_check_counter = 1 then\n" "begin\n"+sql_stmt+"exception\n" "when program_error then\n" "rollback_check_counter :=0;\n" "rollback sp_1\n" "when others then\n" "rollback_check_counter :=0;\n" "rollback sp_1\n" "end;\n" "end if;\n" "commit;\n" "end;"; try { connection *conn = env->createconnection(user,passwd); //error prone statement *stmt = conn->createstatement(); stmt->setsql(sql_stmt); row_count = stmt->...

java - Web Service Authentication with Digital Signature/ Certificate in Android -

we're trying authenticate soap web service in android through digital signature (cryptography mechanism) , digital certificates. in normal j2ee application, achieved apache cxf along wss4j (implements primary security standards). however in android, we're consuming soap web servcies through stubs generated through easywsdl. apache cxf jars aren't supported in android , can't rely on them. kindly let me know how authenticate web service in andorid?

spring - Play Framework and Java8 -

i have 1 java 8 project , project dependency of play web app. whenever try instantiate classes rom java 8 project in play 2.2.3 web app, gives me following error: play.playexceptions$compilationexception: compilation error[error: cannot access mongooperations] @ play.playreloader$$anon$1$$anonfun$reload$2$$anonfun$apply$14$$anonfun$apply$16.apply(playreloader.scala:304) ~[na:na] @ play.playreloader$$anon$1$$anonfun$reload$2$$anonfun$apply$14$$anonfun$apply$16.apply(playreloader.scala:304) ~[na:na] how should let play compile code java 8 when 'play "run 8080"' ? why play isn't able access class in java 8 project ? fyi: java_home pointing java 8. here how build.sbt looks like. note 'content-aggregator' local artifact installed in local maven repo. name := "web" version := "1.0-snapshot" resolvers += "maven central" @ "http://repo1.maven.org/maven2" librarydependencies ++= seq( javajdbc, j...

android - How to make TranslateAnimation smooth? -

there's scanner line in captureactivity. want add translateanimation , let line move top of "hot area" bottom, it's not smooth @ all. don't know why? here's code snippet framelayout.layoutparams linearparams = new framelayout.layoutparams(framelayout.layoutparams.wrap_content,framelayout.layoutparams.wrap_content); linearparams.width = width; mimageview.setlayoutparams(linearparams); mimageview.invalidate(); mimageview.setvisibility(view.visible); mtranslateanimation.setduration(3000); mtranslateanimation.setrepeatcount(animation.infinite); mimageview.startanimation(mtranslateanimation); any ideas?