Posts

Showing posts from April, 2013

c++ - Resize a window such that the primary widget is a specific size -

i have qt application qmainwindow has menu, toolbar , primary widget. i have menu item resize application primary widget specific size yet figure out way this. so far, closest have come this: void on_actionsetsize_triggered() { ui_.primary_widget->setminimumsize(100,200); adjustsize(); } the idea being set primary widgets minimum size target size, , ask ui "shrink fit" unfortunately, seems work sporadically @ best, increase size when needed, when want reduction in size, doesn't work :-/. note: want allow user freely resize application, when ask. for size reduce while increased need set fixed size on primary widget before calling adjustsize() . can release constraint allow user re-size henceforth. you try this: ui_.primary_widget->setfixedsize(100, 200); adjustsize(); ui_.primary_widget->setmaximumsize(qwidgetsize_max, qwidgetsize_max); do note size setting on primary widget needs valid size based on what's inside it.

python - ZeroMQ + Django & uwsgi issues -

using django, need send message another, separate python program. zeromq seems lightweight , should fit bill this. however, trying work , ends zeromq: bad address error, when setting socket zmq.push (or else). traceback: exception type: zmqerror exception value: bad address ... ... sock = context.socket(zmq.push) /usr/local/lib/python2.7/dist-packages/zmq/sugar/context.py in socket s = self._socket_class(self, socket_type) self <zmq.sugar.context.context object @ 0x200dc80> socket_type 8 context made in calling function in models.py, , does: context = zmq.context() sock = context.socket(zmq.push) < ^ crash here> sock.bind('tcp://127.0.0.1:8921') ... it launched via exec uwsgi_python \ --master --pidfile=/tmp/blah.pid \ --chdir=/path/to/site \ --module=program.wsgi:application \ --env django_settings_module=program.settings \ --uid user --gid 1000 \ --socket=/tmp/uwsgi_program.sock \ --chmod-socket \ --vacuum \

debugging - 2D array referencing whole index, not individual cell in C -

i can't seem figure out problem is. i'm writing 2d random walk simulation , thought use 2d array simulate grid it's on. however, in code, when try reference particular cell in array increment it's value, bin[3][4], increments value of whole index i.e. bin[1][4],bin[2][4],bin[3][4],etc. ideas on how fix or i'm doing wrong? thanks. #include <stdio.h> #include <math.h> #define total 10. /*total iterations*/ #define walk 5 /*total # of steps in walk*/ #define lambda 1.0 /*step size*/ #define binsize 0.1 /*current chosen values bug checking simplicity*/ main() { float range = walk*lambda*2.; /*2 times max range, positive*/ int n,prob,i,k,j,placex,placey,bins; double valuex,valuey, a; /*value starts @ half range values +*/ bins=(range/binsize); int bin[bins][bins]; for(i=0;i<=bins;i++) /*zero out bin*/ { for(j=0;j<=bins;j++) { bin[i][j]=0; } } for(k=0;k<total;k++) { valuex=range/2.; valuey=

wordpress - the_post_thumbnail( array(x,y) ); -

i trying use wp function the_post_thumbnail( array(x,y) ); images are failing resize properly. it's not working correctly. specifically in page-template.php file i'm building trying use: the_post_thumbnail( array(200,200) ); yet resulting image 200 x 150. missing here? i tried explicitly add thumbnail size functions.php so: add_image_size( 'news-feature-thumb', 200, 200, true ); but made no difference. i looked on stackoverflow, i've seen nothing answers problem. using wp 3.3.1. method deprecated? after added add_image_size( 'news-feature-thumb', 200, 200, true ); try calling the_post_thumbnail that: the_post_thumbnail( 'news-feature-thumb' );

java - Call function of a Bean with ajax -

