Posts

Showing posts from August, 2013

jsf - Primefaces selectonemenu displaying data outside the input -

Image
this question has answer here: one or more resources has target of 'head' not 'head' component has been defined within view 2 answers i'm new web programming , manage make work proper connections dropdown populate; i'm using eclipse, latest jdk, wildfly 10 server, mysql server 5.7, primefaces 5.3, javax.faces 2.2. this page: <?xml version='1.0' encoding='utf-8'?> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" > <head> <title>combobox</title> </head> &

ios - Using TouchesMoved in Swift 2 -

i'm making spritekit game in xcode using swift. want make custom buttons in menu, , i'm following this tutorial it. everything's working fine except touchesmoved function. override func touchesmoved(touches: nsset, withevent event: uievent) { var touch: uitouch = touches.allobjects[0] uitouch var location: cgpoint = touch.locationinnode(self) if defaultbutton.containspoint(location) { activebutton.hidden = false defaultbutton.hidden = true } else { activebutton.hidden = true defaultbutton.hidden = false } } apparently, " touches.allobjects[0] uitouch " doesn't work anymore in swift 2. i've searched alternatives, haven't found works. how replace line of code? for reason tutorial using nsset rather set<uitouch> in touchesmoved . wonder if translated tutorial objective-c swift, , missed updating them? func touchesmoved(_ touches: set<uitouch>, withevent event: uievent?) touchesmoved - apple docs

sqlalchemy - Alembic default value to be used in add_column -

how alembic use specified default value new column, without making server_default ? only existing rows should receive default value. new rows inserted after should still server_default . i had similar problem, wanted new column not nullable, not work existing rows, of course. created row without not null constraint first, filled column custom python code , altered column (in same migration) have constraint. so you'd iterate on existing objects, set values according transient default.

html - Folder Structure for domain and subdomains -

hi have been learning how design website , went ok tested on localhost , working should have been having trouble functionality when have uploaded files hosting provider arvixe. i've been trying learn how structure website in domain folders can't work out how should organised. i have parent website, , subdomains need go example - parentwebsite.com subdomain1.parentwebsite.com subdomain2.parentwebsite.com subdomain3.parentwebsite.com on locahost test server created websites individually , put them under htdocs folder in xampp. folder structure arvixe hosting lot different - looks this: http://imgur.com/brqsp9w am laying out folders correctly? and if have php scripts website better suited go own folder inside public html? or better suited go directly public html folder? thanks in advance :) your web host using cpanel , has typical directory structure quite different compared local xampp environment. here's how cpanel stores website files. /hom

java - Print out a string of characters from a 2D array into a certain number of rows -

