Posts

Showing posts from March, 2015

multithreading - Java - is volatile required with synchronized? -

in following simple scenario: class { int x; object lock; ... public void method(){ synchronized(lock){ // modify/read x , act upon value } } } does x need volatile? know synchronized guarantees atomicity, not sure visibility though... lock -> modify -> unlock -> lock guarantee, after second lock value of x "fresh"? no not, synchronised has memory barrier inserted after it, threads see update current thread performs, taking account other threads synchronise on same lock. volatile, synchronised has memory barriers attached - depending on cpu store/load/full barrier ensures update 1 thread visible other(s). i assume performed cpu cache invalidation . edit i've read, store buffers flushed cpu cache, , how visibility achieved.

add library from Git to Android Studio -

i know must pretty basic question, i'm new android studio , gradle , , can't find up-to-date info on this. i'm trying add library project: android-segmented-control . it doesn't can add build.gradle file (correct?). i'd way, of course, , not download project if possible. if need download project, how link existing project? again, haven't been able find current describes process android studio 0.5.3 thanks @thomas bouron hint ! have pushed library maven center, need add following dependency build.gradle . dependencies { compile 'info.hoang8f:android-segmented:1.0.0' } (a little late @workinafishbowl may helpful others.).

Grails: Data is updated when try to sort a list -

i have been facing situation following code block has been behaving in strange manner. in following code snippet, when trying sort activity list of case work flow in taglib, perform db update instead of sorting data out. updates version of workflow row. can please suggest me missing anything? quick highly appreciated. taglib: class caseformtaglib { static namespace = 'caseform' def caseform = { attr, body -> def caseworkflow = caseworkflow.read(attr.workflowid) //line causing issue def activitylist = caseworkflow?.sortedactivitylist } } domain: class caseworkflow { list caseactivitylist static hasmany = [caseactivitylist: caseactivity] @transient def getsortedactivitylist(){ collections.sort(this.caseactivitylist) return this.caseactivitylist } } class caseactivity implements comparable { /** * activity id */ integer activityid...

multithreading - Writing a game loop for an ncurses game? -

i writing game ncurses , having trouble game loop. have read these 2 pages - this one , , this one several others linked via so, , can understand them (or @ least, can understand talking about, if not how solution works). problem have ncurses, sprites move 1 character step @ time, there no interpolation or integration, sprite.x=sprite.x+1 . tried using pthread , nanosleep , bad guy sprites move nicely player movement sluggish , unresponsive/unreactive. tried using 2 threads , having key input on 1 , game loop on thread key thread didn't @ all. so,how write smooth game loop ncurses? the main problem key presses (not key releases) can detected running in vt100 style terminal emulator (as ncurses does). little akward games. either player has press keys repeatedly move (or wait until key autorepeats if keybord driver configured so). or can make game player presses key once begin move , presses key again (or key perhaps) stop (like in old sierra adventure games). you...

version control - Xcode 5 with JGit repository -

Image
how can use xcode jgit repository instead of git repository? checkout dialog offers types “git” , “subversion”. if try open jgit repository traditional git type, error message says “fatal: unable find remote helper“. xcode doesn't directly support repo stored on s3 (it's unique jgit). that said, should able access repo there using combination of fuse os x , s3fs . need install fuse (which allows use of filesystems userland) , s3fs (to mount s3 bucket) , mount bucket containing repo somewhere on local filesystem. once that's done, you'll able reference using local filesystem mountpoint.

ruby - Image_tag in rails -

i've written this: <div id="table_01"> <div id="saveonshirts-website-homepage-01"> <image_tag("saveonshirts_website_homepage_01.png")> </div> <div id="saveonshirts-website-homepage-02"> <image_tag("saveonshirts_website_homepage_02.png")> </div> <div id="saveonshirts-website-homepage-03"> <image_tag("saveonshirts_website_homepage_03.png")> </div> images in images folder under assets folder. however, images still not showing in localhost. thoughts? thanks in advance! elton i'm assuming using erb , if need using erb scriptlet tags <%= ... %> example: <%= image_tag("saveonshirts_website_homepage_01.png") %> reference documentation: layouts , rendering in rails .

How to creating function with given code in C++? -

giving function creatcustomer() create customer. prototype: customer*creatcustomer(const string&name, const string&id, const string&pin) and given code below.the structure done myself. the question how create function using given code , prototype. #include <iostream> #include <iomanip> #include <string> using namespace std; struct customer { string customername; string userid; string pin; }; int main() { customer* mary = createcustomer("mary jones", "235718", "5074"); customer* john = createcustomer("john smith", "375864", "3251"); } first of in case don't need function, can do: customer mary { "mary jones", "235718", "5074" }; customer john { "john smith", "375864", "3251" }; but if need to, should use constructor: struct customer { std::string customername; std::string userid; std::string pin;...

ajax - Manually sending a post in PHP -

i have form validated client side before being submitted via ajax request server server-side validation. should validation fail server side postback need made containing error messages. there way can this? for example: if ((!empty($nameerror) && (!empty($emailerror)) { $_post['nameerror'] = $nameerror; $_post['emailerror'] = $emailerror; // send postback values } else { echo 'no errors'; } update ------------------------------------------------ here javascript handles submission of form: $(".button").click(function() { $(".error").hide(); var name = $(":input.name").val(); if ((name == "") || (name.length < 4)){ $("label#nameerr").show(); $(":input.name").focus(); return false; } var email = $(":input.email").val(); if (email == ...

java - Trying to install eclipse Bytecode Outline plugin, missing dependency -

i'm trying install this: http://asm.ow2.org/eclipse/index.html , error makes 0 sense me. i'm running eclipse kepler service release 1, build id 20130919-0819. cannot complete install because 1 or more required items not found. software being installed: bytecode outline 2.1.0 (de.loskutov.bytecodeoutline.feature.feature.group 2.1.0) missing requirement: bytecode outline 2.1.0 (de.loskutov.bytecodeoutline.feature.feature.group 2.1.0) requires 'org.eclipse.help.appserver 0.0.0' not found after eclipse 3.3 "org.eclipse.help.appserver" removed. see: eclipse:help-appserver description: bundle provided implementation of tomcat-based web server application eclipse system. replaced in eclipse 3.3 jetty-based application server. bundle defines no api , has been unused in eclipse platform many releases.

javascript - Dashed border with border-image -

Image
i have 3 overlaying layer 2 background image , 11 or content. in content placed input button tag dashed boarder. what trying achieve same background layer image layer 1 on dashes. obvious background:transparent isn't working second choice used input boarder , tried mock behavior setting boarder-image background image layer 1. .button { font-family:verdana, sans-serif; font-size: 20px; font-weight: bold; background: transparent; border-width:5px; border-style:dashed; border-color: black; } so dashes around submit button should have same background first layer on left i changed to: .button { font-family:verdana, sans-serif; font-size: 20px; font-weight: bold; background: transparent; border-width:5px; border-style:dashed; border-color: black; border-image: url(/img/bg1.jpg); } i don't have idea how achieve dashed boarder-image with: border-image: url(/img/bg1.jpg) 30 30 round; http://jsfiddle.net/6vkdh/3/ css border-image syntax this: borde...

javascript - $scope.$watch ... make it return a function on another scope? -

i have watch function returns value 2 series of data in highcharts. example below shows how work within controller: $scope.$watch("trendcompany",function(){ return $scope.chartconfig.series[0].data = [-1.95,0.99,9.29,4.49,-1.50,-4.05,-7.05,10.13,-19.95, 2.99,-14.55,-6.15,-20.25,-27.00,-26.10,-10.95,-10.95,5.30, 6.06,11.12,10.13,11.96,22.13,6.74,4.67,1.43,0.27,4.20,-3.45, 2.10,-1.65,1.92,1.85,0.00,1.97,-5.25,-3.30,1.67,3.87,6.27,1.89, 2.27,0.59,-1.20,-5.85,-6.60,-2.25,-2.40,-2.85,-3.45,-0.15,2.63], $scope.chartconfig.series[1].data = [1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2]; }); $scope.chartconfig = { options: { chart: { type: 'line' } }, series: [{ data: [] },{ data: [] }], title: { text: 'hello' }, loading: false } my questi...

solr search php html front-end -

i got solr working of many of stackoverflow's questions , solr has mysql data (multiple tables). returns results browser (multiple facets). making selections via url bar works aswell. i'm @ fase want php code generate corresponding urls filter options. @ later stage want able select multiple option (eg red , blue) via checkboxes, requere javascript assume. needs append selected "filter" url. preferably sent request instead of form / post request performance reasons , have (link or button) clear selection. there special frontend or done somewhere in solr? there not lot of information or examples on this, @ least not it. the setup is: client > webserver > php > php pecl solr > solr > php > html > client any pointers? regards you should read solr userguide if needed, pecl install solr have solr client, use solrclient, solrquery , other classes needed all of them documented here: http://docs.php.net/manual/en/book.solr.php ...

excel - Subscript out of range for If function in VBA -

i'm doing payroll application , keep getting message when trying if function vba script. its first line of if statement giving me hard time. sub payperiod() if sheets("sheet30").range("e17") = "1" 'error here sheets("week 1").select elseif sheets("sheet30").range("e17") = "2" sheets("week 2").select elseif sheets("sheet30").range("e17") = "3" sheets("week 3").select elseif sheets("sheet30").range("e17") = "4" end if end sub try using variables , declare them properly. need qualify sheet location. declare variables @ top, assign them desired values once , use variable in code. way, if sheet names or cell references change, can adjust macro in 1 place. (i've left .select statement in example, note hardly ever need select elements work them. option explicit sub payp...

Why the error "the value for the useBean class attribute action.TestBean is invalid " occours when accessing localhost:8080\main.jsp -

i know question has been asked solutions provided in post not of me . have testbean class inside package named action .it have public constructor . web-inf/classes/action has testbean compiled class. have main.jsp file in root folder of webapps in tomcat root folder .i have set class path of "web-inf/classes/action" in class-path variable. here link referring . the value usebean class attribute ... invalid here codes testbean.java /* file: testbean.java */ package action; public class testbean { private string message = "no message specified"; public testbean() { } public string getmessage() { return(message); } public void setmessage(string message) { this.message = message; } } main.jsp <html> <head> <title>using javabeans in jsp</title> </head> <body> <center> <h2>using javabeans in jsp</h2> <jsp:usebean id='test' > <jsp:attribute na...

crontab - Cron Job - How to send an output file to an email -

i have line in crontab: * * * * * /var/www/dir/sh/mysql_dumb.sh | mail -s "mysql_dump" example@mail.com (every minute sample) so, works fine, email empty. update: the output mysql_dumb.sh *.sql file , save file in directory. how can send copy (*.sql file) output -> mysql_dumb.sh email? mysql_dumb.sh: #!/bin/bash path=/usr/bin:/bin shell=/bin/bash /usr/bin/mysqldump -u user -ppass database > /var/www/dir/backup/backup_db_`date +%d_%m_%y`.sql if script reporting errors, may going stderr , you're redirecting stdout . can redirect stderr adding 2>&1 command: * * * * * /var/www/dir/sh/mysql_dump.sh 2>&1 | mail -s "mysql_dump" example@mail.example

sql - SELECT based on Multi result condition -

i trying execute following sql statement in postgresql 9.2 fails error: select "trainingname" "hsetrainingname" "id" = select "trainingid" "hsegroupedtraining" "groupid" =3 the second select statement returns more 1 value. how solve it? you can use in construction: select "trainingname" "hsetrainingname" "id" in (select "trainingid" "hsegroupedtraining" "groupid" = 3)

javascript - option in select box is checked but not show the value -

update solution: var selectclass = $("#class"); $("#class").val(classdeadline); selectclass.selectmenu("refresh"); i have select box in html page <select id="class" class="ui-selectmenu" > </select> this code classes db , append select box: function getclasses(tx){ //alert('classes'); var sql = "select * classes"; tx.executesql(sql, [] , getclasses_success); } function getclasses_success(tx, results){ var len = results.rows.length; //alert('len: ' + len); //var s = ""; (var i=0; i<len; i++){ var classdb = results.rows.item(i); $('#class').append('<option value="'+ classdb.name + '">'+ classdb.name +'</option>'); } ////alert('before append'); } the options of select box retrieved database. can make of options normally. however, have javascript function retrieve class database ...

mac address - Print the MAC addresses from the mac header of IEEE802.11 packet when extracted using sk_buff -

i writing module extracts mac address of ethernet mac header of wireless 802.11 packet. extract ethernetmac header ieee = (struct ieee80211_hdr *)skb_mac_header(sock_buff); ieee->addr1[eth_alen]; ieee->addr2[eth_alen]; ieee->addr3[eth_alen]; i want print these addresses see values contains. how do using printk , kern_info currently using statement causes kernel in panic mode printk(kern_info "the address %x:%x:%x:%x:%x:%x", ieee->addr1[0],ieee->addr1[1],ieee->addr1[2],ieee->addr1[3],ieee->addr1[4],ieee->addr1[5]); hm, according this , addr1 u8 addr1[eth_len], so: printk("mac %pm: \n", ieee->addr1);

Getting template syntax error while trying to parse a dictionary in my template in django -

Image
ok here code of view. def customers_to_be_called(request): customers = customer.objects.filter(call=true) list_of_customers = [] cust in customers: jobs = job.objects.filter(customer = cust) customer_date = {} customer_data['customer'] = cust customer_date['jobs'] = jobs list_of_customers.append(customer_data) return render(request, 'repairs/customers_to_be_called.html', {'list_of_customers' : list_of_customers, }) and here template gonna rendered <div> {% customer in list_of_customers %} <h2> {{customer['customer'].name}} </h2> <ul> {% job in customer['jobs'] %} <li> {{job.product}} </li> {% endfor %} </ul> {% endfor %} </div> but when send request page following error. i don't know why isn't parsing customer in template while there data in it..?? to refer dict ...

php - CodeIgniter/MySQL - select, where not equal to and like twice -

i having problems returning correct records when using following active record query in codeigniter: $q = $this->db->query("select fname, lname, userid user userid !='$user_id' , fname '%$search_criteria%' or lname '%$search_criteria%'"); the query searches users table based on $search_criteria . $user_id id of logged in user don't appear in search results. if search logged in users first name doesn't return logged in user in search results, return logged in user if search last name, don't understand why... there flaw in logic, want check user id, , check either first name or last name... did here userid , fname or lname. parens separate criteria, allowing either fname or lname id $q = $this->db->query("select fname, lname, userid user userid !='$user_id...

Displaying images from Google Sheets as a table in a web site -

i've created google spreadsheet logo images in 1 column of cells, when try create table add website images not display in table. i need them display logos visible within webpage? know why images not displaying in table format, or how can fix this. not sure method did choose display images. solution worked images embedded image function , not showing inside new spreadsheets, showing inside old. must admit haven't tested embedded documents should work too: space character offending character in new google spreadsheets when embedding images using image function. replace another, 'safe' character '-' or '_'

parsing - <|> in Parsec - why do these examples behave differently? -

i think i'm misunderstanding <|> in parsec - have input stream contains either bunch of a s in 1 representation or bunch of a s in representation. expect following functions equivalent (given input form said, , have verified is): foo = ... a1s <- many $ try $ a1 a2s <- many $ try $ a2 return $ a1s ++ a2s versus foo = ... <- (many $ try $ a1) <|> (many $ try $ a2) return what going wrong? first function works on input, second function fails, saying unexpected a2, expecting a1. when give sequence of a2 latter parser, first many matches , returns empty list, doesn't try match against second many . you can use many1 instead. foo = ... <- many1 a1 <|> many a2 return in case, many1 fails when give sequence of a2, , many matches against input.

processing.js - how to store an object in a variable in processing -

i'm coming jquery , js , go little bit processing . because has quite reference examples etc. 1 thing can't how can store objects variable. example jquery: var anydiv = $('#anydiv'); and have object stored. in processing not seem simple because has different types. can store number pretty easy: float anynumber = 10; or string etc. how can e.g. store new point in var? var anypoint = point(0, 0); thanks in advance. objects need have classes. processing comes predefined, "point" isn't 1 of them. write point class, class point { float x, y; point(float _x, float y) { x = _x; y = _y; } string tostring() { return x + "/" + y; } } and can store other typed object: point p = new point(0,0); float xcoordinate = p.x; float ycoordinate = p.y; p.x += 200; p.y += 100; println(p); and no, capital first letter not required, that's convention. stick (don't go defining classes "point", unless ...

php - Disable delete button if record exist in multiple table -

i have here mysql records display in html table delete button. need disable delete button if record exist in both database table. how can disable delete button per row if record exist in both table? appreciate. $search = $mysqli1->real_escape_string($_post['bid']); $search = preg_replace("/[^a-za-z0-9 ]/", '', $search); $search = $_post['bid']; $res = $mysqli1->query("select * code item '%$search%' or item_code '%$search%' or cat_code '%$search%' order item_code asc"); while($r = $res->fetch_assoc()){ echo "<tr> <td><a href='#' id='".$r['id']."' class='del'><img src='../images/del.png'></a></td> </tr>"; } throw in simple if() statement connected both queries in pdo use ->rowcount() not sure in mysqli so logic you'd need query1 = counted rows in table1 query2 = counted rows in tab...

objective c - Predicating Nested Array -

doing project on addressbook kind of app. need predicate address book contacts, result looks this ( { addresskey = ( ); email = ( ); "jobtitle_name" = ""; "organisation_name" = ""; phone = ( { phonenumber = "+919502266633"; "phone_type" = home; }, { phonenumber = 9703570333; "phone_type" = work; }, { phonenumber = 91234512345; "phone_type" = iphone; }, { phonenumber = 91239123; "phone_type" = mobile; } ); "first_name" = raviraja; imagekey = ""; "last_name" = ""; serialnumberkey = 53; source = device; } ) need predicate array using phonenumber key. tried one nspredicate *predicate = [nspredicate predicatewithformat:@"any %k == %@",@"phonenumber",[nsstring stringwithformat:@"%@...

c# generic function - an extension of another generic -

here's typical example of generic method in c#: parseobject po; int = po.get<int>("somefield"); string s = po.get<string>("anotherfield"); i want write extension work ... int = po.exampleget<int>("somefield"); string = po.exampleget<string>("anotherfield"); so, (a) extension exampleget have able accept < class > in same way parseobject.get does, and (b) extension exampleget have able call parseobject.get (as doing other work). what's syntax such n extension, uses generic in way ? possibly looking extension methods : static public class extensions { static t exampleget<t>(this parseobject po, string name) { return po.get<t>(name); } }

bash - Replacing a string with a given text using Linux shell script -

i have file named testfile.it contains information like methun:x:500:500:comment:/home/methun:bin/bash salahuddin:x:501:500:comment:/home/methun:bin/bash now implemented following shell program: echo "enter name:" read username users='cat /mypractice/myfiles/testfile | awk -f ':' '{print $1}'' user in $users if [ "$user" == "$username" ]; echo "name found , enter new name change." read newusername #need code change text on file --->testfile fi done now suppose need change methun moin. comment newcomment. used sed -i 's/"$user"/"$newuser"/g' /mypractice/myfiles/testfile but not working here. test in testfile singly change , replace all.but need change position want . i tried usermod not works here.. can give me solution or correct code...thanks you using g flag in sed command means global substitution (will ...

android - FB friends list who have already authenticated the same application -

i working facebook graph api: i need list of friends have authenticated application. first question: possible? and if yes please guide me should start searching it. i have gone through similar question , none suits in case. please help! thank you. facebook api provides boolean field can filter user's friends application installed. need make request user's friends list , set required fields include "installed" boolean. following code snippet may out. private void requestmyappfacebookfriendswithappinstalled(session session) { request friendsrequest = createrequest(session); friendsrequest.setcallback(new request.callback() { @override public void oncompleted(response response) { //setuplist list<graphuser> friends = getresults(response); graphuser user; friendslist=new arraylist<act_friendslistpicker.fb_...

Center Navigation in Wordpress Theme 'adamos' -

i can't seem figure out i'm doing wrong center navigation on desktop view. i've used existing wordpress theme called 'adamos', noticed top menu wasn't in center, i'm having trouble fixing it. if tell me i'm overlooking or doing wrong, great! :) you can check website here ! thanks! use inline-block on navigation instead of float:left.

java - Exception in Native part of openejb -

i start new topic problem, mentioned wrong things in older one. i'm using openejb writing integration tests beans using jpa. i've exception in native calls done jpa: info - creating subclass , redefining methods "[class contextkey, class contextentity]". means application less efficient if ran openjpa enhancer. severe - ejbtransactionutil.handlesystemexception: null <openjpa-2.3.0-nonfinal-1540826-r422266:1542644 fatal general error> org.apache.openjpa.persistence.persistenceexception: null @ org.apache.openjpa.enhance.classredefiner.redefineclasses(classredefiner.java:96) @ org.apache.openjpa.enhance.managedclasssubclasser.prepareunenhancedclasses(managedclasssubclasser.java:176) @ org.apache.openjpa.kernel.abstractbrokerfactory.loadpersistenttypes(abstractbrokerfactory.java:312) @ org.apache.openjpa.kernel.abstractbrokerfactory.initializebroker(abstractbrokerfactory.java:236) @ org.apache.openjpa.kernel.abstractbrokerfactory.newbrok...

regular language pumping lemma for string with even 0's -

find whether string number of zeros a) context free b)regular a) using pumping lemma cfl....it can represented e(0 n )e(0 n )e. , it's cfl. b) can represented (00)* in regex. so, think it's regular language. but, not able prove same using pumping lemma regular languages any appreciated. thanks!!

MongoDB c# Driver - Perform a LINQ "Any" in a Serialized Dictionary -

i have document type attributes, 1 of dictionary< string, string >. serialization , de-serealization seem work fine (i can search, perform crud operations, etc.). problem i'm trying write method find objects of type dictionary contains specific value (id) among keys. attempted query: var objectcollection = db.getcollection<myclass>("myclass"); var query = query<myclass>.where(m => m.mydictionary.any(k => k.key == id)); the class: public class myclass { public objectid id { get; set; } // ... [bsonelement("dictionary")] public dictionary<string, string> mydictionary { get; set; } } ...but exception while building query: any requires serializer specified dictionary support items implementing mongodb.bson.serialization.ibsonarrayserializer , returning non-null result. mongodb.bson.serialization.serializers.dictionaryserializer`2[system.string,system.string] current serializer. i suspect problem...

Unable to open PerfmonCfg file with counters added to it in Qt -

i created perfmoncfg file counters. when open *.perfmoncfg file qt using qprocess::startdetached or qdesktopservices::openurl, opening performance counter no counters added it. when open *.perfmoncfg directly(through explorer), opens counters(which added while creating *.perfmoncfg file).

Generate special list from file in python -

i have file : one:two:three four:five:six seven:height:nine and on... want parse correctly obtain kind of variable: myvar = [("one", "two", "three"), ("four", "five", "six"), ("seven", "height", "nine")] of course, file isn't stopping @ nine, there's lot more of lines after that. how can in python ? thanks ! use list compehension: with open('filename') f: myvar = [line.rstrip().split(':') line in f] if need list tuples pass line.rstrip().split(':') tuple() : tuple(line.rstrip().split(':'))

Session in php. It's not redirecting to the login page when a user wrongly inputs his information in the form -

when user correctly inserts information in login form redirects home page want i'm having problem when user inputs wrong info. shows connected , database selected. stops on page checklogin.php. if doesn't read session part. please go through code. here's code register form: <?php $con=mysql_connect("localhost","root",""); if(!$con){ die('could not connect:' .mysql_error()); } echo "connected successfully."; $database=mysql_select_db('90210store'); if(!$database){ die('<br>could not select database:' .mysql_error()); } echo "<br>database selected"; $firstname=$_post['firstname']; //to information written in form $lastname=$_post['lastname']; $emailadd=$_post['emailadd']; $check_list=$_post['check_list']; $dob=$_post['dob']; $gender=$_post['gender']; $password=$_post['password']; $first= "insert login (firstname,las...

ruby on rails 4 - Dynamically create attr_accessor? -

i implementing advanced search form in fields added dynamically. have product belongs_to pharmacy belongs_to network . i want user able add more networks form example if wants search products 2 different networks . any tips on how dynamically create field? in mind should implement sort of attr_accessor created user press + in view. don't think possible. thanks suggestions! you should never create accessors based on user input . instead add in form array-like fields (i.e. field[] ) or hash-like (i.e. field[1] )

Animated GIF is not working on Google Maps Groundoverlay in Android 4.2.1 -

i have problem android phone running 4.2.1 os. animated gif not working on it's google maps, i'm using lenovo p780 , gif not working on it. tried phone huawei running android 4.2.1 os too, , it's not working also. tried android phones different os , animated gif worked on it. problem then? bug android os or what?

jquery - Float div on top of div that has scroll-y -

so want div scroll when user scrolls div (notice div) down. here's html: <body> <div class="container"> <div class="floaty">yep</div> content </div> so container 700px height (dynamic height depending on content inside) has set in css scroll y , x. when srolling content don't scroll whole page. floaty thing keeps still top of div though has position fixed. believe it's because browser looks page not scrolling doesn't move it. container has position relative set. how can make scroll? jquery way? here try: .container{ height:200px; border:1px solid red; margin-top:50px; width:100%; overflow-y:scroll; } .floaty{ position:fixed; width:100%; height:50px; border:1px solid green; top:0px; } i not sure final result expect, if not -please,clarify. demo here

asp.net mvc - fluent validation validating a list of generated text boxes -

i have set of textboxes on form generated in foeach so: view: @for (int = 0; < model.transomelist.count; i++) { itemdrops tranitem = model.transomelist.elementat(i); <div class="form-group"> @html.label(tranitem.itemname.tostring(), new { @class = "col-sm-6 control-label" }) <div class="col-sm-6"> @html.textboxfor(x => x.transomelist[i].itempossinfo, new { @class = "form-control" }) @html.hiddenfor(x => x.transomelist[i].itemname) </div> </div> } i'm using fluent validation , want make sure each text box required (ideally stating text box in error message) in validator cl...

java - A method from struts2 action class is not executing -

i'm porting webapp struts 2.0 2.3. cannot make dynamicmethodinvocation work. have action class add() method. submitting form on register!add.shtml not execute method. cannot find reason this. here jars use: struts2-core-2.3.16.jar xwork-core-2.3.16.jar struts2-spring-plugin-2.3.16.jar here's part struts.xml <?xml version="1.0" encoding="utf-8" ?> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.3//en" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.objectfactory" value="spring"/> <constant name="struts.devmode" value="true"/> <constant name="struts.url.includeparams" value="none" /> <constant name="struts.enable.dynamicmethodinvocation" value="true"/> <constant name="struts.action.extension"...

Rails - tinymce-rails-imageupload configuration -

i'm using rails 4 , tinymce 4 , gem tinymce-rails-imageupload i've gotten gem installed little trouble follows: config/tinymce.yml theme: "modern" toolbar1: bold italic | link uploadimage | undo redo | fontselect | forecolor | code | plugins: - link - uploadimage - textcolor - code the problem when try upload image computer message: bad response server and server logs say: actioncontroller::routingerror (no route matches [post] "/tinymce_assets") is there way around without creating new controller/table tinymce? don't need store images. if not, point me towards tutorial setting controller? there's example on gems readme knowledge of ror not strong enough me figure out how pass in required information myself. generally, there little way around issue. not need create new "table" in database tinymce, either need new controller create action or latch on action on existing controller, bit messy. here...

How to get URL-encoded page title in MediaWiki PHP extension -

im developing mediawiki skin im beginner php, , 1 of element use article url-encoded title element id or class styles purpose. try example: this example not working. assuming within execute function of skin, ca access title object this: $title = $this->data['skin']->gettitle(); then can url enocoded title this: $urlencodedtitle = $title->getpartialurl(); if in initpage function, use $title = $this->gettitle();

poker - How can I make my PokerHand class randomly deal a thousand hands? -

public class pokerhand { // arraylist cards private arraylist<card> cards; /** * constructor class pokerhand */ public pokerhand() { cards = new arraylist<card>(); // arraylist of cards } /** * add cards list */ public void addcard(card card1, card card2, card card3) { cards.add(card1); cards.add(card2); cards.add(card3); } } this card class public class card() { private int value; private int suit; private static string[] suits = { "hearts", "spades", "diamonds", "clubs" }; private static string[] values = { "ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "jack", "queen", "king" }; public static string valueasstring( int value )...

asp.net - Application pool is being automatically disabled due to a series of failures in the process(es) serving that application pool -

this website hosted shared hosting 'windows server 2012', website stopped working , give me general "service unavailable" error. contacted support said "currently, site working fine. have availed additional application pool memory site. when application memory allocated site reaches maximum limit site stop. in case, need check script/code of vps. have attached logs matter along response." , website going down again , again. also, checked website files , found many files strange name not have idea them!!. please me solve problem. this logs file said: application pool 'sceryemen.com v4.0 (classic)' being automatically disabled due series of failures in process(es) serving application pool. log name: application source: asp.net 4.0.30319.0 date: 4/8/2014 2:22:04 event id: 1309 task category: web event level: warning keywords: classic user: n/a computer: accu17.denver.wehostwebsites.com descri...

android - Is PackageManager.getComponentEnabledSettings() persistent between cold starts? -

if use code below disable static broadcastreceiver defined in androidmanifest.xml, re-enabled after reboot? doesn't appear docs don't whether should. final componentname compname = new componentname(context, mybroadcastreceiver.class); context.getpackagemanager().setcomponentenabledsetting( compname, packagemanager.component_enabled_state_disabled, packagemanager.dont_kill_app); thanks in advance... is packagemanager.getcomponentenabledsettings() persistent between cold starts? yes. reset on application uninstall/reinstall. reset if reset setcomponentenabledsetting() . it'll reset if superuser privileges resets (e.g., device might have manager app controlling action_boot_completed ). , i'm not sure happens on app upgrade, haven't tried scenario. otherwise, should stay persistent. if use code below disable static broadcastreceiver defined in androidmanifest.xml, re-enabled after reboot? no. ...

PHP undeclared variables error -

my code , form: <?php include("includes/connect.php"); $content = "select * content content_page='home'"; $result = mysql_query($content); $row = mysql_fetch_array($result); ?> <form method="post" action="admin_home.php"> headline:</br> <input type="text" name="content_title" value="<?php echo "$row[content_title]" ?>"></br> </br> main content:</br> <textarea type="text" class="txtinput" cols="55" rows="20" name="content_text"><?php echo "$row[content_text]" ?></textarea></br></br> <input type="submit" name="submit" value="save changes"> </form> code want happen when 'submit' button pressed: <?php include("includes/connect.php"); if(isset($_post['submit'])){ $order = "upd...

android - How to reduce image size while taking from gallery through imagepath -

i want take image camera , take gallery part did . when take images 1 activity other through image path show memory out error on taking fourth image ,so want take image gallery , when take image gallery should compressed should not have out of memory error byte allocation. thanks. here code can in this imageview1=(imageview) findviewbyid(r.id.image1); imageview2=(imageview) findviewbyid(r.id.image2); imageview3=(imageview) findviewbyid(r.id.image3); imageview4=(imageview) findviewbyid(r.id.image4); bitmap b = (bitmap) getintent().getparcelableextra("data") ; sharedpreferences preferences = preferencemanager.getdefaultsharedpreferences(this); locationname = preferences.getstring("location", "location"); sharedpreferences preferences1 = preferencemanager.getdefaultsharedpreferences(this); categoryname = preferences1.getstring("categoryname", "categoryname"); sharedpreferences imagepath1 ...