Posts

Android : Adding custom view to child of ScrollView -

i having problem scrollview when try add custom view child(relativelayout) of scrollview. it works correctly when remove scrollview. here's xml file <scrollview android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:id="@+id/scrollview"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/relativelayout" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignright="@+id/relativelayout" android:layout_alignend="@+id/relativelayout" android:id="@+id/rlselectable"> <view android:layout_width="match_parent" android:layout_he...

javascript - Click on item to change background image of another -

trying use javascript create "button" of sorts using hovers on li items change background of li item (phonechange). items surround image of phone screenshots i'd change when hovering on related li item. i've been looking similar example here , haven't been able find works me. <ol class="list-b"> <li class="firstphone"><span class="title">first box</span> lorem ipsum sit dolor.</li> <li class="secondphone"><span class="title">second box</span> lorem ipsum sit dolor.</li> <li class="thirdphone"><span class="title">third box</span> lorem ipsum sit dolor.</li> <li class="fourthphone"><span class="title">fourth box</span> lorem ipsum sit dolor.</li> <li class="fifthphone"><span class="title">fifth box</span> lorem ipsum sit dolor.</li...

spring mvc view not rendered -

i'm beginner in spring mvc , trying create basic web app flow. have result.jsp clicking on submit should render submit.jsp . can see controller invoked view submit.jsp not being rendered. gives me http 404 status error no logs in tomcat. can please me figure out went wrong here. i observe when running app, being directed to testspring/ see result.jsp. rather expected be testspring/result.jsp on running app. please pardon ignorance. web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>testspring</display-name> <servlet> <servl...

Microsoft word any way to select from cursor to the end of file? -

i need delete cursor down end of doc. way? far can delete use cursor move down till end. big file. , takes long bottom. tried ctrl-end. not work. i think might help, try shift + ctrl + end

Unzip Code PHP error -

i have these lines of code upload unzip file. can upload file, cannot unzip it. doing in localhost in meantime. appreciated. thanks. have folders zipfiles , unzipfiles . //upload file if(isset($_post['submit'])){ $file_path = "zipfiles/"; $name = $_files['uploaded_file']['name']; $temp_name = $_files['uploaded_file']['tmp_name']; $file_path = $file_path . basename($name); $files = pathinfo($file_path,pathinfo_extension); $file_type = $_files['uploaded_file']['type']; $today = date("y-n-j"); if(move_uploaded_file($temp_name, $file_path)) { echo "success"; $zip = new ziparchive(); $x = $zip->open($file_path); if ($x === true) { $zip->extractto("unzipfiles/"); $zip->close(); } } else{ echo "fail"; } } i tested code , wor...

java - save working but persist not working in hibernate 4.1.1 -

i trying save data usign hsqldb , using hibernate 4.1.4.final. problem want save data using persist when tried it's showing following error: org.hibernate.persistentobjectexception: detached entity passed persist: main.java.entity.advocate @ org.hibernate.event.internal.defaultpersisteventlistener.onpersist(defaultpersisteventlistener.java:141) @ org.hibernate.internal.sessionimpl.firepersist(sessionimpl.java:835) @ org.hibernate.internal.sessionimpl.persist(sessionimpl.java:828) @ org.hibernate.engine.spi.cascadingaction$7.cascade(cascadingaction.java:315) @ org.hibernate.engine.internal.cascade.cascadetoone(cascade.java:380) @ org.hibernate.engine.internal.cascade.cascadeassociation(cascade.java:323) @ org.hibernate.engine.internal.cascade.cascadeproperty(cascade.java:208) @ org.hibernate.engine.internal.cascade.cascade(cascade.java:165) @ org.hibernate.event.internal.abstractsaveeventlistener.cascadebeforesave(abstractsaveeventlistener.j...

haskell - How do I create an arbitrary instance for a recursive datatype? -

i think creates arbitrary lists of length three, how create lists of arbitrary length? import test.quickcheck data list = nil | cons (list a) deriving (eq, show) instance arbitrary => arbitrary (list a) arbitrary = <- arbitrary a' <- arbitrary a'' <- arbitrary return $ (cons (cons a' (cons a'' (nil)))) with sized . enables manage size of generated arbitrary , although semantics instance: instance arbitrary => arbitrary (list a) arbitrary = sized go go 0 = pure nil go n = xs <- go (n - 1) x <- arbitrary return (cons x xs) for comparison, here [] 's arbitrary instance : instance arbitrary => arbitrary [a] arbitrary = sized $ \n -> k <- choose (0,n) sequence [ arbitrary | _ <- [1..k] ]