i'm trying make keypad in java takes letters input user, desired number of characters per row. should print characters in desired number of rows, if "abcdefgh" input , desired row number 4 should print: abcd efgh but i'm stuck on how work. public class keypad { char [][] letters; public keypad(string chars, int rowlength) { int counter = 0; (int = 0; i<chars.length(); i++){ counter++; } letters = new char[rowlength][counter/rowlength]; } public string tostring() { string s = " "; (int row=0; row<letters.length; row=row+1) { // on rows (int col=0; col<letters[row].length; col=col+1) { s = s + letters[row][col]; } s = s + "\n"; } return "the keypad is" + s; } the logic of tostring() method looks fine, didn't populate letters array in constructor. need add in constructor: public keypad(string chars, int rowle

PHP to get password-protected REST datasnap information -

i have following code information datasnap server: <?php $username = username $password = password $service_url = 'http://200.206.17.34:81/datasnap/rest/tservermethods1/blogin/'; $curl = curl_init($service_url); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_httpauth, curlauth_any); curl_setopt($curl, curlopt_userpwd, $username . ":" . $password); $curl_response = curl_exec($curl); echo $curl_response; if ($curl_response === false) { $info = curl_getinfo($curl); curl_close($curl); die('error occured during curl exec. additional info: ' . var_export($info)); } curl_close($curl); $decoded = json_decode($curl_response); if (isset($decoded->response->status) && $decoded->response->status == 'error') { die('error occured: ' . $decoded->response->errormessage); } echo 'response ok!';

Why can't I reference the attr `android:popupEnterTransition`? -

starting api 23, default spinner style has android:popupentertransition , android:popupexittransition set: <style name="widget.material.spinner" parent="widget.spinner.dropdown"> [...] <item name="popupentertransition">@transition/popup_window_enter</item> <item name="popupexittransition">@transition/popup_window_exit</item> [...] </style> i'm trying override these in sub-style, won't compile (even though i'm compiling against api 23): <style name="spinner" parent="@android:style/widget.material.spinner"> <item name="android:popupentertransition">@null</item> </style> i'm getting error: no resource found matches given name: attr 'android:popupentertransition' . why not available? it's right there in framework attrs.xml . was left out mistake? can't imagine why intended private.

c++ - Knowing if middle vertex is left or right when sorting a triangle vertices by Y? -

Image
i'm reading chris hecker's texture mapping articles , life of me can't understand how he's using y order of vertices determine if middle vertex on left or right. sorting code: if (y0 < y1) { if (y2 < y0) { top = 2; middle = 0; bottom = 1; middlecompare = 0; bottomcompare = 1; } else { top = 0; if (y1 < y2) { middle = 1; bottom = 2; middlecompare = 1; bottomcompare = 2; } else { middle = 2; bottom = 1; middlecompare = 2; bottomcompare = 1; } } } else { if (y2 < y1) { top = 2; middle = 1; bottom = 0; middlecompare = 1; bottomcompare = 0; } else { top = 1; if (y0 < y2) { middle = 0; bottom = 2;

ios - Swift: accidentally added an outlet to two different files, deleted both outlets -

i accidentally created 2 outlets same ui element and, after realizing issue, went on delete both outlets code , element (a label) attached to. now i'm still getting "the [name of outlet] outlet [view controller] uilabel invalid. outlets cannot connected repeating content." i deleted code created outlet , element select+delete. there other way should have handled , how can fix now? delete outlets may causing problem , control - click on object in storyboard , delete of connections using x. now, go , reconnect outlets , should work! if need help, check this out.

java - libgdx not initialized yet -

i have been coding libgdx application (for desktop only) while , after deciding cleanup code part part iv'e gotten problem cant seem solve myself.. exception: exception in thread "lwjgl application" com.badlogic.gdx.utils.gdxruntimeexception: java.lang.unsatisfiedlinkerror: com.badlogic.gdx.physics.box2d.polygonshape.newpolygonshape()j @ com.badlogic.gdx.backends.lwjgl.lwjglapplication$1.run(lwjglapplication.java:131) caused by: java.lang.unsatisfiedlinkerror: com.badlogic.gdx.physics.box2d.polygonshape.newpolygonshape()j @ com.badlogic.gdx.physics.box2d.polygonshape.newpolygonshape(native method) @ com.badlogic.gdx.physics.box2d.polygonshape.<init>(polygonshape.java:29) @ com.mygdx.game.handler.bodyeditorloader.<init>(bodyeditorloader.java:41) @ com.mygdx.game.util.gameutils.init(gameutils.java:23) @ com.mygdx.game.dungeonlife.create(dungeonlife.java:168) @ com.badlogic.gdx.backends.lwjgl.lwjglapplication.mainloop(lwjglappl

java - Hibernate HttpMessageNotWritableException -

i using hibernate 4.3.5 in spring mvc 4.2.3. have 2 model user , client , id of user foreign key of client . in user class: @repository @transactional public class userdaoimpl implements userdao { @autowired private sessionfactory sessionfactory; protected sessionfactory getsessionfactory() { try { return (sessionfactory) new initialcontext().lookup("sessionfactory"); } catch (exception e) { log.error("could not locate sessionfactory in jndi", e); throw new illegalstateexception("could not locate sessionfactory in jndi"); } } @onetomany(fetch = fetchtype.eager, mappedby = "user") public set<client> getclients() { return this.clients; } ...... } and in client , set: @manytoone(fetch = fetchtype.lazy) @joincolumn(name = "user_id", nullable = false) public user getuser() { return this.user; } the sessionfactory defined in root-context.xml . in way, should able clients

php - how to give proper permission for pcntl_exec? -

i trying fork php script , execute php script using pcntl_exec command, getting following error: pcntl_exec(): error has occured: (errno 13) permission denied i trying following code after normal forking in function: $pathtofile="/var/www/html"; $outputfile =array("mytestfile.php"); if ($pid) // parent { $pid_arr[$i] = $pid; } else // child { pcntl_exec($cmd,$outputfile); return "error occurred in child"; } all other pcntl functions working properly, tried chmod , chown commands on directory well, still pcntl_exec not working. please tell me doing wrong? thanks in advance!! try option: chmod 755 /var/www/html this should grant permission needed!

Throttling FTP Polling consumers using apache camel -

i have requirement in @ 1 point of time, need connect multiple ftp/sftp endpoints (say 100 ftp endpoints) download files , process them. i have route below. seda queue further processes messages moving them appropriate folders from(ftp://username@host/foldername?password=xxxxx&include=.*).to("seda:"+routeid) now if starting ftp endpoints @ same time, resulting in jvm memory issues. how throttle starting of ftp endpoints? can use seda before ftp throttle (if how can use it)? other eip's or ideas use throttle triggering of polling ftp consumers? you can throttler dsl if want throttle fetching of messages. http://camel.apache.org/throttler.html for controlling startup can simplescheduleroutepolicy.. http://camel.apache.org/simplescheduledroutepolicy.html it handles route activating , deactivating. although haven't used myself looks can perhaps add controlled delay on when routes should start , stop.

css - BEM approach for an element than can belong and look different depending on the Block? -

let's have styled checkbox (think material design, there bit going on achieve desired checkbox style). block responsible modifying parent-dependent child block? example component - checkbox so have following: <div class="checkbox"> <label class="checkbox__label"> <input class="checkbox__input" type="checkbox" checked=true /> <span class="checkbox__icon glyphicon glyphicon-ok"></span> <span class="checkbox__text">{label}</span> </label> </div> i style each element within block base checkbox. within context of application, checkbox block can live in many other blocks (with own bem structures). example of other blocks the checkbox have difference appearance when within "compact panel": <div class="panel panel--compact"> <p>disclaimer.. [text]</p> <checkbox label="i agree

java - Tiles2 Wildcard not working -

i'm using spring-struts2-tiles2 in project , i'm trying use wildcard notation here remove duplicate in setup here <definition name="home-template1" template="/web-inf/jsp/templates/template1.jsp"> <put-attribute name="banner" value="/web-inf/jsp/sitepages/banner.jsp" /> <put-attribute name="header" value="/web-inf/jsp/sitepages/header.jsp" /> <put-attribute name="body" value="/web-inf/jsp/sitepages/body.jsp" /> <put-attribute name="archive" value="/web-inf/jsp/sitepages/archive.jsp" /> <put-attribute name="footer" value="/web-inf/jsp/sitepages/footer.jsp" /> </definition> <definition name="home-template2" template="/web-inf/jsp/templates/template2.jsp"> <put-attribute name="banner" value="/web-inf/jsp/sitepages/banner.jsp" /> <pu

java - Writing and Running my first program -

i know i'm new , may seem simple question, trying write first program. i've looked on dogpile.com led me wikihow.com ( http://www.wikihow.com/write-your-first-program-in-java ). i know can write program in notepad , other similar programs, after write code in notepad, do it? wikihow told me go launch in command prompt, kept getting error messages stating location wrong or command "is not recognized internal or external command, operable program or batch file." what might have done wrong? can fix it? recommended method beginner learn code/program? (i interested in learning java). thank you go , download java here: go , download java jdk here: http://www.oracle.com/technetwork/java/javase/downloads/index.html go , download eclipse ide java developers here: https://eclipse.org/downloads/ then you'll able right click program in eclipse , click "run..." or can click green "play"/"start" button @ top run program.

MySQL Inner Join Query: incorrect output -

i have mysql query , using inner join in query. due unknown reason not working expected. not sure wrong query. can advise me doing wrong. here query. select f.uid, a.uid, b.uid, c.uid, d.uid, e.uid, f.date, a.email, a.fname, a.lname, a.mobile, a.pic, a.address users inner join friends b inner join exp c inner join skill d inner join personaldetails e inner join jobs f on a.uid = b.uid =c.uid = d.uid=e.uid=f.uid f.job_id= 22 , f.ignored=0 , a.fname '%rah%' order f.date desc if run query suppose a.uid =1, b.uid =1, c.uid =1, d.uid=1, f.uid =1 but getting a.uid =1, b.uid=10, c.uid=10, d.uid=1,e.uid=1,f.uid =1 it seems weird issue, i've tried below. select 1=10=10=1=1=1 dual; result 0 , select 10=10=1=1=1=1 dual; result 1 , maybe on a.uid = b.uid =c.uid = d.uid=e.uid=f.uid query condition take second 1 compute result. i'm not sure if mysql kind of optimized step cause issue when excuting. i think

python - Where am I messing up with output formatting? -

so got error message when tried run code , can't figure out problem is. says it's valueerror can't figure out 1 exactly. maybe it's late, @ loss. here's code: def sort(count_dict, avg_scores_dict, std_dev_dict): '''sorts , prints output''' menu = menu_validate("you must choose 1 of valid choices of 1, 2, 3, 4 \n sort options\n 1. sort avg ascending\n 2. sort avg descending\n 3. sort std deviation ascending\n 4. sort std deviation descending", 1, 4) print ("{}{0:27}{0:39}{0:51}\n{}".format("word", "occurence", "avg. score", "std. dev.", "="*51)) if menu == 1: dic = ordereddict(sorted(word_average_dict.items(), key=lambda x:x[1], reverse=false)) key in dic: print ("{}{0:27}{0:39:.4f}{0:51:.4f}".format(key, count_dict[key], avg_scores_dict[key], std_dev_dict[key])) elif menu == 2:

Are Uber webhook event ids unique across all user profiles? -

i storing uber webhook events in db there may cases same event fired twice different scopes, mentioned here : https://developer.uber.com/docs/webhooks . handling multiple user profiles, , want know if events unique across users. if not, need store both event id , user event generated in db model. the event id should practically unique across space , time uuid - universally unique identifier generated using version 4 (random) of rfc 4122 variant specification. "event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0777" version 4 uuids have form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx x hexadecimal digit , y 1 of 8, 9, a, or b the version 4 uuid meant generating uuids truly-random or pseudo-random numbers. which depending on quality of generated cryptographic random numbers / if sufficient entropy feed generator, resulting event id should more or less globally unique. (less/more chance of hash collision)

objective c - Results of XML parsing start from the last &amp; found in the -

this question has answer here: nsxmlparser don't tag if tag have accent 1 answer i'm using youtube api , getting results channel. when try description stops @ last &amp; , part of description. here's website i'm getting xml information http://gdata.youtube.com/feeds/api/users/smosh/uploads?max-results=1 - (void) parser:(nsxmlparser *)parser didendelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qname { if ([elementname isequaltostring:@"content"]) { currentfeed.description = currentnodecontent; } if ([elementname isequaltostring:@"entry"]) { [self.feeds addobject:currentfeed]; currentfeed = nil; currentnodecontent = nil; } } the content getting description video. however these results wardrobe: paula barkley ass

ruby on rails - Difference between expect and is_expected.to in Rspec -

what difference between keywords. in following example, using expect passed test, while is_expected.to failed it. it { expect validate_uniqueness_of(:access_token) } it { is_expected.to validate_uniqueness_of(:access_token) } testing class user , generated devise class user < activerecord::base devise :lockable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable validates :access_token, uniqueness: true before_validation :generate_access_token!, on: :create def generate_access_token! begin self.access_token = devise.friendly_token end while user.find_by(access_token: self.access_token) end end is_expected_to shorter version of writing expect(subject).to your first spec passes because not testing @ all. the second spec fails because there no uniqueness validation. although code handling duplicates (but same race condition validation), doing in different way: generates new token, ra

javascript - Filter deep object based on checkbox input -

i'm not sure going wrong, filter hides itineraries in itinerary object. my object looks (they quite big show structure): [ { // itinerary filters:{ stops:2 } ... children }, { ... next itinerary } ] my ngrepeat looks this <div class="col-sm-12 item" data-ng-repeat="itinerary in results | filter: {itinerary: {filters: {stops: filterstops}}} | orderby: orderby" data-ng-class="{ active: resultdetails }"> i setting filterstops scope item so md-checkbox aria-label="non-stop" data-ng-model="filterstops" ng-true-value="0">direct</md-checkbox> nothing displayed in situation, whether hardcode number of stop filter directly, or whether select via checkbox. no console errors speak of, guessing logic reach sub property in filters object flawed? i @ loss here, appreciated. create method in controller $scope.filter=function(o

Why code of apache(the library 6.0 removed) can also run on Android M phones without measures? -

a strange thing found: i have project used apache library(like org.apache.http.client.methods...,which removed in android m).i compile in sdk 5.0 , runs success on nexus 5(run in android m). i confirm there no code "uselibrary 'org.apache.http.legacy'" in project. i decompile app,can not find apache codes in dex file... my ide:android studio 1.5.1 gradle plugin version:1.5.0 gradle version:2.12 it strange:the project can not build in sdk 6.0,but can run on phone of android m out "'uselibrary 'org.apache.http.legacy'". my first question in stackoverflow , weak in english,thanks reading! apache library removed in api level 23 if compilesdkversion 23 won't find if compilesdkversion 22 or below find it.. doesn't matter if you're running app on android marshmallow or gingerbread!

R knitr error 41 when producing pdf (windows) -

i have been trying make simple pdf using "knit pdf" functionality rstudio. every time try convert sample doc pdf following message: |............. | 20% ordinary text without r code |.......................... | 40% label: unnamed-chunk-1 |....................................... | 60% ordinary text without r code |.................................................... | 80% label: unnamed-chunk-2 (with options) list of 1 $ echo: logi false |.................................................................| 100% ordinary text without r code "path1" +rts -k512m -rts econ_404_hw_4.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output doctitle.pdf --template "path2" --highlight-style tango --latex-eng

man - Quick search of command options in bash -

i found myself in situation parameters of command in bash. instance, find -type f -name '*py' -print0 . in order find of need go through man,info, or --help option laborious , time consuming. there way make search instant. ideally, love see like: find -type --help stating on type option of find. if man pages open in less can use / search on it. man find / -type n , next search n previous search

c++ - No display for GTK in Visual Studio 2015 -

after couple of rounds of troubleshooting able compile gtk source code in visual studio no errors. followed procedure not dissimilar 'how configure gtk on visual studio 2010' . code follows, #include <gtk-2.0\gtk\gtk.h> #pragma comment(linker, "/subsystem:windows /entry:maincrtstartup") int main(int argc, char* argv[]) { gtkwidget* window = gtk_window_new(gtk_window_toplevel); gtk_init(&argc, &argv); gtk_widget_set_usize(window, 300, 200); g_signal_connect(g_object(window), "destroy", g_callback(gtk_main_quit), null); gtk_window_set_title(gtk_window(window), "gtk+ vs2010"); gtk_widget_show(window); gtk_main(); return 0; } however on starting code no window appears. visual studio indicates solution running no window appears. ideas? there's problem here: gtkwidget* window = gtk_window_new(gtk_window_toplevel); gtk_init(&argc, &argv); you should call gtk_init before creating windows: call

javascript - how to create a component that i can set fetching url data in an attribute in angular 2 -

i'm trying create application angular 2 , want create component in angular 2 set url in attribute , want use several times component , each component have own data... want : possible or not? i'll appreciate if me. new movies : <comp url="www.aaaa.com/movies?type=new"></comp> old movies : <comp url="www.aaaa.com/movies?type=old"></comp> @component({ selector: 'comp', template: '<div>{{data}}</div>' }) export class component { @input() url: string; constructor(private http:http) { } ngonchanges(changes) { this.http.get(this.url) .map(res => res.json()) .subscribe(val => this.data = val); } } if component has more 1 input need check 1 updated. see https://angular.io/api/core/onchanges more details.

javascript - OpenWhisk - socket.io - client possible? -

i trying use socket.io openwhisk action. want use websocket client, cannot seem work. socket.io client supported, or server? edit client sample http://socket.io/docs/ var io = require('socket.io'); var socket = io('ws://noderedjo2.mybluemix.net/ws/luftkvalitet/aqmeasure'); socket.on('connect', function () { socket.send('hi'); }); this gives typeerror undefined not function. (on io(...). i guess 1 has stand ws server, in node.js samples on same page...?! cheers -jo2 openwhisk not support websocket client library part of node.js action containers. packages supported listed here . i've opened issue add commonly used ones image use-case laid out (running openwhisk action , pushing websocket) sounds useful. socket.io seems able spin server, not suitable openwhisk action, short-running. socket.io-client (i suggested add that) needed connect websocket server.

android - Parcelable encountered IOException writing serializable object [QUICKBLOX DIALOG] -

i facing issue in quickblox since 15th april, when quickblox updated sdk android 2.5.2. problem noticed like, if have customdata parameter filled dialog, throws ioexeption mentioned below. else no issues. dialog casues no issues. qbdialog{id=xxxx, created_at=2016-19-04 11:36:54, last_msg_user_id=xxxx, occupants_ids=[xxxx, xxxx, last_message=hey, last_message_date_sent=1461046124, type=private, name=xxxx, room_jid=null, user_id=xxxx, photo=null, unread_message_count=0, customdata=null} dialog causes crash. qbdialog{id=xxxx, created_at=2016-19-04 12:01:00, last_msg_user_id=xxxx, occupants_ids=[xxxx, xxxx], last_message=hello, last_message_date_sent=1461047494, type=private, name=xxxx, room_jid=null, user_id=xxxx, photo=null, unread_message_count=1, customdata=qbbasecustomobject{classname='dialoguerelationstate', fields={isfriends=true, location_field=null}}} code segment passes dialogs above activity_chat class bundle bundle = new bundle

ios - PFQuery with live progress -

how can show live progress value when using query? can percent block or anything? how implement such thing? func querystory(){ self.userfile.removeall() self.objid.removeall() self.createdat.removeall() let query = pfquery(classname: "myclass") query.wherekey("ispending", equalto: false) query.orderbydescending("createdat") query.findobjectsinbackgroundwithblock { (posts: [pfobject]?, error: nserror?) -> void in if (error == nil){ // success fetching objects print("post count:", posts!.count) post in posts! { if let imagefile = post["userfile"] as? pffile { self.userfile.append(post["userfile"] as! pffile) self.objid.append(post.objectid!) self.createdat.append(post.createdat!) }

regex - Redshift regular expression for domain extraction -

i'm trying form regular expression regexp_substr (redshift) extract sub-domain & domain part given url. i tried many suggestions stackoverflow: regular-expression-extract-subdomain-domain, getting-parts-of-a-url-regex, how-to-get-domain-name-from-url , etc. of them work on regex validator don’t work on redshift. a regular expression should handle urls , without http/https prefix. is there other way of extracting sub-domain & domain given url using regular expression? after ton of experimentation, use: replace(regexp_substr(url,'//[^/\\\,=@\\+]+\\.[^/:;,\\\\\(\\)]+'),'//','') need match double slash , remove replace because of quite basic regex supported redshift. fwiw, you'll notice very different regex provided jeff barr in redshift udf's intro - regex produces nothing me.

html - How to responsive the large background image using CSS (WordPress) -

i have big background image, image not in small mobile browser. displayed horizontal scroll bar , image crop. the image should be: the 3 person in image should display in center no scrollbar how fix this? css (responsive) .header-home-div{ background: url(/testenvironment/files/homepage-header-mobile.jpg) !important; height: 700px; width: auto; i tried use this: background-size: cover !important; background-position: center top; but it's not working here's link i use this test responsiveness of image on mobile size, use !important background property. need use !important setting size : @media screen , (max-width: 992px) .header-home-div { height: 1500px; width: auto; background-size: 100% !important; } it's better remove !important property @ first instead of overwriting above fix way. the horizontal scrollbar depends on .header-home-h1 margin. following should fixed : @media (max-width: 520px) .header-home-

android - I can't receive ACTION_MEDIA_SCANNER_FINISHED intent -

i want receive action_media_scanner_finished, doesn't work. below manifest receiver. <receiver android:name=".myreceiver"> <intent-filter> <action android:name="android.intent.action.media_scanner_finished" /> <data android:scheme="file" /> </intent-filter> </receiver> i've browsed through many related articles, there no correct answer , of them quite old. wonder whether related api level or device or system app?

javascript - Bootstrap modal forces scroll to top -

i'm trying implement feed of posts, clicking on post open modal. i'm using angular frontend framework , decided use bootstrap modal, since works angular. problem is, modal forces body scroll top when showing. ofcourse not ideal when scrolling through feed. the css line below culprit. why causes problem occur, not know, kind of need scrollbar showing. loaading of dynamic content otherwise make layout jump around. html { overflow-y: scroll; } removing line fine right now, need find fix soon, layout jump horizontally when loading new content, if scrollbar not visible , appearing. have clue why causes problem, , how can possibly fix it? sounds modal problem. make sure modal or outer-most container has position: fixed , sounds disrupting flow of <body> element.

winapi - Using BitBlt to Scroll Text over a Picture Backrgound -

my user-control intended operate smooth vertical text scroller. renders text (to scrolled) control's surface only once , using textrenderer.drawtext . starts timer, upon each of ticks, bit-blits ( bitblt ) entire client-rectangle 1 pixel up. control's device-context both source , destination of bitblt operation , follows: protected sub handletimertick(byval sender system.object, byval e system.eventargs) dim og graphics = me.creategraphics() dim shdc intptr = og.gethdc() dim ires integer = bitblt(shdc, 0, 0, me.clientrectangle.size.width, me.clientrectangle.size.height, shdc, 0, 1, srccopy) og.releasehdc(shdc) og.dispose() end sub this accomplishes desired scroll effect, but if control's background solid-color (e.g. me.backcolor = color.gray ). if set picture control's background , bitblt scrolls background along text displayed on it. ofcourse, i'd text scrolled, , background image remain static. i have found following thread, sug

java - When Initializing object, instance variable not initialized always? -

the following code produces nullpointerexception - public class myclass { static myclass instance= new myclass(); // line 3 static boolean have_instance = true; boolean inst_avail=have_instance; // line 5 boolean isinstavail(){ return inst_avail; } public static void main(string[] args) { system.out.println(instance.isinstavail() ? "instance there.":""); // gives java.lang.nullpointerexception } } if move line 3 after line 5 , runs fine. how order matter here? shouldn't instantiation of class set ivar values everytime? when object created on line 3 class has not finished initializing yet, , have_instance variable has default value, null . value assigned inst_avail member variable of object, value returned instance.isinstavail() in main method null . an easy way fix swapping lines 3 , 4, have_instance has value when object created. or declare have_instance boolean instead of boolean , have

php - dynamically handle jquery events -

i have list of main subjects streams. let's art, science, commerce. each main steam there several subjects. such science, subjects mathamatics, bio science , etc. when user select main stream, want show relevent subjects selected main stream. use jquery pannels. basicaly, when stream checked releveant subjects div toggle. i main stream , subjects database. can change(dynamic). how handle this? i used following code. not dynamic. $("#science").change(function(){ $("#mathas").slidetoggle("fast"); }); $("#bio_cience").change(function(){ $("#b").slidetoggle("fast"); }); $("#pure_maths").change(function(){ $("#cc").slidetoggle("fast"); }); i want make above script dynamic. how proceed? your html like... <div id="1sub" class="sub">sub1</div> <div id="2sub" class="sub">sub2</div> <div id="

javascript - merging canvas and background -

i have canvas has gif background. need user upload drawing , bg, user can see drawing in relation bg. canvas.todataurl(); code shows canvas area user drawings, not bg. how flatten or "merge layers", can upload database. var mousepressed = false; var lastx, lasty; var ctx; function initthis() { ctx = document.getelementbyid('mycanvas').getcontext("2d"); $('#mycanvas').mousedown(function(e) { mousepressed = true; draw(e.pagex - $(this).offset().left, e.pagey - $(this).offset().top, false); }); $('#mycanvas').mousemove(function(e) { if (mousepressed) { draw(e.pagex - $(this).offset().left, e.pagey - $(this).offset().top, true); } }); $('#mycanvas').mouseup(function(e) { mousepressed = false; }); $('#mycanvas').mouseleave(function(e) { mousepressed = false; }); } function draw(x, y, isdown) { if (isdown) { ctx.beginpath(); ctx.st

alert the class name of an element using javascript -

i have element , want alert class attribute of element use code; <li id="sss" class="settings" onclick="alertclassname(this)">1111</li> and in alertclassname function ; function changeclass(elem) { var x = $(elem.id); alert(x.class) ; } it alerts undefind. try classname instead of class . onclick="alertclassname(this)" ... function alertclassname(elem) { alert(elem.classname); } reference .

extjs4 - How to fix horizontal scrollbar fixed in extjs grid? -

my grid has lot of vertical data increases height of grid. , move horizontally i.e move horizontal scroll bar need first move vertical scroll bar low below , move horizontal bar , again vertical bar see top records. is there way horizontal bar visible i.e fixed.so dont need go further down. if thing in page grid, cantry adding grid viewport. var _viewport = new ext.viewport({ layout: 'fit', items: grid, renderto: ext.getbody() }); regards.

java - RabbitMQ : Cannot connect to distant machine (RPC) -

i want connect 2 machines using rabbitmq, using remote procedure call. have 2 machines, local machine (address : 10.3.9.73) , vm machine (address : 10.3.9.2) . these adresses pingable. run client app in vm machine using code : connectionfactory factory = new connectionfactory(); factory.sethost("10.3.9.73"); factory.setport(5672); connection = factory.newconnection(); channel = connection.createchannel(); replyqueuename = channel.queuedeclare().getqueue(); consumer = new queueingconsumer(channel); channel.basicconsume(replyqueuename, true, consumer); and server app in local machine using code : connectionfactory factory = new connectionfactory(); factory.sethost("localhost"); factory.setport(5672); connection = factory.newconnection(); channel = connection.createchannel(); channel.queuedeclare(rpc_queue_name, false, false, false, null); channel.basicqos(1); queueingconsumer consumer = new queueingconsumer(channel); channel.basicconsume(rpc_queue_nam

asp.net - ColorPickerExtender - Managing padding problems -

i have problems ajaxcontroltoolkit's colorpickerextender while using latest version of asp.net. (after doing little digging in development tools on chrome, found out it's padding.) whenever try use colorpicker, shows this: 8px padding want this: 0px padding i think bootstrap css automatically being applied padding of colorpicker table, automatically generated. my question is, how make sure keeps 0px padding? here's use in aspx file. <edititemtemplate> <tr style=""> <td> <asp:button id="updatebutton" runat="server" commandname="update" text="update" /> <asp:button id="cancelbutton" runat="server" commandname="cancel" text="cancel" /> </td> <td> <asp:textbox id="nametextbox" runat="server" text='<%# bind("name") %>' /> </td> <td>

java - PalindromeChecker comparTo -

i trying make palindrome (the inverse of word word self e.g. tacocat) checker in java. use code: private static void palindroomchecker(string sword){ char[] arrcword=sword.tochararray(); char[] arrcdrow=new char[arrcword.length]; for(int i=0;i<arrcword.length;i++) for(int j=arrcdrow.length-1;j>=0;j--) arrcdrow[j]=arrcword[i]; string sdrow=new string(arrcdrow); if(sword.compareto(sdrow)==0) system.out.println(sword); else system.out.println("false"); } for reason keep printing false. reason there no palindrome's not tacocat. you need index. should work. private static void palindroomchecker(string sword) { char[] arrcword = sword.tochararray(); char[] arrcdrow = new char[arrcword.length]; int = 0; (int j = arrcdrow.length - 1; j >= 0; j--) arrcdrow[j] = arrcword[i++]; string sdrow = new string(arrcdrow); if (sword.compareto(sdrow) == 0) system

PHP Array Ascending Sort -

i've , array, want sort array ascending order [sys_title] key index. should do? [0] => array ( [sys_id] => 9 [sys_title] => checklist [sys_home] => /cp/system/chl/ ) [1] => array ( [sys_id] => 8 [sys_title] => bakery ordering system [sys_home] => /cp/system/bos/ ) expected result should this: [0] => array ( [sys_id] => 8 [sys_title] => bakery ordering system [sys_home] => /cp/system/bos/ ) [1] => array ( [sys_id] => 9 [sys_title] => checklist [sys_home] => /cp/system/chl/ ) you can try piece of code: usort($data,function($a,$b){ return strcmp($a['sys_title'],$b['sys_title']); }); print_r($data);