Posts

javascript - jQuery: Remove a function call -

i have function plugin looking … $('.parallax-sections').parallax(); i want function responsing in onresize event , applied window larger 700px. $(window).on("resize", function (e) { if ($(window).width() < 700) { // remove or disable function again ??? //$('.parallax-sections').parallax(); } else { $('.parallax-sections').parallax(); } }); you can disable , enable it. $('.parallax-sections').parallax(); $(window).on("resize", function(e) { if ($(window).width() < 700) { $('.parallax-sections').parallax('disable'); } else { $('.parallax-sections').parallax('enable'); } }); docs

java - Log4j nosql appender Failed to authenticate against MongoDB server -

i'm trying use apache log4j nosql appender . i've configured connect mongodb instance, seem getting authentication error when running project maven install: error failed authenticate against mongodb server. unknown error. i using mongodb 3.0.4 , have created following user with: use test db.createuser({ user:"loguser", pwd:"pwd", roles:["readwrite","dbadmin"] }) and checked can connect using: mongo -u loguser -p pwd my log4j2.xml: <?xml version="1.0" encoding="utf-8"?> <configuration status="debug"> <appenders> <nosql name="databaseappender"> <mongodb databasename="test" collectionname="logging" server = "localhost" port="27017" username = "loguser" password = "pwd"/> </nosql> </appenders> <loggers> <r...

database - insert statement show 1 row created but data is not insert (script) -

Image
i using run sql command line insert data, script ask below. insert usermaster (userid,userpwd,username,userposition,useraccessrights,userstatus,createuserid) values ('admin','nvzfj0sojj/efu700exl6a==','admin','administrator','non-administrator','1', 'admin'); but when open database using toad , log in user , see, data not insert table. may know place goes wrong? image below output in sql command. what commit. autocommit on? or add 'commit' after insert statement

java - Querying CLOB column with hibernate criteria -

i have table like table name: items columns : name type id number status varchar2 data clob i have hibernate mapping below @entity @table(name="items", uniqueconstraints = {@uniqueconstraint(columnnames={"id"})}) public class hitem implements serializable { private long id; private string status; private string datajson; @column(name = "id") public long getid() { return id; } @column(name = "status") public string getstatus() { return status; } @column(name = "data") public string getdatajson() { return datajson; } } and querying data using criteria follows list<hitem> items = helper.getsession().createcriteria(hitem.class) .add(restrictions.eq("status", "a")).list(); since have more 1200 matching records in table, throwing jdbc batch update error. suspect due large number...

java - How to upload files to server using JSP/Servlet? -

how can upload files server using jsp/servlet? tried this: <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /> <input type="submit" /> </form> however, file name, not file content. when add enctype="multipart/form-data" <form> , request.getparameter() returns null . during research stumbled upon apache common fileupload . tried this: fileitemfactory factory = new diskfileitemfactory(); servletfileupload upload = new servletfileupload(factory); list items = upload.parserequest(request); // line died. unfortunately, servlet threw exception without clear message , cause. here stacktrace: severe: servlet.service() servlet uploadservlet threw exception javax.servlet.servletexception: servlet execution threw exception @ org.apache.catalina.core.applicationfilterchain.internaldofilter(...

javascript - PHP - Show special characters -

snippet allow user input //fetch user input , pass in url alertify.prompt("please enter note/remarks form (optional):", function (e,value) { if (e) { alertify.success("form has been submitted"); $.post(site_url+"somecontroller/someaction",$("#frm_submit").serialize()+ "&user_id="+user_id+"&comment="+value, function( data ) { }); }else{ alertify.error("your form not submitted"); } }); user input: my project google r&d every googler when form post input not complete , shows below echo $_post['comment'] prints my project google r here if user inputs special characters & in comment, breaks input tried using htmlentities($_post['comment']) , htmlspecialchars($_post['comment'], ent_quotes, 'utf-8') not working. how allow user input special characters ? p.s : not s...

Access to a ressource in Android application -

i have tried use gpuimage android. issue not related gpuimage happens @ moment. i'm trying build image filter using image overlay on original image. gpuimagecolordodgeblendfilter tmp = new gpuimagecolordodgeblendfilter(); tmp.setbitmap(bitmapfactory.decoderesource(context.getresources(), r.drawable.hipster)); my issue need access file called hipster.png located in res/drawable/hipster.png i avoid using decoderesource because image same , i'm want avoid using context filter class builtin inside lib aar , reuse in app. any idea ? i have tried use context coming activity it's crashing , think context useless in case thanks hi seb tell how it. difference use context, pass parameter in parts of code , don't have problem. getresources().getidentifier(<nameofimage>, "drawable", getpackagename()) hope helps!