well guys need call correocontroller bean, im working jsf, ajax because need make email, , need make inbox. public message[] refrescar(string correo, string password, int tipomail) { properties prop = new properties(); prop.setproperty("mail.pop3.starttls.enable", "false"); prop.setproperty( "mail.pop3.socketfactory.class", "javax.net.ssl.sslsocketfactory"); prop.setproperty("mail.pop3.socketfactory.fallback", "false"); prop.setproperty("mail.pop3.port", "995"); prop.setproperty("mail.pop3.socketfactory.port", "995"); session sesion = session.getinstance(prop); switch(tipomail) { case 1:try { // se obtiene el store y el folder, para poder leer el // correo. store store = sesion.getstore("pop3"); store.connect( "pop.gmail.com", correo, password); folder folde

.htaccess - Redirect select pages to https -

i have simple question reason cannot figure out, , hours of searching has not helped either. using .htaccess file, how can redirect /login.php , /index.php https, , redirect other page http? use code redirect https, redirects every page: rewritecond %{server_port} !443 rewriterule ^(.*) https://www.ruxim.com/$1 [r] thank much. the %{server_port} variable depends on usecanonicalphysicalport in config. if it's not setup, may not able match against variable, easier use %{https} instead. rewritecond %{https} off rewriterule ^/?(login|index)\.php https://www.ruxim.com%{request_uri} [l,r] rewritecond %{https} on rewriterule !^/?(login|index)\.php http://www.ruxim.com%{request_uri} [l,r] if don't need redirect non-https, don't need second rule.

spring - Toggling JMS Listener on/off causes listener to hang -

we have spring project (3.0.5) listening jms queue (websphere 7). need ability toggle queue listener on/off. programmatically calling defaultmessagelistenercontainer.start() , stop() via our own restful endpoint toggle listener on/off. we have observed after toggling listener on 2 or 3 times (on/off/on or on/off/on/off/on) listener goes hung state , cannot toggle off. to debug going on have our log level set trace. when listener turned on see following message in our log: xxxx-xx-xx [mylistenercontainer-1] trace c.g.c.r.c.m.messagelistenercontainer - doreceiveandexecute - consumer [com.ibm.mq.jms.mqqueuereceiver@45486b51] of session [com.ibm.mq.jms.mqqueuesession@1872c950] did not receive message however, last time turn on listener before hangs, fail see message in log. extra details: getting hung state reproducible or without messages entering queue. the last time turn on listener before hangs, can "correct" hung state putting message on queue. once message

javascript - last child click doesnt change -

when select box 2 , i'd border become black. click should go yellow. the first click goes right second click stays black. can fix adding class, don't want to. how else can this? this code: <div class="aa"> <div class="bb">1</div> <div class="cc"></div> </div> <div class="aa"> <div class="bb">2</div> <div class="cc"></div> </div> $('.bb:last').addclass('yellow'); $('.bb').click(function () { $(this).next('.cc').fadetoggle(); if (!$('.cc:last').is(':hidden')) { $('.bb:last').addclass('black'); } else { $('.bb:last').removeclass('black'); $('.bb:last').addclass('yellow'); } }); .bb { background:red; width:90px; height:30px } .cc { background:blue; width:

jquery - using HtmlHelper in javascript with MVC and DataAnnotations jqGrid -

i created extension method works when not included in java script tag. public static class extensionmethods { public static string tickwrap(this htmlhelper source, mvchtmlstring mvchtmlstring) { return "'" + mvchtmlstring.tohtmlstring().replace("'", "''") + "'"; } } usage in view follows @html.tickwrap(html.displaynamefor(m => model.sampledatetime)) all it's doing grabbing display name attribute of data annotation listed below , displaying 'date , time' ticks around it. [display(name = "date , time")] public datetime sampledatetime {get; set;} i can't seem work in script tag however. getting javascript critical error syntax error. below script included in view. <script type="text/javascript"> $(function () { var displayname = @html.tickwrap(html.displaynamefor(m => model.sampledatetime)) alert(displayname); }); </

python - Twisted DeferredList only runs its callback half the time -

i'm trying make simple web scraper using twisted. have working, whenever try scrape more few hundred sites, hang indefinitely no discernible reason. seems work, except when stops @ end couple sites left process. i used tutorial here: http://technicae.cogitat.io/2008/06/async-batching-with-twisted-walkthrough.html blueprint. here code: class spider: """twisted-based html retrieval system.""" def __init__(self, queue, url_list): self.process_queue = queue self.start_urls = [] url in url_list: self.start_urls.append(url) def crawl(self): """extracts information each website in start_urls.""" deferreds = [] sem = defer.deferredsemaphore(30) url in self.start_urls: d = sem.run(self._crawl, url, self.process_queue) deferreds.append(d) dl = defer.deferredlist(deferreds, consumeerrors=1) dl.addcallba

MYSQL Select by this week with index -

user can see have uploaded in week. have below code in line: is correct? select * images userid = '$userid' , uploadeddate >= curdate() - interval weekday(day) day , uploadeddate < curdate() - interval weekday(day) day + interval 7 day order uploadeddate desc i have create index (userid, uploadeddate) . for original query work day needs in database you're querying (or set variable) , needs in mysql date '0000-00-00' or date time '0000-00-00 00:00:00' formats. weekday() returns 0-6 date entered. $first; //is earliest offset in range $last; //is latest offset in range select * images userid = '$userid' , uploadeddate > curdate() - interval $first day , uploadeddate < curdate() - interval $last day order uploadeddate desc so query return results last week. select * images userid = '$userid' , uploadeddate > curdate() - interval 14 day , uploadeddate < curdate() - interval 7 day order upl

html - Simple way of displaying images from parse.com database using javascript -

i working on simple page pulls , displays images table in parse.com. not have experience javascript might evident code below. i need images show in chronological order. current code, works fine of times little buggy. there 2 main problems: 1) sometimes, randomly, 1 particular new image might not come on top , instead show somewhere in between. 2) page works on firefox , chrome not on ie. is there better way implement or there should change? appreciated. page source- <!doctype html> <head> <meta charset="utf-8"> <title>my parse images</title> <meta name="description" content="my parse app"> <meta name="viewport" content="width=device-width"> <!-- <link rel="stylesheet" href="css/reset.css"> --> <link rel="stylesheet" href="css/styles.css"> <script type="text/javascript" src="http://ajax.go

sql - Select COUNT in two table in one query with MYSQL -

is there way can select count 2 table 1 single query. at moment have following , doesn't work correctly. select count(t1.id) t1_amount, count(t2.id) t2_amount table1 t1, table2 t2 here 1 way: select (select count(*) table1) t1_amount, (select count(*) table2) t2_amount here way: select t1.t1_amount, t2.t2_amount (select count(*) t1_amount table1) t1 cross join (select count(*) t2_amount table2) t2 your method not work because , in from clause cross join . cartesian product between 2 tables.

c# - What the lack of CRC-CCITT (0xFFFF)? -

based online crc calculation , when entered hex string data = 503002080000024400003886030400000000010100 i result crc-ccitt (0xffff) = 0x354e (expected result) . i use code below, results of calccrc16() 0xacee . lack of script below? using system; using system.windows.forms; using system.runtime.remoting.metadata.w3cxsd2001; using system.diagnostics; namespace windowsformsapplication1 { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { string result = calccrc16("503002080000024400003886030400000000010100"); debug.print(result); // result = acee // result expected = 354e } // crc-ccitt (0xffff) poly 0x1021 // input (hex string) = "503002080000024400003886030400000000010100" // result expected (hex string) = "354e"

Generating a datatable in JSF(or a page) from list of values retrieved from Javascript component -

i have datatable defined this: <div style="margin-top: 10px; padding: 3px 3px;"> <fieldset> <legend>sourcepublicationdates</legend> <f:facet name="header" > <h:outputtext value="add sourcepub date:"/> </f:facet> <h:inputtext id="sourcepublicationdate" value="#{dataentry.sourcepublicationdate}"> <c:ajax event="keyup" /> <c:ajax event="focus" /> <f:ajax execute="@this" render="sourcepublicationdate" /> </h:inputtext> <h:panelgroup style="padding-left: 3px;">

knockout.js - knockout js: initializing value of dropdown that is nested in an observableArray -

i have seen solutions elsewhere problem, have not yet found how make work in specific circumstances . an observablearray populates html list. inside list, user can edit 1 of values particular row. item edited in row observablearray populates dropdown list. array drop down list populated via ajax call when edit button on row clicked (edit button not shown in code below). i have working fine, except 1 important issue: of yet, value in dropdown list not being pre-populated. below gross mockup of real code doing. if call selectedteamtype selectedteamtype() in html, intial value is populated, further changes select box not registered. if call selectedteamtype selectedteamtype , intial value not set properly, further changes select box are registered. html <table> <tr> <!-- ko foreach: my.teamviewmodel.teams --> <td data-bind="text: teamid"></td> <td data-bind="text: teamtext"></td>

How can I get html content written by JavaScript with Selenium/Python -

this question has answer here: get html source of webelement in selenium webdriver using python 12 answers i'm doing web-crawling selenium , want element(such link) written javascript after selenium simulating clicking on fake link. i tried get_html_source(), doesn't include content written javascript. code i've written: def test_comment_url_fetch(self): sel = self.selenium sel.open("/rmrb") url = sel.get_location() #print url if url.startswith('http://login'): sel.open("/rmrb") = 1 while true: try: if == 1: sel.click("//div[@class='wb_feed_type sw_fun s_line2']/div/div/div[3]/div/a[4]") print "click" else: xpath = &quo

ruby - Why should I avoid using CGI? -

i trying create website using cgi , erb, when search on web, see people saying should avoid using cgi , , use rack . i understand cgi fork lot of ruby processes, if use fastcgi , 1 persistent process created, , adopted php websites too. plus fastcgi interface create 1 object 1 request , has performance, opposed rack creates 7 objects @ once. is there specific reason should not use cgi? or false assumption , entirely ok use cgi/fastcgi? cgi, mean both interface , common programming libraries , practices around it, written in different time. has view of request handlers distinct processes connected webserver via environment variables , standard i/o streams. this state-of-the-art in day, when there not "web frameworks" , "embedded server modules" think of them today. thus... cgi tends slow again, cgi model spawns 1 new process per connection. while spawning processes per se cheap these days, heavy web app initialization — reading , parsing

object - Intercepting field accesses/modifications in C++ -

whenever field of object modified or accessed, intercept it. want duplicate action in process contain copy of same object, , so, need base address of object, field offset, , value set. information, can create message tells other process modify. realize base pointers not same in 2 processes, that's ok. any suggestions on how this? other suggestions on how mirror these actions in other processes welcome, there need other processes - that's part of assignment. the pointer find address of object. copy constructor contain copy of same object.

java - How do I start a new vaadin project in IntelliJ IDEA? -

Image
the answer based on maven archetype approach works. update , accept answer based on using built in wizard if intellij wizard/template vaadin ever fixed.* i managed create new project using maven archetype terminal window, , import intellij idea, configured gwt facet, when run says: "error running unnamed: no gwt modules found in 'projectname'" i confess being total beginner @ java, intellij, , vaadin, not mention gwt. i tried creating new vaadin projet using native vaadin plugin comes intellij idea (ultimate). using ultimate, it's trial. update:: not see vaadin projects in new project window's list of available project templates. that's because confused two-levels-of-new-projects idea in intellij's new project wizard. sorted out now. update2:: can follow steps either of 2 answers below , project builds doesn't run. assume right add gwt run-target, because before run menu entirely grayed out. believe grayed out because there

T-SQL / SQL Server : help to calculate turnover time for account to become positve from negative balance -

Image
i need calculate turnover time of account become positive negative daily balance. example, account 12345 positive on 04/05/2013, has negative balance on 04/06, 04/07, 04/08 (three days) , on fourth day became positive. develop query calculate turnover time (4 days). account number transaction date daily balance 12345 4/1/2013 304 12345 4/2/2013 -78 12345 4/3/2013 -65 12345 4/4/2013 12 12345 4/5/2013 25 12345 4/6/2013 -345 12345 4/7/2013 -450 12345 4/8/2013 -650 12345 4/9/2013 105 12345 4/10/2013 110 110000 4/1/2013 150 110000 4/2/2013 -15 110000 4/3/2013 -56 110000 4/4/2013 -35 110000 4/5/2013 -15 110000 4/6/2013 106 110000 4/7/2013

ruby on rails - Nested resources with devise -

this routes file. devise_for :users, :path => 'accounts' resources :users resources :articles end how can show articles of users on main page? try (haml): - current_user.articles.each |article| = article.name you have sure have built association between users , articles correctly in articles_controller .

c++ - Error in including a Global Vector when used in multiple files -

// main.cpp #include <iostream> #include "common.h" #include "second.cpp" #include <vector> int main(){ global = 10; ip.push_back("testtest"); std::cout << global << std::endl; testclass t; t.print(); } //common.h #ifndef global_h #define global_h #include <vector> #include <string> extern int global; extern std::vector<std::string> ip ; #endif // second.cpp #include <iostream> #include "common.h" int global; class testclass{ public: void print();}; void testclass::print(){ global++; std::cout << "global: "<<global << std::endl; std::cout << "ip string: "<<ip[0] << std::endl; } // console error ubuntu:deleteme$ g++ main.cpp /tmp/ccojpyrl.o: in function `testclass::print()': main.cpp:(.text+0x55): undefined reference `ip' /tmp/ccojpyrl.o: in function `main': main.cpp:(.text+0xdd): undefined referen

Dropbox Core API - 1021 error before upload - only in iOS 5 and below -

this question has answer here: nsurlerrordomain error -1021 2 answers i integrated dropbox core api 2 of ios apps. successfully. few weeks ago, working fine. when run apps on devices ios 5.0 or ios 4.2, , try call uploadfile: api, error: error making request /1/files_put/sandbox/abc.xyz - (-1021) error domain=nsurlerrordomain code=-1021 "the operation couldnÕt completed. (nsurlerrordomain error -1021.)" userinfo=0x28af00 {destinationpath=/abc.xyz, sourcepath=/var/mobile/applications/fb0373c9-...c4f0874d40/documents/abc.xyz} where abc.xyz file name trying upload. -1021 error code comes in case of authentication failure while uploading. after file has been uploaded. time appears before upload starts. i tried loadmetadata: api, works fine, , returns metadata. on 2 devices latest ios installed, dropbox upload works fine. tried updating latest sdk, doe

javascript - jQuery : dynamically created div ID can't be selected? -

this question has answer here: event binding on dynamically created elements? 18 answers $('#content').droppable({ drop:function(event , ui){ $('<div>').appendto('#content'); $('#content div').load('div.html'); } }); below code doesn't select divcontainer id $('#divcontainer').click(function(){ $('#divcontainer').hide(); }); this html page div.html <div id="divcontainer"> samplediv </div> the div gets added page can't select div using it's id ! the $('#divcontainer').click code needs go inside done section once data loaded in $('#result').load('div.html', function() { $('#divcontainer').click(function(){ $('#divcontaine

c# 4.0 - How to convert given data into IEnumerable object using LINQ -

i have below code in c# 4, trying use linq ordering, grouping. ilist<component> components = component.organizationalitem.organizationalitem.components(true); ienumerable<component> baggage = components.where(x => x.isbasedonschema(constants.schemas.baggageallowance.tostring())) .orderby(x => x.componentvalue("name").stringvalue("code")) .groupby(x => x.componentvalue("name").stringvalue("code")); in above sample when trying use groupby giving error, please see below: error 1 cannot implicitly convert type 'system.collections.generic.ienumerable>' 'system.collections.generic.ienumerable'. explicit conversion exists (are missing cast?) the result of groupby igrouping<string, component> - it's sequence of groups of components, rather 1 sequence of components. that's whole point of g

How to create a tree of category subcatagory in php -

i trying create tree ordered select box array of category, subcategory data. array array ( [0] => array ( [id] => 6 [cata_key] => 32e9c75e38d2a1d77b2b49b2 [cata_name] => road [app_key] => b80e0935b348da61b2a807ff [parentid] => 0 ) [1] => array ( [id] => 7 [cata_key] => 56bae4297efcbf796b230a99 [cata_name] => river [app_key] => b80e0935b348da61b2a807ff [parentid] => 0 ) [2] => array ( [id] => 8 [cata_key] => 1c748603f36105b921b54165 [cata_name] => air [app_key] => b80e0935b348da61b2a807ff [parentid] => 0 ) [3] => array ( [id] => 9 [cata_key] => 780c3eb53264d5c33a26d49f [cata_name] => cars [app_key] => b80e0935b348da61b2a807ff [parentid] => 6 ) [4] => array ( [id] => 10

cocos2d iphone - How to destroy a body with CCPhysicsSprite -

i've realized ccphysicssprite different in few ways ccsprite. example, must set body before set position of sprite. believe 1 of these differences causing exc_bad_access error when try destroying body. call schedulesprite method in update method. -(void)schedulesprite { if ([testsprite physicssprite].b2body != null) { b2vec2 force = b2vec2(-5, 10.0 * [testsprite physicssprite].b2body->getmass()); [testsprite physicssprite].b2body->applyforce(force, [testsprite physicssprite].b2body->getworldcenter() ); if ([testsprite physicssprite].position.x < 0) { world->destroybody([testsprite physicssprite].b2body); [testsprite physicssprite].b2body = null; } } } i exc_bad_access pointing line b2vec2 pos = _b2body->getposition(); in the -(cgaffinetransform) nodetoparenttransform method, within class ccphysicssprite.mm thanks. despite destroyed body , sprite keep doing stuff, may remove sprite parent also, like.- if ([testsprite physicssp

asp.net mvc 4 - Bundling and Minification Issue in Chrome but works fine in Mozilla -

Image
i have few js files trying bundle using mvc4, code follows:- public static void registerbundles(bundlecollection bundles) { //global app items go here. bundles.add(new scriptbundle("~/scripts/modernizr") .include("~/scripts/modernizr-*")); bundles.add(new scriptbundle("~/bundles/lib") .include( "~/scripts/jquery.js", "~/scripts/jquery.unobtrusive*", "~/scripts/jquery.validate*", "~/scripts/jquery-ui*", "~/scripts/jquery.tablesorter.js")); bundles.add(new stylebundle("~/content/bootstrap") .include("~/content/bootstrap.css")); var lessbundle = new bundle("~/content/myapp").include( "~/content/jquerymultiselect.less", "~/content/scrollbars.css"); lessbundle.transforms.add(new lesstransform()); lessbundle.transf

python - Partially initializing base class -

couldn't think of better question title. feel free edit. have base class inherited many classes (which in turn may have more sub-classes). each class, have sequence of operations need perform post-initialization. sequence encapsulated in function runme() performs series of object method calls class mybase(object): def __init__(self,neg,op,value): self.neg = neg self.op = op self.value = value #process self.runme() def runme(self): self.preprocess() self.evaluate() self.postprocess() def preprocess(self): pass def evaluate(self): pass def postprocess(self): pass the sub-classes have accept same attributes base (and additional attributes). of them over-ride 3 functions - preprocess , evaluate , postprocess class childa(mybase): def __init__(self,neg,op,value,ad1): super(childa,self).__init__(neg,op,value) self.ad1 = ad1 #must

An Interesting phenomenon of Lua's table -

i'm new lua, , i'm learning usage of table these days. tutorials know lua treats numeric indexed items , non-numeric indexed items differently, did tests myself, , today found interesting phenomenon , can't explain it: the code t = {1, 2, 3, a='a', b='b'} print(#t) gets 3 because # operator counts numeric indexed items only. tested following code t = {1, 2, 3, a='a', b='b'} print(#t) = 100,200 t[i] = end print(#t) i get 3 3 till think lua treats discontinuous items added later non-numeric indexed ones. however, after change code little bit t = {1, 2, 3, a='a', b='b'} print(#t) = 100,300 t[i] = end print(#t) i get 3 300 i'm confused phenomenon, know reason? thanks. (this phenomenon can reproduced @ http://www.lua.org/cgi-bin/demo ) update: i tried code t = {1, 2, 3, a='a', b='b'} print(#t) = 100,300 t[i] = print("add", i, #t) end = 100,300

pentaho - A line chart with a data table docked under the x-axis -

how can make line chart data table docked under x-axis in dashboard this. http://www.advsofteng.com/gallery_line.html the chart name product line global revenue are using dashboard designer in ee version, or ce? i.e. cde? should quite simple in cde. create datasource, create layout couple of panels. add table component table, , chart component line chart. same approach in reporting - there no individual component allows both @ once, use same dataset , create chart, create table. if you're not yet using cde / ctools, recommend take look, install via marketplace or via ctools-installer.sh

jsf - How to display vertical and horizontal headers in p:datatable? -

i'm trying display table has both vertical , horizontal headers jsf 2.1.7 , primefaces 3.3.1. this do: <table> <thead> <tr> <th></th> <th>hor 1</th> <th>hor 2</th> </tr> </thead> <tbody> <tr> <th>vert 1</th> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <th>vert 2</th> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </tbody> </table> this best managed achieve: <p:datatable value="#{ctrl.values}" var="val"> <p:column styleclass="ui-state-default"> <h:outputtext value="vertical header" /> </p:column> <p:column headertext=&quo

XMPP "stream:error (conflict)" on login with (a)Smack -

currently working xmpp/jabber chat android.i tried openfire , try connect jabber account.connection successful.but not able send message.it shows conflict error.please check error log.give me solution this. initializing connection server eworks port 5222 connected: true creating entry buddy 'testuser2' name testuser2 sending mesage 'hello mate' user testuser2@eworks buddy:testuser2 - status:null stream:error (conflict) @ org.jivesoftware.smack.packetreader.parsepackets(packetreader.java:306) @ org.jivesoftware.smack.packetreader.access$000(packetreader.java:44) @ org.jivesoftware.smack.packetreader$1.run(packetreader.java:76) a xmpp stream:error because of conflict means there connection same full jid (that bare jid , resource part). most xmpp servers able handle conflicts re-assigning different resource once conflict detected. behavior can configured.

git - Want to setup a hook that copies committed files to a particular folder -

background: developing facebook app using php laravel framework & mysql database. i have setup gitlab on our development server , created repository on team has been added , committing & pushing code. what is, when push code particular branch on gitlab (for example master) available @ /var/www/productname can test within facebook canvas (certain things happen there can't tested on local machine). however, don't want hook copy files on every time push happens on master, files modified. can out such hook? thank you. use rsync rather cp operation. diff checking automatically. way post-commit hook doesn't become needlessly complicated.

network programming - In Android, Which is more suitable for uploading large files? a service on separate process or -

when application needs upload many large files, better solution: 1) doing on separate process ( i.e. remote service )? 2) using separate thread (or asynctask )? is there clear , definite answer this? the application, way, uploading things time - small chunks of data. every , needs send large files, want separate mechanism 1 using. (btw small chunks using single task thread works great) i understand asynctask one-time operations , threads better many-operations it better use asynctask asynstask nothing thread since uploading multiple files, multithreading necessary avoid exception

objective c - A good way to serialize changes in object graphs using NSCoding? -

i have graph of objects support nscoding . , have separate class takes care of serialization itself, ie. detects changes in object graph , uses nskeyedarchiver save file. i’m happy design, i’m not sure how watch changes in object graph. 1 general solution thought of add version property each object gets incremented each change: - (void) setfoo: (id) newfoo { _foo = newfoo; self.version++; } when object in graph references other objects, observes version (using kvo) , if changes, change propagated upwards. serialization class observes version of root node. this works, managing kvo stuff cumbersome , prone errors. can think of a better solution? 1 further constraint objects know little serialization possible. should know how serialize (by implementing nscoding ), shouldn’t care more. this has common problem in serialization frameworks, right?

php - symfony redirect user after authentication -

i have 2 bundles userbundle , xxxbundle. want after authenticating user in user bundle redirect xxxbundle. but, depending on roles (role_admin , role_user), redirect him 2 different routes (route1, route2). i added controller userbundle class securitycontroller extends controller { public function loginaction() { if ($this->get('security.context')->isgranted('role_admin')) { return $this->redirect($this->generateurl('route1')); } if ($this->get('security.context')->isgranted('role_user')) { return $this->redirect($this->generateurl('route2')); } $request = $this->getrequest(); $session = $request->getsession(); // on vérifie s'il y des erreurs d'une précédent soumission du formulaire if ($request->attributes->has(securitycontext::authentication_error)) { $error = $request->attributes->get(securitycontext::authentication_error);

c - GCC constructor NOT execute -

this question gcc constructor, compile & link right, not run. there a.c: utest_begin() uid(a_test) { printf("a test"); return true; } utest_end(a) b.c simlar: utest_begin() uid(b_test) { printf("b test"); return true; } utest_end(b) the code object using uid() link test functions. first version add utest_begin() utest_end() enclose uid(), @ last realize utest_bgin() utest_end() isn't necessary, when change them unpredicated result. when change definition of utest_begin(), uid(), utest_end(), got different result. the basic idea come can-i-auto-collect-a-list-of-function-by-c-macro ! test 1: #define utest_begin() \ static const bool __m_en = true; \ static struct __uti *__m_uti_head = null; bool utest_item_list_add_global(struct __uti *uti); #define uid(f) \ static bool __uti_##f(void);

mysql - Place a footer row as an header row of a group of rows -

i have table following : rfa_yea | rfa_idx | rfa_dsp | rfa_tpr ---------+---------+----------------------------------------------------+--------- 2013 | 1 | pigato verm.no/ross/ormeasco cl75 | 2013 | 2 | estate\134134134047 bicchiere sing.verde | 2013 | 3 | rif. trn. n. 17 del 17/04/2013 cassa n. 00001 | c 2013 | 4 | bib.red bull lat.cl25 ener.dri | 2013 | 5 | bib.red bull lat.cl25 ener.dri | 2013 | 6 | shopper 30x60 maxi x 1000 | 2013 | 7 | shopper hd 27x50 medie x 1000 | 2013 | 8 | pigato verm.no/ross/ormeasco cl75 | 2013 | 9 | * sconto subtotale | 2013 | 10 | rif. trn. n. 19 del 17/04/2013 cassa n. 00001 | c the record field rfa_tpr marked 'c' header of gr