Posts

Showing posts from August, 2011

jquery - Tabstrip not refreshing after onclick -

i had popup window, opens button inside tabstrip content , want tabstrip reload once window closed. not reloading below script. why?? <script type="text/javascript"> $(document).ready(function () { $(".k-window-action.k-link").click(function () { var tabstrip = $("#abc").data("kendotabstrip"); //finding tabstrip var tabcontent = $("#abc").data("kendotabstrip").contentholder(1); //selecting particular tab tabstrip.reload(tabcontent); //reloading tab }); }); </script>

rotate animation in android -

i'm creating wheel rotating animation automatically run when run app...i want rotate 90 degrees , pause while rotate 90 degrees again until reach 360%...here's code:: public void start(){ rotateanimation counterspinw = new rotateanimation(0f, 90f, 50,50); counterspinw.setrepeatmode(1); counterspinw.getfillafter(); counterspinw.setduration(8000); counterspinw.setinterpolator(new linearinterpolator()); biglayout.startanimation(counterspinw); rotateanimation counterspinw2 = new rotateanimation(0f, 90f, 50,50); counterspinw2.setrepeatmode(1); counterspinw2.getfillafter(); counterspinw2.setduration(8000); counterspinw2.setinterpolator(new linearinterpolator()); biglayout.startanimation(counterspinw2); rotateanimation counterspinw3 = new rotateanimation(0f, 90f, 50,50); counterspinw3.setrepeatmode(1); counterspinw3.getfillafter(); counterspinw3.setduration(8000); counterspinw3.setinterpolator(new linearinterpolator()); bigla

javascript - Cannot use selector to select Google's autocomplete suggestion element? -

i have been fighting google today. have functioning autocomplete on input field id "locationsearch". what want able , grab suggestions google's autocomplete seems can't select ".pac-container" class google uses populate suggestions. my code this: <!doctype html> <html> <head> <meta charset="utf-8" /> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=se"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script> function init() { // make autocomplete var input = document.getelementbyid("locationsearch"); var options = { componentrestrictions: {country: 'se'} }; var autocomplete = new google.maps.places.autocomplete(input, options); // try see if can click on goog

asp.net mvc - ASP MVC3 - ActionLink not routing to controller properly -

below action link i'm using in asp mvc3 view. need method in controller , send in 2 variables. these variables serve compound key on sql table controller method trying pull information from. the link appears rendered @html.actionlink , getting error: description: http 404. resource looking (or 1 of dependencies) have been removed, had name changed, or temporarily unavailable. please review following url , make sure spelled correctly. requested url: /banklistmastercontroller/agentedit/11 here action link @html.actionlink("edit agent", "agentedit", "banklistmastercontroller", new { agentid = int.parse(item.agentid), id = item.id }, null) here controller method public viewresult agentedit(int id, int agentid) { string compare = agentid.tostring(); banklistagentid agent = (from c in db.banklistagentid c.id == id &&

c# - Why does a aspx/cs project copied locally does not work? -

why aspx/cs project copied locally not work? i have copied aspx/cs project right off server , put code right local host area. opened csproj file in visual studio no problems ran , did not crash. this. says internet explorer cannot display page. ideas? i have done rebuild , still fails. (good news there no compile errors) you need either iis or iis express run pages.

sql server 2008 - SSRS returns a DataSet with One Row when XPATH doesn't exist -

ssrs 2008 r2 this duplicate of question . ...but solution posted there doesn't work me. it important note if there data @ all, works fine me. why ssrs return dataset 1 row if query xpath doesn't resolve in xml document? for example, if have dataset called "address": <country> </country> any xpath is: country/city{street} (for example) i dataset 1 row , every field in row seems error - in operation perform on fails. can't put hidden filter on because hide expression fails execute , row shown - totally blank. if city element there fine. in testing if try create textbox , operations on fields in 1 row, fail , entire textbox doesn't show if there string literals in it. for example, if put textbox expression: ="rows: " & countrows("address") i result: 1 but if change same text box (in table cell) to: ="rows: " & countrows("address") & " hide:" & ii

css - Text in a div that has a opacity of 0.5 -

i have div container text inside it. the problem have container set have opacity of 0.5 , want text @ opacity of 1, can't exceed 0.5 because of div. i each made "p" set opacity of 1.0 in stylesheet, still doesn't work. any ideas? use rgba() instead on container div set opacity, opacity property inherited children elements, text nodes, meaning descendant of kind can't have higher opacity parent

SharePoint FormField doesn't show the content in ControlMode="Display" -

i use sharepoint 2010 standard edition. i have custom form creating/editing items, , few fields controlmode="display", like: <sharepoint:fieldlabel id="customstatuslabel" runat="server" fieldname="customstatus" controlmode="display" /> <sharepoint:formfield id="customstatusfield" runat="server" fieldname="customstatus" controlmode="display" /> when open form, fields in controlmode="edit" displayed properly, customstatus field displayed this: custom status ["custom status" column value] strangely enough, saw custom form working on different server...

how to form a regex that will parse the following? -

i need parse following line: action(x,x,cash(50))action(y,y,material(30,car,2))action(i,i,cash(50)) the output should like: action(x,x,cash(50)) action(y,y,material(30,car,2)) action(i,i,cash(50)) the regex used is: string tokenregex = "(action+\\(([a-za-z]+|\\,|([a-za-z]+\\(\\d*|[a-za-z]+|\\,)\\))+\\))"; it fails parse "action(y,y,material(30,car,2))" works "action(x,x,cash(50))". doing wrong. correct regex? i think it: string tokenregex = "(action\\([a-za-z]+,[a-za-z]+,[a-za-z]+\\(\\d+(,([a-za-z]+|\\d+))*\\)\\))"; i removed parentheses weren't needed grouping in regular expression. if need them capturing parts of expression, you'll have add them back.

ios - UILabel in custom UICollectionViewCell always null, can't update text -

i created collection view simple apple collection view sample project. have collection view in view controller in storyboard, , set label inside collection view cell in top right part of collection view. i've hooked iboutlet in custom cell. here's relevant code: - (void)viewdidload { [super viewdidload]; [self.workoutview registerclass:[cell class] forcellwithreuseidentifier:@"cell"]; ... } - (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { if (collectionview == self.collview) { cell *cell = [collectionview dequeuereusablecellwithreuseidentifier:@"cell" forindexpath:indexpath]; cell.segmenttitle.text = @"some text"; cell.backgroundcolor = [uicolor whitecolor]; return cell; } return nil; } i put breakpoint after segmenttitle.text part , segmenttitle null. accordingly see in simulator empty white boxes. did

c - Why does read not work yet fgets work fine in my program? -

so specific part of program looks this: printf("please input command:\n>"); while 1 { if ((int c = read(stdin_fileno, input, buffer_size) == 0) { break; } rest of program uses strtok break input down , store in array. pass function checks various commands , prints whatever command suppose or gives syntax error incorrect commands printf(">"); //last line } so here's happens: please input command: addperson batman >person added blahblah error: incorrect syntax for reason doesn't print: ">". everytime enter after says same thing right commands. but if use this: printf("please input command:\n>"); while 1 { if (fgets(input, buffer_size, stdin) == null) { break; } ... printf(">"); } i get: please input command: > add_person batman person added > blahbagwa incorrect syntax > add_person superman person added notice how &qu

Python: Appending a to a list from a dictionary -

this going long don't know how else explain this. so have 2 files reading in. first 1 has list of characters.the second file list of 3 characters , it's matching identifier character(separated tab). with second file made dictionary 3 characters items , 1 character corresponding key. need take 3 characters @ time first list , compare dictionary. if there match need take corresponding key , append new list print out. if match '*' character need stop not continue comparing list dictionary. i'm having trouble comparing , making new list using append function. here part of first input file: seq0 atggaagcgaggatgtga here part second: auu auc aua cuu l guu v uga * here code far: input = open("input.fasta", "r") codons = open("codons.txt", "r") counts = 1 amino_acids = {} lines in codons: lines = lines.strip() codon, acid = lines.split("\t") amino_acids[

c - Trouble using bsearch with an array of strings -

i getting confusing behaviour trying use c builtin bsearch on array of strings in c. here code. know can use builtin strcmp searching arrays of strings, included mystrcmp debugging purposes because didn't know why wasn't working. const char *statenames[] = {"alabama", "alaska", "arizona", "arkansas", "california", "colorado", "connecticut", "delaware", "florida", "georgia", "hawaii", "idaho", "illinois", "indiana", "iowa", "kansas", "kentucky", "louisiana", "maine", "maryland", "massachusetts", "michigan", "minnesota", "mississippi", "missouri", "montana", "nebraska", "nevada", "new hampshire", "new jersey", "new mexico", "new york", "north carolina&quo

ios - Create HTML Passcode screen for web app -

i working on mobile webapp developed using jquery mobile , i'd have simple passcode lock screen similar iphone general passcode screen. the main problem i'm having in getting the numeric keyboard show , display dot when code entered each text box. @ present way can make work across ios , android set text field type number, numbers displayed during passcode entry. i hoping had done or had simple solution. i don't know use of such passcode screen web app. anyway hacky this, create input box type=number create jquery event onkeyup, get value entered in variable. replace content of input box * when ok button pressed, check value stored in variable. this way use number-pad , not display contents.

ios - How to make a UITextField disabled for deleting the custom number -

i have app, has login form! , users logging in telephone number. cell phone number starts country code , it's possible type +7 or 8.. need strict field, except +7 sign. how customize uitextfield user change rest of field?? mean, need text field have text property filled +7 number , user won't able delete it, add number. hope, it's understandable ))) in advance. you should implement textfield:shouldchangecharactersinrange:replacementstring: method of uitextfielddelegate , return no first 2 characters (the prefix "+7" ). something like - (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string { return !nsequalranges(range, (nsrange){0,2}); } this prevent first 2 characters in text field modified @ all.

kineticjs - How do I create a button that loops through all the line variables making one visible at a time? -

how create button loops through line variables making 1 visible @ time? i'm using kinetic javascript, want make button loops through line variables , every time click button turns next lines visiblity "true" , previous lines visibilty "false" here code far: http://jsfiddle.net/nxt2l/4/ <body> <div id="container"></div> <div id="buttons"> <button id="show"> show </button> <button id="hide"> hide </button> <button id="reroute"> reroute </button> </div> <div id="container"></div> <script src="kineticjs.js"></script> <script> var stage = new kinetic.stage({ container: 'container', width: 1700, height: 1100 }); //creates our layer put on stage //note have bu

javascript - Why would an exception cause resource leaks in Node.js? -

if @ beginning of node.js documentation domains states: by nature of how throw works in javascript, there never way safely "pick left off", without leaking references, or creating other sort of undefined brittle state. again in code example gives in first section says: though we've prevented abrupt process restarting, leaking resources crazy i understand why case? resources leaking? recommend use domains catch errors , safely shutdown process. problem exceptions, not when working domains? bad practice throw , catch exceptions in javascript? know it's common pattern in python. edit i can understand why there resource leaks in non garbage collected language if throw exception because code might run clean objects wouldn't run if exception thrown. the reason can imagine javascript if throwing exception stores references variables in scope exception thrown (and maybe things in call stack), keeping references around, , exception object kept ar

ios - The property frame of UIViewController's view doesn't work while using a single subview under UIScrollView -

before using uiscrollview's zoom feature, fine. code bellow: uiscrollview* scrollview = [[uiscrollview alloc]init]; for(int i=0; < foodintrocount; ++i) { uiimage* image = [uiimage imagenamed:@"7_1.jpg"]; uiimageview * imgview = [[uiimageview alloc]initwithimage:image]; imgview.frame = cgrectmake(0, height*i, width, height); [scrollview addsubview:imgview]; } scrollview.contentsize = cgsizemake(width, height*(foodintrocount+1)) ; scrollview.pagingenabled = yes; scrollview.showsverticalscrollindicator = no; scrollview.showshorizontalscrollindicator = no; scrollview.bounces = no; scrollview.delegate = self; _foodwineviewcontroller = [[ohfoodwineviewcontroller alloc]initwithcategorydata:_fooddata]; uiview* wineview = _foodwineviewcontroller.view; wineview.frame = cgrectmake(0, height*(foodintrocount), width, height); [scrollview addsubview:wineview]; after adding zoom feature, code looks like

java - spawning new thread in spring controller -

so in following code, when yservice.performaction() many items , taking time. i have been advised try use threads make faster went online , looked , found it's not advisable spawn new child threads controller might mess java ee container thread pool. if yservice.performaction( ) taking time run , need make fast, options have? many people have been suggesting use quartz spawn new threads. not sure if want complex. how can run specific service in separate threads? there simple way it? @controller @requestmapping("/test") public class testcontroller { private static final logger logger = logger.getlogger(testcontroller.class); @autowired xservice xservice; @autowired private yservice yservice; @requestmapping(method = { requestmethod.get }) public void testcheck(httpservletrequest request, httpservletresponse response) throws ioexception { try { list<sl> somelist = xservice.getallx(); stringbuffer status = new stringbuffer("succe

php - Retrieve a file from a URL and serve it with the same headers -

currently i'm working on building smf mod enables ssl , 1 thing keeps poping issue of user embedded content (like images) , other sorts of things not being served sites ssl. i'm after way build sort of proxy script run on site , when passed url, retrieve file, maintain of headers (eg. mime type) , serve file again. way looks image or whatever being served ssl enabled site when infact not. thanks comments! want in future, heres script i'm using: <?php $requesturl = filter_var($_request["url"], filter_sanitize_url); if(filter_var($requesturl, filter_validate_url, filter_flag_path_required)) { if(isset($_server['http_if_modified_since'])) { // load headers destination server. $uri_info = new uriinfo($requesturl); if($uri_info->info['filetime'] == strtotime($_server['http_if_modified_since'])) { header('http/1.1 304 not modified&

oop - Creating instances of classes python & __init__ -

i want class has class variables, , has functions perform stuff on variables - want functions called automatically. there better way it? should using init this? sorry if nooby question - quite new python. # used in second part of question counter = 0 class myclass: foo1 = [] foo2 = [] def bar1(self, counter): self.foo1.append(counter) def bar2(self): self.foo2.append("b") def start(): # create instance of class obj = myclass() # want class methods called automatically... obj.bar1() obj.bar2() # trying here create many instances of class, problem # not instances not created, instances have same values in # foo1 (the counter in case should getting incremented , added while(counter < 5): start() counter += 1 so there better way this? , causing of objects have same values? thanks! foo1 , foo2 class variables, shared objects, your class should this, if want foo1 , foo2 different every obj

objective c - iOS: NSNotification unrecognized selector error -

nsnotification *notification = [nsnotification notificationwithname:@"locationobtained" object:self]; [[nsnotificationcenter defaultcenter]postnotification:notification]; i [locavoreretrofirstviewcontroller startservices]: unrecognized selector sent instance 0x74c3070 - (void)listenforlocationcompletion{ [[nsnotificationcenter defaultcenter]addobserver:self selector:@selector(startservices) name:@"locationobtained" object:nil]; } - (void)startservices:(nsnotification *)notification{ } any reason why error? change : [[nsnotificationcenter defaultcenter]addobserver:self selector:@selector(startservices:) name:@"locationobtained" object:nil]; } your selector s

html - Problems using max-width on div -

i have div i'd remain @ 960px when browser window scaled accordingly , 1100px when more screen real estate available. i tried using min-width:960px , max-width:1100px . browsers seem recognize min-width not max. tried each alone , using max div became hidden. i'm not sure if of other rules affect code have #div { min-width:960px; max-width:1100px; height:550px; margin-top:10px; background-image: url(../images/trans_bkg.png); background-repeat: repeat; position:absolute; right:10px; } hopefully understand i'm trying accomplish code can provide screenshot if help. thanks @media (max-width: 1200px) { div { width:1100px; } } if resolution 1200px, div's width 1100px. similarly can write range @media (min-width: 680px) , (max-width: 1199px) { div { width:1100px; } }

Inserting a simple list into MySQL table (php) -

after bit of hunting around solution. thought time ask brains trust here on stackoverflow. i'm looking way take list, in form of string, split using commas , insert columns in mysql table. the list like: tim moltzen, 2. joel reddy, 3. blake ayshford, 4. chris lawrence, 5. james tedesco, 6. benji marshall, 7. braith anasta, 8. aaron woods, 9. robbie farah, 10. jack buchanan, 11. bodene thompson, 12. liam fulton, 13. adam blair, 14. ben murdoch masila, 15. ava seumanufagai 16. matt bell, 17. eddy pettybourne from list, 2 things needed split. number , name. so, number inserted "player_number" column , name "player_name". of course commas used spacing, , don't need interested table. any assistance on how split string , insert table extremely appreciated. edit:: i'll see can work using explode , running loop insert them table. $string="1. tim moltzen, 2. joel reddy, 3. blake ayshford, 4. chris lawrence, 5. james ted

iphone - how to create vertical page layout with grid view in IOS -

Image
i m beginner in ios development , facing difficulty in project. trying create layout, each group contains 5 pictures, shown all images url, know how load images. facing problem in "scroll screen download next group." how can make kind of layout. have tried create custom tableview cell don't know how make refreshed new images on scroll. other way achieve this. sample code or tutorial link appriciated. thanks.

opengl - GLSL - Binding Attributes to Semantics -

i've seen number of questions , answers here on stack overflow topic. these answers, i've come possible solution binding glsl attributes user-defined semantics. wanted input , discussion going it, , check if valid idea. to start, let's assume have list of user-defined semantics: enum vertexelementsemantic { position, normal, ambient, diffuse, specular, tex_coord0, tex_coord1, tex_coord2, tex_coord3, indices }; and structure encapsulates data required set vertex attribute pointer. struct vertexelement { unsigned int m_source; unsigned int m_offset; unsigned int m_stride; } now, renderoperation class contain map of vertexelementsemantics vertexelements. format, size, , whether vertexelement normalized can determined semantic. the last bit of information require in order set pointer attribute location itself. here's want bind our vertexelementsemantic specific location. from the first answer question , learn can explicitly state desired lo

python 2.7 - Django haystack filter in search index -

i have search working fine on project. in models have boolean field named is_active . i want search occurs when is_active true, i've been testing without satisfatory response. my search_indexes.py: haystack.indexes import * haystack.sites import site core.models import anunciosolucao class anunciosolucaoindex(realtimesearchindex): text = charfield(document=true,use_template=true) site.register(anunciosolucao,anunciosolucaoindex) that way works, bring me is_active == false . thoughts? there's method called read_queryset on searchindex api. had override this: class anunciosolucaoindex(realtimesearchindex): text = charfield(document=true,use_template=true) def read_queryset(self): super(anunciosolucaoindex,self).read_queryset() return anunciosolucao.objects.filter(is_active=true)

c++ - Can compiler optimize return value from copy to a reference? -

if write code way: shared_ptr<foo> bar::getfoo() { return m_foo; } void somewhereelse() { shared_ptr<foo> foo = mybar.getfoo(); //do stuff foo } can compiler somehow optimize code changed that: void somewhereelse() { const shared_ptr<foo> &foo = mybar.getfoo__by_ref_somehow(); //do stuff foo } i'm asking because problem in case of concurrent execution. i understand rvo can applied , remove copy, compiler eliminate copy @ all? no. asked value, get value. copy elision eliding unnecessary copies. wanted value; function returns value. you're going @ least 1 copy. you're wanting form of code transformation, turning value reference. you create function getfoo__by_ref_somehow , returns const& value stored in class. different function create , not compiler allowed create you.

webview backstack lost after screen rotation, back button history of pages, Android -

i have webview in activity , works great in 1 screen orientation. can navigate around different pages on website , when hit button goes the previous pages visited before, however when rotate android tablet 1 orientation another. portrait landscape, history lost. passed the url webview on next orientation savedinstancestate. after screen rotation newly created weview opens page url expected. when hit button not go anywhere. how fix problem? here of code, part handle button. @override public boolean onkeydown(int keycode, keyevent event) { if (keycode == keyevent.keycode_back){ if (pageview.cangoback()){ if((coverimage.getvisibility())==(view.visible)){ setyoutubescreendecor(false); fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmenttransaction.hide(youtubeplayerfragment); fragmenttransaction.c

ipad - application taking time while launching first time on iOS 6.X.X -

application launch taking 5-6 seconds on ios 6.x.x versions in ipads. works on ios 5.x. default.png file remains little longer on screen ios 6.x.x.what wrong loading. self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; uiinterfaceorientation orientation=[[uiapplication sharedapplication] statusbarorientation]; if (orientation==uiinterfaceorientationlandscapeleft || orientation==uiinterfaceorientationlandscaperight) { self.viewcontroller=[[ebhomeviewcontroller alloc] initwithnibname:@"ebhomeviewcontroller-la" bundle:nil] ; } else if(orientation==uiinterfaceorientationportrait || orientation==uiinterfaceorientationportraitupsidedown) { self.viewcontroller=[[ebhomeviewcontroller alloc] initwithnibname:@"ebhomeviewcontroller-pt" bundle:nil] ; } navcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:self.viewcontroller]; self.window.rootviewcontroller = nav

deployment - How to deploy django server into production environment without a full source code? -

i still newbie python , django. developing application using django go production server. it's customized web application client. after doing research, found out apache mod_wsgi best option django deployment. have copy , paste code production server , application accessible. if don't want give whole source code , give executable application client (p.s client wants deploy application own server) . possible in python/django ? you give them .pyc files corresponding source code files. make harder them @ source code. however, it's limited measure (i.e. can still recover of structure source code), , it's bad idea.

How to secure RESTful API in a proper way with a dynamic token Rails -

what trying achieve: i'm looking create (rest) api rails application. have looked securing api , versioning of api , api gems railscast implementation of api calls. what solution railscasts: i find myself stuck security of api. in securing api railscast have specified keep token each app i.e. instance let consider- android app --> "android_token" iphone app --> "iphone_token". whats problem: but concern if gets access token using network tethering or something. person can make indefinite calls app. what possible solutions: to cease should have dynamic session kind of thing app requests. pops in head: 1.why not generate different dynamic token each request , request should coupled same dynamic token response or maintain session using dynamic token , new token regenerated after lets 30 minutes or 50 calls. just there gems devise perform user authentication in robust way. there gem or plugin can maintain api session secure t

c++ - Hooking up multiple RGB LEDs while using a minimal number of PWM pins on an Arduino? -

Image
i have anode rgb connected 11, 10, & 9 pwm pins on arduino. add 3 more led's project, don't want take every single pwm pin. there way me hook 4 led's while using minimum number of pins? keep in mind want use 12 resistors 4 leds. oh , leds exact same thing (they red, , turn blue, etc) if helps. here's how board looks right now: if me out, awesome!!!! appreciate help! p.s. attached .fzz file if of edit schematic image, super easy. click here. if there doing same, connect them parallel, means put second led breadboard right under existing one. if power consumption wit 4 leds have use transistor amplifier. send youo schematic, have no software draw such. however, using transistor amplify arduino output quite common thing... hope help!

Glassfish Admin Console - 404 error -

i have several wars in glassfish installation. someday found glassfish admin console disappeared. when try access click here - see 404 http error. why glassfish admin console missing , how return ? i can't simple reinstall, because production server. try access console in url: http://myservername.com:4848/login.jsf in http://myservername.com:4848 redirect http://myservername.com:4848/common/index.jsf , not work because url not exists. i found solution in topic: https://www.java.net/node/699754

c# - Count lines for a particular string combination -

i trying count no. of lines in productservices , add product appearing. logs : info [productservices] add product has been performed gulanand on product id 424 () info [productservices] add product has been performed gulanand on product id 424 () info [productservices] add product has been performed gulanand on product id 424 () info [productservices] update product has been performed gulanand on product id 424 () info [productservices] update product has been performed gulanand on product id 424 () info [productservices] add product has been performed gulanand on product id 424 () info [productservices] add product has been performed gulanand on product id 424 () info [productservices] add product has been performed gulanand on product id 424 () code have tried : ienumerable<string> textlines = directory.getfiles(@"c:\users\karansha\desktop\ashish logs\", "*.*") .select(filepath => fi

c++ - In apache qpid how to list the brokers status? -

in apache qpid how list brokers status? i'm using qpid-stat -b : brokers broker cluster uptime conn sess exch queue ======================================================== ? <standalone> 17m 29s 1 1 8 5 other these option there? it depends mean broker status. may try qpid-tool . can read more here , here . this utility provided telnet style interface able view, list stats , action methods. simple capture below. best play , mail list if have questions or want features added. example % qpid-tool management tool qpid qpid: list summary of objects type: package class active deleted ======================================================= org.apache.qpid.broker exchange 8 0 com.redhat.rhm.store store 1 0 org.apache.qpid.broker broker 1 0 org.apache.qpid.broker binding 16 12 org.apache.qpid.broker

java - Does hibernate check length of column? -

i have access db , read-only access hbm.xml files. need increase column size. see in table/column definition in hbm.xml files table no attribute length. should application work increased column size in case? yes, will. hibernate doesn't care length of columns. why don't test it?

linux - Auditing procfs -

i want keep track on important system changes on gnu/linux boxes, disabling pax, enabling traffic forwarding, icmp redirects, changing printk verbosity level , on. @ general these operations base on changes on /proc/sys/kernel/* files. , didn't find method of auditing procfs far. maybe setting watch rule 'write' syscalls /proc/sys/kernel/* value first argument (a0) feasible approach... wondering. there's no way of using wildcard in a0-3 auditd rules -f parameters, in worst case have create separate rule each important file in directory. i'll appreciate hints problem, in advance.

entity framework 5 - How does Database.SetInitializer actually work? (EF code-first create database and apply migrations using several connection strings) -

i trying write method create database , run migrations on it, given connection string. i need multiple connections because record audit log in separate database. connection strings out of app.config using code configurationmanager.connectionstrings["master"].connectionstring; the code works first connection string defined in app.config not others, leads me think somehow getting connection string app.config in manner don't know. my code create database if not exist is private static context mycreatecontext(string connectionstring) { // put connection string factory method can appdomain.currentdomain.setdata("connectionstring", connectionstring ); var factory = new contextfactory(); // know need line - cant see how follows uses database.setinitializer(new migratedatabasetolatestversion<context,datalayer.migrations.configuration>()); var context = factory.create(); context.database.createifnotexists(); return context

c# Selenium WebDriver. Firefox browser blocks popup windows -

i'm using firefox 19.0.2, selenium 2.31.2.0 in set method enable popup blocking via firefox profile firefoxprofile.setpreference("dom.disable_open_during_load", true); option required customer wants worked popup blocking enabled. in test need share content external community. when press button external community popup appear. problem when perform actions hands, goes fine , popup doesn't block. when try click button via webdriver firefox blocks popup. click button that: //kind of mouse on emulation new actions(driver).movetoelement(_element).release(_element).build().perform(); _element.click(); i think problem in differences between native button click , click performed webdriver. setting enablenativeevents = true in firefox profile not solution, because tests become unstable. maybe face problem , can provide solution. action composed 3 steps. configure action actions builder = new actions(driver); builder.movetoelement(_element

sublimetext2 - Run C++ file with input in Sublime Text 2 -

after compilation of c++ source code, want run input file through sublime text command. how can done? if mean parameter after c++ build file, have found way in dodgy way... created new build system c++11 , added input file (see input_file below) run section. { "cmd": ["g++", "-wall", "-wextra", "-pedantic", "-std=c++0x", "${file}", "-o", "${file_path}/${file_base_name}"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++", "variants": [ { "name": "run", "cmd": ["bash", "-c", "g++ -wall -wextra -pedantic -std=c++0x '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}' input_file"] } ]} save file, ex

android - Detecting click event on a particular text in TextView with marquee -

i setting text in textview.and marquee text.not text, array of text concatenated 1 after , added textview.i want if click text text(or word) shown in dialog box.first of possible anyhow.i tried use spannable link first answer.but it's not working per requirement have marqueeing text. why wouldn't replace marque more useful? :) may wrap textview horizontal scroll view. have thread (asynctask) scrolls text, using scrollview.setscrollx() marquee does. can guess, comes next? use spans, suggested link, quoted!

android - Creating Folder in Internal memory -

i unable methods creating folder in internal memory, i gone through few conversations in android create folders in internal memory , problem facing in reading file internal memory of android . still unable meet requirement. my requirement , want create folder in internal memory, there want store 1 video. thankyou in advance valuable feedbacks. try below file mydir = context.getdir("users", context.mode_private); //creating internal dir; if (!mydir.exists()) { mydir.mkdirs(); }

ajax - JSF page isn't rerendered after failover -

we have little problem our application when it's deployed in cluster. after shutdown working node, session restored on 1 , application keeps working need either refresh page entirely or move page because page opened when server shutdown doesn't want work correctly. still sends requests, managed bean's methods called , data correct after ajax request doesn't want rerender parts. thing can on page click on link , move page because in case have request. how fix it?

c# - displaying text property for ToolStripTextBox added rutime -

i have added menustrip @ run time in application. menustrip ms = new menustrip(); toolstripmenuitem mn1 = new toolstripmenuitem("&new"); i further adding textbox eventhandler keyup event. toolstriptextbox qry = new toolstriptextbox(); qry.keyup += new keyeventhandler(tools23); public void tools23(object sender,keyeventargs e) { if(e.keyvalue ==13) { messagebox.show(the text entered in toolstriptextbox); } how display textbox contents when event raised, since cannot access text property runtime controls added? try this public void tools23(object sender, keyeventargs e) { if (e.keyvalue == 13) { toolstriptextbox t = (toolstriptextbox)sender; messagebox.show("the text entered in toolstriptextbox " + t.text); } }

javascript - .off('click') - but i want 'click' back again -

i trying this. here in jsfiddle: http://jsfiddle.net/qgghw/2/ but after hit not now , no more clickable next textinput. how can this? there .on('click'); again append click event again? appreciate help. to remove registered handler, need pass registered event handler instance .off method. $(document).ready(function(){ function fn(){ $(this).html('<textarea> </textarea><button class="test">save</button><button class="dont">not now</button>').off('click', fn); }; $('#write_comment').on('click', fn); $('#write_comment').on('click','.test', function(){ alert('testme'); }); $('#write_comment').on('click','.dont', function(){ console.log('d') $('#write_comment').text('click me').on('click', fn); }); }); demo: fiddle

osx - How do I open a window as a modal dialog in MonoMac using C#? -

i developing cocoa application monomac (c#). i have class mywindowcontroller inherits monomac.appkit.nswindowcontroller , , open new instance of window this: mywindowcontroller mwc = new mywindowcontroller(); mwc.window.makekeyandorderfront(this); but how open modal dialog? imperative nothing else in application executed while dialog open, cannot use window sheet (which blocks current window). , can't find else seems want on controller. on windows, have done calling: mwc.showdialog(); so want monomac equivalent of showdialog() , believe. i spent 3 hours trying figure out before posting question, of course found solution right after asking. it looks need use nsapplication object: nsapplication.sharedapplication.runmodalforwindow(ewc.window);

r - Graph from adjacency list -

i have adjacency list , want visualize them , processing on it. there package efficiently. see there lot of graph packages confused among them. can me on this? $`825` [1] 824 $`824` [1] 823 $`823` [1] 822 $`822` [1] 821 $`821` [1] 820 777 $`820` [1] 819 816 789 787 785 783 $`777` [1] 776 above adjacency list. below graph want. 825 | 824 | _______ 783 823 / | /________ 785 822 / | /__________ 787 821 -- 820 | \__________ 789 777 \ | \________ 816 776 \ \______ 819 thanks. mylist <- list(2,c(1,3),c(2,4),c(3,1)) names(mylist) <- c(1,2,3,4) # list #make in igraph format myadj <- stack(mylist) #> values ind #> 1 2 1 #> 2 1 2 #> 3 3 2 #> 4 2 3 #> 5 4 3 #> 6 3 4 #> 7 1 4 #plot library(igraph) g<-graph.data.frame(myadj) plot(g)

android - Captured image is rotated 90 degress -

i've written app capture image. problem image rotated 90 degrees after capture. i've setted the camera.setdisplayorientation(ninty_degrees); but affects previewing of surfaceview . real problem bytes camera flipped. why happend? there setting can set flip before capture? i activity subcribes event, when image captured. how register when byte[] filled: camera.takepicture(null, null, new picturecallback() { @override public void onpicturetaken(byte[] data, camera camera) { if (null != callback) callback.onjpegpicturetaken(data, camera); } }); in activity public class history extends basewindow implements onclicklistener, captureimagecallback and relevant method: @override public void onjpegpicturetaken(byte[] data, camera camera) { intent = new intent(this, imageediting.class); i.putextra("image", data); startactivity(i); } you can see parameter

java - generic not supported in 1.3 error even when java_home point jdk1.7 in maven build -

im getting below message when run mvn clean install [error] build failure [info] ------------------------------------------------------------------------ [info] compilation failure d:\data\work\extjs.parser\src\main\java\com\model\component.java:[17,15] error: generics not supported in -source 1.3 not parse error message: (use -source 5 or higher enable generics) d:\data\work\extjs.parser\src\main\java\com\model\container.java:14: error: gene rics not supported in -source 1.3 private list<component> items; the project simple maven project wont compile generics error when have set java_home jdk1.7 installation path however when add plug in works fine. why required explicitly set hava home path. <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <configuration> <source>1.7</source> <target>1.7

android - How to create Dashboard Menu Like Realplayer App -

Image
how can create dashboard menu realplayer app.. or one any great can start in right direction.. far have tried few things not able achieve kind of layout. for first one, quess need bunch of images , place them in way want. second one, gridlayout might out. or use couple of linearlayouts.

php - keep track of logged in users -

i'm designing application in php, users directory, need display login status each user. there safe way tell if user connected (logged in) or not? edit: i'm updating post application logic. application craftsmen directory. each craftsman login application. when search craftsmen, able see logged in ones , send message job description needs done. craftsmen may not have other activity log in app, app self must have way "tell" if user logged in or not. i think php requirements make difficult. take @ socket.io or similar. achieve craftsmen having connection longpolling/sse/websockets. can integrate php serving html , set connection client on document ready socket.io.

How to install default jar file with maven-jar-plugin -

given project <packaging>something-not-jar</packaging>, how one: tell maven-jar-plugin produce "normal" jar file , tell maven-install-plugin take normal jar file and install local repository (in addition something-not-jar artifact produced) if tell jar plugin produce test-jar, , install plugin installs xxx-0.0.1-snapshot-tests.jar local repo. "jar" goal apparently not cause resulting jar file installed in local repo, though jar file created in target folder. so how do this? you should following: mvn install

sql server - Creating a stored procedure to update a row in a SQL database using data from the previous row -

good afternoon all, i have database used track production on assembly line. effectively finished product show each stage of production line , serial number of in it. i have created stored procedure retrieve , display data, struggling move machine stage 1 stage 2 , stage 2 stage 3 etc... table simple, contains following rows: stage_id (pk, int, not null) build_id(fk, int, null) effectively, want build stored procedure move value of build_id stage_id = 1 stage_id = 2 . any idea how this? thanks update stagetable set build_id = (select build_id stagetable stage_id = 1) stage_id = 2 if need procedure this create procedure sp_movestage(@from int, @to int) update stagetable set build_id = (select build_id stagetable stage_id = @from) stage_id = @to and execute exec sp_movestage 1, 2

How to combine servlet with java portlet to handle requests from portlet? -

Image
there database server , portal installed portlet. portlet represents view, divied 2 parts. @ left side there navigation tree. when user clicks on tree nodes gets information database server , portlet should display information on right side of view. on assumption portlet view page contains javascript code, when user clicks on tree node, portlet sends request servlet, gets servlet response, parses , updates view. portlet view layout displayed below: if servlet based application, implement javascript calls page server, return json, parse on page , update page representation. but java portlets bit different , did not find way how that. and question there way package servlet portlet in 1 *.war file , implement requests portlet servlet. portlet sends requests servlet, servlet accesses database server, , after sends results portlet. if answer "yes" - how can that. because tried package servlet portlet, such portlet not work. if answer "no" - best appr

java - How to pass a value to an action in Struts 2 when you don't have a form? -

i've written submit button this: <s:submit type="button" value="delete" action="%{notesdeleteurl}" theme="simple"/> and i've defined url this. <s:url value="notesdeleteaction.action" id="notesdeleteurl" > <s:param name="noteid"><s:propertyvalue="inote" /> </s:param> </s:url> so basically, have no < s:form > tag on jsp need call action submit button while passing value it. , error. there no action mapped namespace [/] , action name [notesdeleteaction?noteid=48] associated context path [/abc]. so understand it's unable resolve action because of added parameter, how else can send value action? your error nothing parameter. struts doesn't know url /notesdeleteaction you'll need include action in struts.xml file: <package name="yourpackage" namespace="/" extend

Delphi - How to kill a process by knowing its path? -

until using this function kill process. if have 3 processes of same name , 1 of them 1 want kill? if this: killtask('csrss.exe') kill system process. have path of process, how can use information kill it? iterate on processes , check path each of them, use answer question (use getmodulefilenameex): get full path pid using delphi if launched process remember pid or handle , kill specific one.

c# - Is it possible to turn off TabStop for all StackPanels in a single global place? -

i have number of usercontrol each contain number of stackpanels. problem have each stackpanel seems think i'm interested in tabbing before tab contents of stackpanel. if want tab control exists in stackpanel_a control exists in stackpanel_b need hit tab @ least twice tab first control stackpanel_b, second control. i can turn off tabstop specifying, e.g. <stackpanel keyboardnavigation.istabstop="false" /> but considering how many stackpanel elements have it's both tedious , messy. is there way me in single global place? you might able achieve using style in global scope (e.g. app.xaml file): <application.resources> <style targettype="{x:type stackpanel}"> <setter property="keyboardnavigation.istabstop" value="false" /> </style> </application.resources> then way stackpanel in application won't tab stop.

php - Operators precedence of "or" and assignment -

found interesting code snippet today. simplified, looks this: $var = null; $var or $var = '123'; $var or $var = '312'; var_dump($var); the thing that, know, precedence of assignment higher or , so, assume, var_dump should output 312 (first - assign, second - compare logically). result defferent, getting 123 (first - check if $var converting true , second - if not, assign value). the questions how work? why behavior same or , || ? you can see examples behaviour in logical operators also can read artical short-circuit evaluation the short-circuit expression x sand y (using sand denote short-circuit variety) equivalent conditional expression if x y else false; expression x sor y equivalent if x true else y . in php. return x() , y(); equal to if (x()) return (bool)y(); else return false; return x() or y(); equal to if (x()) return true; else return (bool)y(); so, deal not in precedence.

sql server 2008 - sphinx indexer is not working -

i want index mssql 2008 database in windows 7. config file source main { type = mssql sql_host = localhost sql_user = sa sql_pass = pass #mssql_winauth = 1 sql_db = article sql_port = 1433 # optional, default 3306 mssql_unicode = 1 # request unicode data server sql_query_pre = insert indexlog(startdatetime, count, successful) select top 1 getdate(), (select count(id) article),0 article sql_query = select id ,row_number() over(order title) titlerowno\ ,title,abstract \ article #log index end sql_query_post_index = update indexlog set enddatetime = getdate(), successful = 1 id = (select max(id) indexlog) sql_attr_uint = id sql_attr_uint = titlerowno } index news_main { source = main path = c:/sphinx/article/data/news_main docinfo